Sub topic 3
Human Approval and Blast-Radius Controls
Assume you understand LLM tool calling, authentication tokens, and basic access control. This chapter focuses on controls that limit damage when an agent makes a wrong or manipulated decision.
Require approval for high-impact actions
An agent should not perform an irreversible or high-impact action on model output alone. Examples include sending email, deleting records, publishing content, transferring money, or changing permissions.
The approval step should show the exact action and arguments. Approving “delete data” is weaker than approving “delete record 1842 from the test database.” Deny by default when approval is unavailable.
HIGH_RISK = {"send_email", "delete_record"}
def execute(name, args, tools, approve):
if name in HIGH_RISK and not approve(name, args):
return {"status": "denied"}
return {"status": "ok", "result": tools[name](**args)}Separate data and outbound channels
Private data, untrusted content, and an outbound channel form a dangerous combination. A prompt injection in an imported document could instruct the agent to copy private records into an email.
Reduce this risk by separating responsibilities:
- Keep untrusted text in a data-only component.
- Give retrieval tools access only to the required records.
- Put email, web posting, and file upload behind separate authorization.
- Do not let one tool both read sensitive data and send arbitrary content.
Sandbox execution and limit egress
Run generated code in a sandbox with isolated files, low resource limits, and no unnecessary network access. Network egress means connections leaving the sandbox. Allow only named hosts and required ports. A sandbox limits impact, but it does not replace authorization.
Control volume and record decisions
Rate limits and budgets cap the blast radius of loops or repeated mistakes. Limit calls per task, tokens, runtime, financial value, and records changed. Stop when a threshold is reached.
Log every tool call with the task identity, user, tool name, validated arguments, decision, result status, and timestamp. Redact secrets and sensitive result data. Logs support detection, incident review, and permission changes.
| Control | Useful evidence |
|---|---|
| Approval | Who approved the exact arguments |
| Budget | Calls, cost, and records changed |
| Audit log | Tool, task, time, and outcome |
Review and test permissions
Review the tool allowlist and credentials against one concrete task. Remove tools that are merely convenient. Test prompt injections, unauthorized arguments, repeated calls, malformed inputs, and failed approvals. Verify that private data cannot reach an outbound tool without the intended approval path.
Exercise
An agent can read customer records and send email. What control should you add first?
Show answer
Separate the read and outbound permissions, then require human approval for the exact email and recipients.