Feat/tool script safety guard#123
Open
zzp1221 wants to merge 6 commits into
Open
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #123 +/- ##
==========================================
Coverage ? 87.79247%
==========================================
Files ? 474
Lines ? 45005
Branches ? 0
==========================================
Hits ? 39511
Misses ? 5494
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
306046f to
04bc75a
Compare
c34ed23 to
1d77714
Compare
Contributor
|
是否可以提供一个和quickstart一样的结构目录的例子?目前看实现的代码没有这个,期望可以深刻理解该issue实现的功能特性,另外,补充一下设计文档,方便理解 |
bfe8db3 to
f71c80f
Compare
Author
|
@raychen911 您好,已根据您的建议补齐了quickstart和设计文档。
|
Contributor
|
建议例子按照quickstart的目录格式来写,包含agent/目录,run_agent.py这些文件,保持和其他例子的一致性,方便用户使用 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary
Add a configurable pre-execution safety guard for Python scripts and Bash commands used by tools, skills, and code
execution flows.
The guard can scan script-like inputs before execution, classify risk as
allow,deny, orneeds_human_review,emit structured reports, and write audit events.
What Changed
Added
trpc_agent_sdk.tools.safetywith:Added CLI utility:
scripts/tool_safety_check.pyAdded example assets:
examples/tool_safety_guard/tool_safety_policy.yamlAdded acceptance coverage for:
Validation
Result:
32 passed
Notes
This guard is a pre-execution static control. It does not replace sandbox isolation because static scanning can miss
obfuscated code, generated strings, downloaded second-stage scripts, shell expansion behavior, and interpreter-
specific behavior. Production use should still rely on sandboxing, least-privilege credentials, filesystem and network
egress controls, process limits, timeouts, and post-execution auditing.