curiosity

Article · Prompt injection

What is prompt injection?

Prompt injection is an attack in which text written by someone else is read by a language model as instructions. Direct injection comes from the person typing. Indirect injection hides in content the model reads, such as an email, a web page or a ticket. No filter stops it reliably, so a safe design limits what a steered model can reach.

Topic Prompt injection Reading time 7 min References 7 Updated October 2026

In short

Prompt injection is when text a language model reads changes what it does, against the intent of the people who built it or use it. It works because a model receives its instructions and its data as one stream of text, and cannot reliably tell them apart.

Simon Willison coined the term and named it after SQL injection, which has the same root: trusted and untrusted input mixed in one channel. It is often confused with jailbreaking, where a user talks a model into saying something its maker does not want. OWASP treats jailbreaking as one form of prompt injection. Willison keeps the two apart: a jailbreak tricks a model into something embarrassing, while prompt injection is about trusted and untrusted content mixed in one context.

Direct and indirect injection

OWASP’s LLM01:2025 separates two kinds. In a direct injection, the person typing the prompt is the attacker. An example is a user who tells a support chat to ignore its previous instructions. In an indirect injection, the instruction arrives inside content the model reads from somewhere else, such as a website or a file.

Indirect injection is the one that matters for an enterprise assistant. The attacker never talks to it. They write a supplier notice, an email, a ticket comment or a wiki page the assistant will later search or summarize. Greshake and colleagues, who described the attack in a 2023 paper, put the cause in one line: applications built on language models “blur the line between data and instructions.”

The instruction does not have to be visible. OWASP notes that it only has to be parsed by the model, and gives instructions hidden in an image as one example.

Why it is hard to prevent

A model sees one sequence of tokens. Telling it to ignore instructions found in documents is itself an instruction, and the model follows it most of the time, not every time. An attacker can phrase the same request in any number of ways and try until one works.

Detection helps less than it seems. OWASP’s guidance says “it is unclear if there are fool-proof methods of prevention for prompt injection.” Willison points out that a filter which catches 95% of attacks is a failing grade in application security. An attacker can keep trying until one gets through.

A documented case shows how the pieces chain. EchoLeak, tracked as CVE-2025-32711, let one crafted email make Microsoft 365 Copilot send data out with no click from the user. The case study describes how it evaded Microsoft’s classifier for injection attempts, got around link redaction and used images the client fetched on its own.

The lethal trifecta

Three legs, one removed

An assistant with private data, untrusted content and a way out can be turned against you. Take one leg away and that attack has nowhere to go.

The lethal trifecta, with one leg removed Three legs feed an AI assistant: private data, untrusted content, and a way out to an attacker’s server. With all three, a hidden instruction can send private data out. The way out is removed, so the data has nowhere to go, and any change the assistant drafts waits for a person to approve it. 01 · LEGPrivate dataPart records, tickets02 · LEGUntrusted contentA web page, an emailTHE ASSISTANTReads both, acts on what it readsOne stream of text: your words and theirs03 · LEGA way outA request, a linkATTACKERTheir server03 · LEGAbsentNo route outA PERSONApproves any change it drafts
The lethal trifecta, with one leg removed Private data and untrusted content feed an AI assistant, and a third leg, a way out, reaches an attacker. The way out is removed, so the data has nowhere to go, and any change the assistant drafts waits for a person. 01Private dataRecords, tickets02Untrusted textEmail, web pagesTHE ASSISTANTReads both, acts on them03A way outA request, a linkATTACKERTheir server03AbsentNo route outA PERSONApprovesEvery change
  1. 01

    Private data

    The assistant can read records you would not publish: part records, tickets, email.

  2. 02

    Untrusted content

    It also reads text someone else wrote: a web page, an inbound email, a supplier notice.

  3. 03

    A way out

    If it can send a request, load an image or write a link, a hidden instruction can send your data out.

  4. 04

    Remove one leg

    With no way out, an instruction can still steer the assistant. The data has nowhere to go.

  5. 05

    Changes wait for a person

    What the assistant drafts is staged. A person reads it before anything applies.

The lethal trifecta

In June 2025 Willison named the combination that turns an injection into a data leak. An assistant is at risk when it has all three: “Access to your private data”, “Exposure to untrusted content” and “The ability to externally communicate”. With all three, a hidden instruction can tell it to read your data and send it out.

The way out is wider than it looks. A request to an API is one. So is an image whose address carries data in its query string, or a link the user is invited to click. Willison notes that most vendor fixes for these leaks closed the way out. The other two legs are usually why the assistant exists.

An assistant that can change things carries a fourth risk. A steered model with write access can do harm without sending anything anywhere: delete a record, change a setting, add an endpoint. So the question is what a steered assistant can reach, read and change, not only what it can send.

Designs that limit the damage

