Stop A Dangerous Tool
SDKDeny a named function, or a shell command that contains text you listed, before that function runs.
Some tools should not run just because a model decided to call them. High-Risk Tool denies a function by its name, such as delete_account. Dangerous Shell Commands denies a listed tool when the command text contains a string you wrote, such as rm -rf.
Both run before the function body. A denied call shows up in Decision Log as Denied, from the SDK, in Block. The trace is still saved.
Two Different Checks
| Policy | What it reads | Example |
|---|---|---|
| High-Risk Tool | The function name only. | delete_account is denied. lookup_user still runs. |
| Dangerous Shell Commands | The command text on the tools you list. | shell with rm -rf is denied. shell with ls still runs. |
Not A Sandbox
Turn It On
- Open Policies and click Create Policy.
- For a function that should never run unsupervised, choose High-Risk Tool and type the name, such as
delete_account. - For a shell helper, choose Dangerous Shell Commands. Under Block If Command Contains, add
rm -rf. Under Applies To, list the tool name, usuallyshell. - Set the mode to Block, then Activate Policy.
- Wrap the agent with
govern()and mark those functions as tools. Both cards say SDK. They do not apply on the Gateway.
If a shell call has no command text, that rule is skipped and the tool still runs. High-Risk Tool does not need arguments. The name is enough to deny.
A Small Ops Agent
This function never reaches a real shell. The policy denies the call before the body runs. Get the API key from app.traccia.ai.
from traccia import init, govern, observefrom traccia.governance import AgentBlockedError
init( api_key="...", endpoint="https://api.traccia.ai/v2/traces", agent_id="ops-shell",)
@observe(name="shell", as_type="tool")def shell(command: str) -> dict: return {"ok": True, "command": command}
@govern(fail_open=False, name="ops_shell")def handle_ticket(command: str) -> dict: return shell(command)
try: handle_ticket("rm -rf /tmp/cache")except AgentBlockedError as exc: print(exc)The same wrap denies delete_account when a High-Risk Tool policy lists that name. lookup_user is a different name, so it runs.
What This Does Not Do
fail_open stays at its default and Traccia cannot be reached, the tool still runs.Next Steps
© 2026 Traccia.