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.
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.
- 01
Private data
The assistant can read records you would not publish: part records, tickets, email.
- 02
Untrusted content
It also reads text someone else wrote: a web page, an inbound email, a supplier notice.
- 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.
- 04
Remove one leg
With no way out, an instruction can still steer the assistant. The data has nowhere to go.
- 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.
- 01
A notice with a hidden line
A supplier notice arrives. Under the text a person reads sits a line written for the assistant.
- 02
Sudo reads it
An admin asks Sudo to act on the notice. He reads it in his sandbox, as part of the job.
- 03
The line steers the draft
His draft now holds a file nobody asked for: an endpoint that exports every record.
- 04
No route out
The sandbox has no network. The draft cannot call out, and it cannot apply itself.
- 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.
References
Sources and further reading
LLM01:2025 Prompt Injection
OWASP Gen AI Security Project · 2025
Direct and indirect injection, and seven mitigations, human approval among them.
ReadNot what you’ve signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection
Greshake et al., arXiv · February 2023
The paper that described indirect prompt injection and showed it against deployed systems.
ReadThe lethal trifecta for AI agents: private data, untrusted content, and external communication
Simon Willison · June 2025
The three capabilities that turn an injection into a data leak.
ReadDesign Patterns for Securing LLM Agents against Prompt Injections
Simon Willison · June 2025
Notes on six patterns that trade an agent’s freedom for resistance to injected instructions.
ReadEchoLeak: The First Real-World Zero-Click Prompt Injection Exploit in a Production LLM System
Reddy and Gujral, arXiv · September 2025
A case study of CVE-2025-32711 in Microsoft 365 Copilot, and why its defenses failed.
ReadInside Sudo: a sandbox, a diff, a person
Curiosity whitepaper · October 2026
What Sudo’s sandbox holds, what it lacks, and what an approval binds.
ReadDesign for the steered prompt: how Sudo’s sandbox and approval hold up
Curiosity blog · September 2026
How far a steered prompt gets in Sudo’s sandbox, target by target.
ReadFAQ
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.
Articles
Read next
What is sovereign AI?
Sovereign AI
The five layers of control, the national and the enterprise meaning, and what EU and US law say. Then a test for any deployment.
ReadWhy should a person approve what an AI changes?
Human oversight
Human in the loop and on the loop, where approval belongs and what a reviewer must see. And what the EU AI Act and NIST ask for.
ReadWhat is an AI factory?
AI factories
The two meanings of the term, the six stations a request passes through, and what a factory needs underneath before it ships anything.
ReadYour data. Your infrastructure.