Treat retrieved content as data
An agent reads web pages, documents, repository files and tool output to do useful work. Those sources may also contain adversarial instructions. OWASP's prompt-injection guidance describes the risk when lower-trust content influences behavior beyond the user's intended task. The safe boundary is not a sentence telling the model to be careful; it is the system that decides whether a proposed effect is authorized.
Bind each consequential operation to the authenticated user or workload, the allowed resource, the exact requested parameters and any necessary approval. A tool schema describes what can be called; it does not prove that a particular call should be allowed now. Use narrow identities and permissions, and keep secrets out of prompts and logs where possible.
Place human review where effects occur
Human-in-the-loop review helps when an action is sensitive, irreversible or hard to validate automatically. Present the reviewer with the proposed action, affected resource, evidence, alternatives and failure consequences. Approval of “continue” is too vague if the agent can change recipients, amounts, permissions or files afterwards.
An agent drafts a pull request from a public issue. It may inspect allowed files and run tests with read-scoped credentials. Publishing comments, merging or changing a private repository requires a separate authorized path. Before publication, show the exact destination, diff and test result; after the action, retain a receipt.
If an external call times out, the outcome may be unknown. Reconcile the service's state before retrying. Stable idempotency keys can prevent duplicate effects where a service supports them; otherwise, an explicit compensating action or human review may be needed.
Turn threats into acceptance tests
Test a document that tells the agent to ignore the user, a tool result that asks for a secret, an expired approval and a changed action after approval. The pass condition is observable: the wrong operation is rejected, the incident is recorded, and allowed work can continue within scope.
Read the original work
These sources support the specific concepts above. Their task settings and publication status matter when applying a result.

- OWASP LLM01 Prompt InjectionRead for common injection paths and mitigations; translate each relevant threat into a system test.
- NIST AI Risk Management FrameworkRead for governance and risk-management structure rather than an agent-specific approval recipe.
- OWASP Agentic AI ThreatsUse as a current threat catalogue; check publication status and version before treating an item as normative.
- Google Cloud · Human-in-the-loop patternGoogle Cloud architecture figure; converted from SVG to PNG.