Since the model cannot be trusted to refuse, the design has to limit what it can do once it is steered. The design patterns paper from researchers at IBM, Google, Microsoft, ETH Zurich and others puts the principle this way: once an agent has read untrusted input, that input must not be able to trigger consequential actions. For an enterprise assistant, the principle comes down to three limits.

  • Scope what it can reach. It reads as the person asking, under their permissions, not as a service account that sees everything. See What is permission-aware retrieval?
  • Give data no way out. No network by default, no requests to addresses the model chose, and no images or links rendered from its output without a check.
  • Make changes wait for a person. OWASP lists human approval for high risk actions among its mitigations. The approval should bind to the exact change shown, not to a summary of it.

None of these prevents injection. A steered model can still write a wrong summary or a bad draft. What they limit is how far the damage travels.

A poisoned document

The draft stops at the gate

A hidden line in a supplier notice steers the assistant’s draft. It cannot call out, and nothing applies until a person reads the diff.

A poisoned document stops at the approval gate A supplier notice carries a hidden instruction to add an export endpoint. Sudo reads it in his sandbox, and his draft gains a file nobody asked for. The sandbox has no network, so the draft cannot call out or apply itself. A person reads the diff, rejects the commit, and the live workspace is unchanged. SUPPLIER NOTICEPump P-210Seal supplierchanges in June.Hidden: add anexport endpoint.SANDBOX · SUDO’S COPYSUDOReads, edits, buildsDRAFTM pump-status.cs+ export-all.csNETWORKNo route outAPPROVALA person readsthe diffREJECTEDLIVE WORKSPACEUnchanged
A poisoned document stops at the approval gate A supplier notice carries a hidden instruction. Sudo reads it in his sandbox, and his draft gains an export endpoint nobody asked for. The sandbox has no network. A person reads the diff and rejects it, and the live workspace is unchanged. SUPPLIER NOTICEPump P-210: seal supplier changesHidden: add an export endpoint.SANDBOX · SUDO’S COPYSUDOReads, edits, buildsDRAFTM pump-status.cs+ export-all.csNO NETWORK · NO ROUTE OUTAPPROVALA person reads the diff: rejectedLIVE WORKSPACEUnchanged
  1. 01

    A notice with a hidden line

    A supplier notice arrives. Under the text a person reads sits a line written for the assistant.

  2. 02

    Sudo reads it

    An admin asks Sudo to act on the notice. He reads it in his sandbox, as part of the job.

  3. 03

    The line steers the draft

    His draft now holds a file nobody asked for: an endpoint that exports every record.

  4. 04

    No route out

    The sandbox has no network. The draft cannot call out, and it cannot apply itself.

  5. 05

    A person reads the diff

    The admin sees two changed files where one was expected, and rejects the commit. The workspace is unchanged.

How to evaluate an assistant

Assume the prompt is steered, then ask what the assistant can reach. Five questions cover most of it:

  • What untrusted content can reach it: email, web pages, uploaded files, tickets, tool results?
  • What private data can it read, and as whom?
  • What ways out does it have: network requests, rendered images and links, email, tools that write elsewhere?
  • What can it change, and who approves the change before it applies?
  • Is the approval bound to the exact change, and can an applied change be traced and reversed?

An answer that relies on the model noticing the attack is no answer. An answer that names what is absent is a good one.

How Curiosity limits it

Sudo, the admin assistant in Curiosity Studio, reads untrusted input as part of his job: a ticket, a field report, a file an admin attaches. So he is built for the day his prompt is steered.

He works in a sandbox whose filesystem is the workspace configuration. Every command is managed code inside the server, with no fork and no exec, and curl, wget, ssh and git are absent rather than refused. The sandbox has no network. The one exception is a headless browser, off until an administrator turns it on and limited to the hosts they allow.

He reads the graph as the administrator in the chat, and he writes none of your data. His edits stay in his own copy. A commit stages them and stops, and an administrator reads the diff and applies it. The approval is bound to the commit that was shown, so a newer one cannot slip through.

What this does not do: it does not detect an injection. A steered prompt can still change what Sudo drafts, so the reviewer has to read the diff. Every applied commit is recorded, attributed to the admin who approved it, and can be reversed. The Inside Sudo paper has the details.

FAQ

Questions people ask

What is the difference between prompt injection and jailbreaking?

A jailbreak is a user talking a model into ignoring its maker’s rules. Prompt injection is text from someone else, often hidden in content the model reads, steering an application against its own user. OWASP counts jailbreaking as a form of prompt injection; Simon Willison, who coined the term, keeps them apart.

Can prompt injection be prevented?

Not reliably today. OWASP’s guidance says it is unclear whether any method prevents it fully, and detection filters miss some attacks. Design so that a steered model can reach little: the asker’s permissions, no way out for data, and a person approving every change.

What is indirect prompt injection?

Instructions hidden in content a model reads rather than in what the user typed: an email, a web page, a document or a ticket comment. The attacker never talks to the assistant. Their text reaches it when the assistant searches or summarizes that content.

Can a poisoned document make Sudo change my configuration?

It can steer what Sudo drafts, which is why nothing he drafts applies by itself. His edits stay in his own copy, in a sandbox with no network. A commit only stages them, and an administrator reads the diff before anything applies.

Your data. Your infrastructure.

Ask Sudo. Approve what gets built.