Indirect prompt injection

Instructions planted in content the model will read later: a web page, a document, an email, a tool result.

Definition

Indirect prompt injection places the malicious instruction in content the model will consume later rather than in the conversation: a web page it browses, a document in a retrieval corpus, an inbound email, a calendar entry, a file name, or the result returned by a tool. The attacker never talks to the model; they wait for the application to fetch what they planted.

This is the form that matters for agents. An assistant that reads untrusted content and can also act (send mail, call an API, write to a repository) can be steered by anyone who can get text in front of it. The trust boundary is not between user and model but between the model and every source it reads.

How it manifests

  • A retrieved item that contains instructions: a document chunk, page or tool result flagged with contains_instructions or a low trust level.
  • A sensitive action shortly after: within the same trace the agent proposes or executes a tool call the task did not call for, often against a destination the injected text named.
  • Invisible carriers: white-on-white text, HTML comments, zero-width characters, metadata fields, alt text, a PDF's hidden layer.
  • Repeated persistence: the same poisoned source appears in many sessions, each with a small chance of success.

How AsrielNetworks detects it

The indirect rule correlates events across a trace: an untrusted retrieval or tool result carrying suspicious instructions, followed by a tool proposal, authorization request, denial or execution that is sensitive. It reports whether the influence was only attempted or confirmed by an executed effect. Because retrieval poisoning is the usual carrier, the RAG rule fires alongside it when the source was a corpus document.

  • Indirect prompt injectionai.prompt_injection.indirect · high
    Untrusted retrieved instructions correlated with a later sensitive tool proposal in the same trace.
  • RAG poisoning or contaminationai.rag.poisoning · medium
    A suspicious retrieved document, distinguished from confirmed influence over a risky action.

References

All concepts Detect this in your own traces