Sub topic 3
Deciding which actions need approval
This chapter assumes you can read short Python programs, know how an agent calls tools, and are comfortable with JSON-like data. Its job is narrow. Given a tool call, decide whether a human must approve it before it runs.
Why not approve everything?
If every call needs approval, reviewers click "yes" without reading, and the checkpoint stops protecting anything. If no call needs approval, one bad call can send an email or delete data. You need a rule that sorts calls into "run now" and "ask first."
Two questions to ask about each tool
Ask these about every tool, not every call.
- Reversibility: Can the effect be undone? Reading a document can be repeated at no cost. A sent email cannot be taken back.
- Blast radius: Who or what does it affect? A change to one test record is small. A change to every customer account is large.
Add a third question for tools that touch money, personal data, or outside parties: Does it leave your system? Anything that reaches a customer, a payment provider, or a public page deserves extra caution.
| Tool example | Reversible? | Blast radius | Risk |
|---|---|---|---|
| `search_docs` | Yes, read only | None | Low |
| `draft_reply` | Yes, nothing is sent | One draft | Low |
| `send_email` | No | External person | High |
| `delete_record` | Hard | Data store | High |
A risk lookup table
The simplest classifier is a table that maps each tool name to a risk level. The code below treats any tool it doesn't know as high risk.
from dataclasses import dataclass
@dataclass(frozen=True)
class ToolCall:
name: str
args: dict
RISK = {
"search_docs": "low",
"send_email": "high",
"delete_record": "high",
}
def risk_of(call: ToolCall) -> str:
# Unknown tools default to high risk, so new tools need approval until classified.
return RISK.get(call.name, "high")
print(risk_of(ToolCall("search_docs", {"query": "refund policy"})))
print(risk_of(ToolCall("export_users", {})))The first call prints low. The second prints high, because export_users is not in the table. This default is deliberate. When a developer adds a new tool and forgets to classify it, the failure is an extra approval prompt. The alternative failure is an unreviewed action.
Classifying by arguments, not only by name
Sometimes the same tool is safe or dangerous depending on its arguments. A delete_record call on a scratch table differs from one on the customer table. You can extend the classifier to look at arguments.
def risk_of_with_args(call: ToolCall) -> str:
base = RISK.get(call.name, "high")
if call.name == "delete_record" and call.args.get("table") == "scratch":
return "low"
return base
print(risk_of_with_args(ToolCall("delete_record", {"table": "scratch", "id": 7})))
print(risk_of_with_args(ToolCall("delete_record", {"table": "customers", "id": 7})))Keep these exceptions few and explicit. Each one is a hole in the gate that someone must keep correct.
Common errors
- Classifying by how scary the name sounds. Judge by effect. A tool called
update_statusmight notify a customer. - Trusting the model's own risk estimate. The agent can be wrong or manipulated. Keep the table in code that the model cannot edit.
- Defaulting unknown tools to low risk. This turns every new tool into an unreviewed one.
- Forgetting chained effects. A low-risk read that feeds a high-risk write is still a risk. The gate on the write catches it.
Exercise
A new tool called archive_project moves a project to cold storage. A developer adds it to the agent but does not add it to the RISK table. What does risk_of return, and why is that the safer behavior?
Show answer
It returns "high", because RISK.get(call.name, "high") falls back to "high" for unknown names. Calls to the new tool need approval until someone classifies it, so a missing entry causes an extra prompt instead of an unreviewed action.
Exercise
Name the two main questions you ask about a tool to classify its risk, and give a tool that is low on both.
Show answer
Whether its effect is reversible, and how large its blast radius is. search_docs is low on both: it only reads, and it changes nothing.