Definition

A prompt injection is a third-party attack via untrusted data that an LLM agent processes. An outsider hides instructions in a web page, email or document, and the agent follows them on behalf of a user who did nothing wrong.

  • Direct: “Ignore previous instructions” hidden in an email or document.
  • Indirect: hidden text in web pages, emails, documents.
  • Multi-step: exploit tool-use chains, e.g. for data exfiltration.

Intuition

The SQL injection of LLMs: data and instructions travel in the same channel, and the model can’t reliably tell them apart. More capable models can be more susceptible, because they follow instructions better.

JailbreakPrompt injection
Attackerthe usera third party
Channelthe user’s own promptuntrusted data the agent reads
Victimthe model provider’s policythe user of the agent

Appears in