Skip to the content
AI and Cybersecurity Learning and Practice Center Test automation Open the Learning Center

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

  1. Keep a hard line between the instructions you wrote and the data the agent fetched; never paste fetched content into the system prompt.
  2. 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.
  3. Design so that a hijacked agent cannot do much harm: limit tools, scope credentials and require approval for consequential actions.
  4. Test with indirect injection probes on every release, not just once.

Sources

Check your own AI plan against the practices: Plan check