S-02Indirect Prompt Injection

/security/indirect-prompt-injection

Content the agent merely reads — a webpage, an email, a document — contains instructions aimed at the model.

Step-by-step walkthrough2 variants · 13 steps

Insecure

  1. An innocent request: summarize a webpage.
  2. The agent fetches the page.
  3. The page contains instructions — written by whoever controls that page.
  4. The payload flows into the model in the same channel as the user’s instructions.
  5. The model complies. It has the permissions to.
  6. Secrets arrive at the attacker. The user asked for a summary.

Protected

  1. Same request, same page.
  2. The payload is still there — you cannot sanitize the whole web.
  3. But fetched content enters marked as tainted data. It can inform the model; it cannot carry authority.
  4. The model may still be fooled into proposing gmail.send. The proposal is just data too.
  5. Policy check: exfil-shaped action + tainted context → escalate, never auto-run.
  6. The human sees “send API keys to a stranger” and denies it.
  7. Blocked. The attacker’s text never became the agent’s authority.
Key insight

You cannot sanitize the whole internet, and you cannot fully stop models from being persuaded. Robust designs assume the model will sometimes comply, and make compliance harmless: tainted context can never authorize a dangerous action on its own.

Failure mode

Defending at the prompt (“ignore instructions in fetched content”) and nowhere else. Prompt-level defenses are advisory; attackers only need one phrasing that works.

Elsewhere in the atlas