Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.lock
*.log
examples/*.log
examples/tool_safety/real_agent_safety_audit.jsonl

trpc-agent-py.egg-info

Expand Down
13 changes: 13 additions & 0 deletions docs/mkdocs/en/tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ Tool is the core mechanism for extending Agent capabilities in trpc_agent. With
- **MCP protocol**: STDIO, SSE, and Streamable HTTP transports
- **Session management**: Automatic session health checks and reconnection for MCP toolsets

### Tool Safety Checks

Tools that execute shell commands, Python code, file operations, or network requests can
enable the Tool Script Safety Guard before execution. It statically scans scripts and
commands, returns `allow`, `needs_human_review`, or `deny`, and can emit audit logs and
structured safety reports. `deny` is blocked before the execution boundary; review
decisions can also be blocked through configuration.

See the complete usage example in
[examples/tool_safety/README.md](../../../examples/tool_safety/README.md), and the request
flow and risk decision model in
[examples/tool_safety/DESIGN.md](../../../examples/tool_safety/DESIGN.md).

## How Agents Use Tools

Agents dynamically use tools through the following steps:
Expand Down
12 changes: 12 additions & 0 deletions docs/mkdocs/zh/tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ Tool(工具)是 trpc_agent 中扩展 Agent 能力的核心机制。借助工
- **MCP 协议**:完整支持 STDIO、SSE、Streamable HTTP 三种传输方式
- **会话管理**:MCP 工具集支持自动会话健康检查与重连

### Tool 安全检查

对于会执行 shell、Python、文件或网络操作的 Tool,可以在真实执行前启用
Tool Script Safety Guard。它会对命令和脚本进行静态扫描,输出 `allow`、
`needs_human_review` 或 `deny`,并支持审计日志和结构化安全报告。`deny` 会在
执行边界前阻断,`needs_human_review` 可按配置决定是否阻断。

完整使用示例见
[examples/tool_safety/README.md](../../../examples/tool_safety/README.md),处理流程和
风险决策见
[examples/tool_safety/DESIGN.md](../../../examples/tool_safety/DESIGN.md)。

## Agent 如何使用工具

Agent 通过以下步骤动态使用工具:
Expand Down
367 changes: 367 additions & 0 deletions examples/tool_safety/DESIGN.md

Large diffs are not rendered by default.

Loading
Loading