How it works · 35 of 37 Core
What is prompt injection?
Orders hidden in what the AI reads
Prompt injection: Text inside an email, web page or document can carry instructions the model obeys; jailbreaks trick it past its own rules.
Loading the animation…
Say it like this Anything an AI reads can carry orders it might obey, so limit what it can do and check risky actions before they run.
Under the hood — for builders
- Two kinds
- Prompt injection hides orders in something the AI reads (a page, an email, a file); a jailbreak is the user talking the model past its own rules. Injection is the bigger risk for agents, because the attacker never has to talk to the AI at all.
- How often it works
- In AgentDojo's test of 97 everyday agent jobs (email, banking, travel, Slack), GPT-4o followed a planted order about half the time.
- Why the model can't just refuse
- To a model, your request and the page it reads are one stream of text; nothing marks which words are orders and which are data. Training helps, but no model reliably tells them apart.
- Defence by design
- Instead of trusting the model to spot attacks, CaMeL lets only your request decide which actions run; text the agent reads can fill in values but never add a step. It finished 77% of AgentDojo jobs with provable security, against 84% with no defence.
- What to do
- Give an agent the fewest tools and permissions the job needs, keep secrets out of its reach, and put a check (a rule or a person) in front of anything that sends, pays or deletes.
- Sources
- Greshake et al., Not what you've signed up for, arXiv 2302.12173 · Debenedetti et al., AgentDojo, arXiv 2406.13352 · Debenedetti et al., Defeating Prompt Injections by Design, arXiv 2503.18813.
What happens in the prompt injection animation, step by step?
- You ask your AI assistant to summarise a hotel's web page. To do that, it reads every word on the page.
- The page looks harmless. But someone hid a line in it, white text on white: invisible to you, ordinary words to the model.
- Your turn: drag the UV torch across the page (or tap it) to see the hidden ink.
- The model can't reliably tell the page's words from your orders. It obeys: your files slip out while it cheerfully describes the pool.
- The fix sits outside the model: limit what it may do, and check risky actions before they run. Sending files now stops at a gate and asks you.
What everyday example explains prompt injection?
Invisible ink in a letter your assistant opens for you, telling it to post your keys to a stranger.
Why should a team care about prompt injection?
The top security risk for agents.