Sub topic 6
What to show the reviewer
This chapter assumes you have read the earlier chapters on building an approval gate and on decision types. You should be comfortable with Python dictionaries and with the idea that an agent proposes a tool call and a person decides on it.
Why the request matters
An approval gate is only as good as the information the reviewer sees. If the request says "Agent wants to run send_email. Approve?", the reviewer cannot judge it. They will either approve without looking or reject out of caution. Both outcomes defeat the gate.
A good approval request lets a reviewer answer three questions in a few seconds:
- What exactly will happen?
- Why does the agent want to do it?
- What happens if I approve, and can it be undone?
What to include
Build the request from the pending tool call plus some context from the run.
| Field | Purpose | Example |
|---|---|---|
| Action | The tool name in plain words | Send email |
| Arguments | The exact values, not a summary | to, subject, body |
| Reason | The agent's stated purpose, kept separate from the action | "Customer asked for a refund confirmation" |
| Risk and reversibility | Why this call needs a human | High, cannot be unsent |
| Effect | The concrete outcome | "1 email to an external address" |
| Fingerprint | Ties the decision to this action | SHA-256 hash |
| Options | The decisions allowed | approve, edit, reject |
Show the real arguments. A summary written by the model can differ from the call that will run. If the agent says "I will email the customer" but the to field holds a different address, the reviewer must be able to see that.
Label the agent's reasoning as the agent's claim. It is useful context, but it is not evidence that the action is safe. This matters for prompt injection, which a later chapter covers.
A request builder
The function below turns a tool call into a request a UI can render. It reuses risk_of and fingerprint from earlier chapters.
import json
REVERSIBLE = {"search_docs": True, "send_email": False, "delete_record": False}
def build_request(call, reason, run_id):
return {
"run_id": run_id,
"action": call.name.replace("_", " "),
"arguments": call.args,
"agent_reason": reason,
"risk": risk_of(call),
"reversible": REVERSIBLE.get(call.name, False),
"fingerprint": fingerprint(call),
"options": ["approve", "edit", "reject"],
}
def render(request):
lines = [
f"Action: {request['action']} (risk: {request['risk']})",
f"Reversible: {'yes' if request['reversible'] else 'no'}",
"Arguments:",
json.dumps(request["arguments"], indent=2),
f"Agent says: {request['agent_reason']}",
]
return "\n".join(lines)Unknown tools default to False for reversibility, which matches the high-risk default for unknown tools.
Design choices
- Put the decision first. Lead with the action and the risk, then the details.
- Show arguments in full, but highlight what matters. For an email, show the recipient domain and attachment names prominently. Long bodies can be collapsed, but never dropped.
- Show a diff for edits. When a reviewer edits arguments, display the original and edited values side by side so the change is clear in the audit record.
- Include enough context to avoid a second lookup. If the call refers to record 4812, show the record's name. A bare ID forces the reviewer to open another tool.
- Keep it short. Every extra field competes for attention. Cut anything that does not change the decision.
- Make rejection easy and ask for a reason. The reason goes back to the agent, so it can try another approach.
Common errors
- Showing only a model-written summary. The summary may omit or misstate arguments.
- Truncating arguments silently. A hidden tail of a long field can hold the harmful part. If you truncate, say so and offer the full text.
- Mixing agent text with system text. Render the agent's reason in a clearly separate area so it cannot imitate system warnings.
- Omitting reversibility. Reviewers treat all requests as equally risky if you do not say which ones can be undone.
Exercise
An agent proposes delete_record with {"id": 4812} and the reason "Duplicate entry". Name three things you would add to the approval request so the reviewer can decide, and say why the raw ID alone is not enough.
Show answer
Add the record's human-readable name or key fields, so the reviewer can confirm it is the duplicate. Add the reversibility note (deleted records cannot be restored) and the risk level. Add the fingerprint so the decision is tied to this exact call. A bare ID forces the reviewer to look the record up elsewhere, which they often skip, and the agent's reason "Duplicate entry" is only a claim that the reviewer should be able to check.