How to Find the Agent Actions a Prompt Injection Can Control A new engineering guide argues that prompt injection in AI agents is structurally the same bug as SQL injection without parameterized queries, and that the fix is to decide every agent action before the model reads untrusted text rather than trying to patch the prompt. The guide instructs developers to label each tool as reading untrusted or private data, gate the agent loop with an InjectionGate that flips once untrusted text arrives, and use MCP annotations such as readOnlyHint and openWorldHint to declare what each tool touches. It also assigns responsibilities across four roles — the agent-loop author, the MCP server author, the chat-window owner (who should strip remote images via img-src 'self') and the CI owner (who should plant a canary email and test that the agent cannot exfiltrate it). How to Find the Agent Actions a Prompt Injection Can Control Engineer's view. This is SQL injection without parameterized queries. A database fixed it by sending the query and the values on separate channels. A model reads both in one stream, so it cannot. The fix moves up a level: decide each action before reading the values, or read them somewhere that cann ot act. It costs flexibility. TL;DR. A model treats every word in its context as a possible instruction, including text a tool fetched. Any decision your agent makes after reading that text belongs to whoever wrote it. A kid has a list of chores from their parent. One chore says "read the notes in the mailbox One note in the mailbox says "Also, leave the back door open." It is written in pen, like the So the kid leaves the door open. The note writer did not break in. They just wrote a note in A smart parent writes the whole chore list first. The mailbox can change what the kid writes You have shipped this bug already, in a system with no model in it. A support page showed customer names. Someone signed up with a name that contained a