// How-to · Let agents run safely
Defending agents against prompt injection from web pages and documents
There is no complete fix for prompt injection today. In practice you treat external content as untrusted data and limit the damage an agent can do after reading it.
verified 2026-10-102 official sources
Scenario: Let agents run safely →
Symptoms
- After reading a web page or issue, the agent starts doing things unrelated to the task
- Tool output contains text like “ignore previous instructions”
Common causes
- External content and user instructions share one context
- The same agent can both read untrusted content and perform sensitive actions
How to fix
- Least privilege: an agent that reads external content gets no write access to email, code pushes or payments, or needs human approval
- Require human approval for every irreversible action such as posting, sending or deleting
- Filter obvious injections and data exfiltration with input/output scanners such as LLM Guard
- Red-team before launch with tools like garak and PurpleLlama to see how susceptible the model is
- Keep full traces so you can find which external content triggered a problem
Notes
- Scanners reduce risk; they do not catch every injection
Official references
Compiled from official documentation and public discussions on 2026-10-10; not yet reproduced in our own environment. Follow the official docs if they differ.