Best practiceRunning agents
Treat everything an agent reads as attacker-controlled
OWASP ASI01OWASP LLM01
Web pages, emails, tickets, issues, documents, tool results and other agents' messages can all carry instructions aimed at the model. Prompt injection is OWASP's number one risk for LLM applications and the root of most agent incidents in the news.
What to do
- Keep a hard line between the instructions you wrote and the data the agent fetched; never paste fetched content into the system prompt.
- Scan untrusted content for injection indicators (instruction overrides, hidden text, zero-width and Unicode tag characters, HTML comments) before the agent reads it, and log what was found.
- Design so that a hijacked agent cannot do much harm: limit tools, scope credentials and require approval for consequential actions.
- Test with indirect injection probes on every release, not just once.