@@ -62,9 +62,9 @@ permissions, and runtime resource limits.
6262
6363``` bash
6464python scripts/tool_safety_check.py \
65- --policy tool /safety/examples/tool_safety_policy.yaml \
65+ --policy trpc_agent_sdk/tools /safety/examples/tool_safety_policy.yaml \
6666 --language python \
67- --script-file tool /safety/examples/samples/03_dangerous_delete.py \
67+ --script-file trpc_agent_sdk/tools /safety/examples/samples/03_dangerous_delete.py \
6868 --output tool_safety_report.json \
6969 --audit-file tool_safety_audit.jsonl
7070echo $? # 0=allow, 2=deny, 3=review, 4=input/policy error
@@ -74,23 +74,23 @@ Run the manifest to scan all 14 public samples:
7474
7575``` bash
7676python scripts/tool_safety_check.py \
77- --policy tool /safety/examples/tool_safety_policy.yaml \
78- --manifest tool /safety/examples/samples/manifest.yaml \
79- --manifest-output tool /safety/examples/manifest_run.json \
80- --audit-file tool /safety/examples/tool_safety_audit.jsonl
77+ --policy trpc_agent_sdk/tools /safety/examples/tool_safety_policy.yaml \
78+ --manifest trpc_agent_sdk/tools /safety/examples/samples/manifest.yaml \
79+ --manifest-output trpc_agent_sdk/tools /safety/examples/manifest_run.json \
80+ --audit-file trpc_agent_sdk/tools /safety/examples/tool_safety_audit.jsonl
8181```
8282
8383## Programmatic usage
8484
8585``` python
86- from tool .safety import (
86+ from trpc_agent_sdk.tools .safety import (
8787 ToolSafetyGuard,
8888 load_safety_policy,
8989 SafetyScanRequest,
9090 ScriptLanguage,
9191)
9292
93- policy = load_safety_policy(" tool /safety/examples/tool_safety_policy.yaml" )
93+ policy = load_safety_policy(" trpc_agent_sdk/tools /safety/examples/tool_safety_policy.yaml" )
9494guard = ToolSafetyGuard(policy)
9595
9696request = SafetyScanRequest(
@@ -108,8 +108,8 @@ print(report.decision, report.rule_ids)
108108
109109``` python
110110import subprocess
111- from tool.wrapper import SafetyWrappedCallable
112- from tool .safety import ToolSafetyGuard, load_safety_policy, ScriptLanguage
111+ from trpc_agent_sdk.tools.safety import SafetyWrappedCallable
112+ from trpc_agent_sdk.tools .safety import ToolSafetyGuard, load_safety_policy, ScriptLanguage
113113
114114guard = ToolSafetyGuard(load_safety_policy(" policy.yaml" ))
115115safe_run = SafetyWrappedCallable(
@@ -131,8 +131,8 @@ names so the normalized request contains every available execution field.
131131### Wrapping a code executor
132132
133133``` python
134- from tool.wrapper import SafetyCheckedExecutor
135- from tool .safety import ToolSafetyGuard, load_safety_policy, ScriptLanguage
134+ from trpc_agent_sdk.tools.safety import SafetyCheckedExecutor
135+ from trpc_agent_sdk.tools .safety import ToolSafetyGuard, load_safety_policy, ScriptLanguage
136136
137137guard = ToolSafetyGuard(load_safety_policy(" policy.yaml" ))
138138safe_executor = SafetyCheckedExecutor(
@@ -255,13 +255,13 @@ When OpenTelemetry is active the guard sets these low-cardinality span
255255attributes on the current span:
256256
257257` ` ` text
258- tool .safety.decision
259- tool .safety.risk_level
260- tool .safety.rule_id # comma-separated, bounded to 8 entries
261- tool .safety.blocked
262- tool .safety.redacted
263- tool .safety.scan_duration_ms
264- tool .safety.policy_hash
258+ trpc_agent_sdk.tools .safety.decision
259+ trpc_agent_sdk.tools .safety.risk_level
260+ trpc_agent_sdk.tools .safety.rule_id # comma-separated, bounded to 8 entries
261+ trpc_agent_sdk.tools .safety.blocked
262+ trpc_agent_sdk.tools .safety.redacted
263+ trpc_agent_sdk.tools .safety.scan_duration_ms
264+ trpc_agent_sdk.tools .safety.policy_hash
265265```
266266
267267Metrics emitted (no-op when OTel is absent):
@@ -302,7 +302,7 @@ all argument-mutating callbacks. The wrapper remains mandatory until then.
302302Implement :class:` SafetyRule ` and pass the rule list explicitly:
303303
304304``` python
305- from tool .safety import ToolSafetyGuard, SafetyScanRequest
305+ from trpc_agent_sdk.tools .safety import ToolSafetyGuard, SafetyScanRequest
306306
307307class MyRule :
308308 rule_id = " CUSTOM001_MY_RULE"
@@ -397,7 +397,7 @@ tool/
397397scripts/
398398 tool_safety_check.py # CLI
399399tests/tool_safety/ # safety guard tests
400- tool /safety/examples/
400+ trpc_agent_sdk/tools /safety/examples/
401401 tool_safety_policy.yaml # sample policy
402402 samples/ # 14 public samples + manifest
403403 tool_safety_report.json # generated report
0 commit comments