Least Privilege for Agents
The OWASP AI Agent Security Cheat Sheet prescribes: grant agents the minimum required tools, use per-tool permission scoping, require explicit authorization for sensitive operations, and maintain separate tool sets for different trust levels. An agent that summarizes emails should not have exec(), subprocess.run(), or filesystem write access.
Human-in-the-Loop (HITL)
For high-stakes actions (financial transactions, data deletion, external API calls), require human approval before execution. The agent proposes the action, a human reviews and approves or rejects. This breaks the automated attack chain — even if the agent is compromised, destructive actions require human confirmation.
# Least privilege tool registration
# BAD: overpowered agent
tools = [
exec_code, # arbitrary execution
shell_command, # full shell access
write_any_file, # unrestricted writes
]
# GOOD: scoped agent
tools = [
search_docs, # read-only retrieval
summarize_text, # no side effects
draft_email, # draft only, no send
]
# Sensitive actions require approval:
if action.risk_level == "high":
await human_approval(action)
The STAC defense: Human-in-the-loop also mitigates STAC attacks. A human reviewing the full chain of proposed actions can spot cumulative malicious intent that per-call checks miss. The cost is latency and user friction.