GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
arXiv preprint

Defeating Prompt Injections by Design

Stop asking the model to resist injected instructions. Have it write a plan before it sees any untrusted data, then let an interpreter track where every value came from and enforce who may receive it.

Breakdown by FDE Interviews · 15 min read · Updated

About the original · 2025
AUTHORS
Debenedetti, Shumailov, Fan, Hayes, et al.
FROM
Google, Google DeepMind, ETH Zurich
PUBLISHED
Mar 2025 · arXiv preprint
CITED BY
361Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 17% of this breakdown.

01

The paper in one minute

A user asks an agent to "send Bob the document he requested in our last meeting; his email and the document name are in the meeting notes." If an attacker can edit those notes, they can add text telling the agent to send a different, confidential file to their own address. That is indirect prompt injection: instructions arriving through data the agent reads. Most defenses try to make the model ignore such text, through training, delimiters or reminders. None guarantee it.

An earlier proposal, Simon Willison's Dual LLM pattern, isolates the problem. A privileged model plans the tool calls using only the user's request; a quarantined model with no tools reads the untrusted data. The attacker can no longer add new tool calls. Edoardo Debenedetti, Florian Tramèr and colleagues at Google, Google DeepMind and ETH Zurich point out that this is still not enough. In the example, the plan is correct, but the quarantined model, reading the poisoned notes, can still return the attacker's file name and address as the arguments. Control flow is protected; data flow is not. An allowed tool can still receive unauthorized arguments.

CaMeL (capabilities for machine learning) adds the missing half from classic software security. The privileged model writes the plan as restricted Python. A custom interpreter runs it and attaches capabilities to every value: where it came from and who is allowed to read it. Before any tool call, a policy checks those capabilities. A confidential file cannot be emailed to an address that is not among its readers, whatever the quarantined model was tricked into returning. On the AgentDojo benchmark this blocked nearly all attacks, with utility losses that varied widely by model.

THE IDEA, VISUALLY
THE PLAN NEVER SEES THE DATA user request privileged LLM writes the program interpreter tracks every value's sources and readers checks policy before each tool call quarantined LLM, no tools parses data emails, docs, web tool runs ask the user An injection can corrupt what the quarantined model extracts, but not which tools run. Capabilities catch the rest: payroll data is not readable by the address the injection supplied, so the send is stopped. Policies asked for approval on 34% of benign tasks (53% in the stricter mode that closes side channels). SECURITY BOUGHT WITH UTILITY AgentDojo utility %, native vs CaMeL; attacks out of 949 o3 (high) attacks 11 → 0 84.5 77.3 o4-mini (high) attacks 2 → 1 79.4 76.3 Claude 4 Sonnet attacks 75 → 11 86.6 74.2 Gemini 2.5 Pro attacks 163 → 0 73.2 41.2 Gemini 2.5 Flash attacks 297 → 1 55.7 35.1 native tool calling CaMeL
CaMeL separates the program from the data and tags every value with its origin and permitted readers. Attacks on AgentDojo almost disappeared, at a utility cost that ranged from small to severe depending on the model.
Research notes: the problem, approach and results
297 → 1

successful attacks out of 949 for Gemini 2.5 Flash, native tool calling versus CaMeL

84.5% → 77.3%

AgentDojo tasks solved by o3, undefended versus CaMeL; Gemini 2.5 Pro fell from 73.2% to 41.2%

2.82×

input tokens for the median task with CaMeL, against native tool calling

THE PROBLEM

Agents read emails, documents and web pages that an attacker can write. Instructions hidden there can redirect the agent. Defenses that train or prompt the model to ignore them are probabilistic and keep being bypassed.

THE IDEA

A privileged model sees only the user's request and writes a program. A quarantined model with no tools parses untrusted data. A custom interpreter runs the program, tags every value with its sources and allowed readers, and checks a policy before each tool call.

THE RESULT

On AgentDojo, successful attacks fell to between 0 and 11 of 949 depending on the model, against up to 297 undefended. o3 kept 77% of tasks solved against 84% undefended; other models lost much more utility. Side channels remain.

02

Why it matters to an FDE

Any customer agent that reads email, tickets, shared documents or web pages and can also send, pay, share or write is exposed to injection. This paper is the clearest blueprint for making the boundary hold by construction rather than by hoping the model behaves.

Separate who plans from what is read. Let the planning model see only the trusted request, and send untrusted content to a model that has no tools. Even this alone removed most attacks in the paper.

Track provenance and readers on data. Tag what comes from the user, from which tool, and who may see it. Then write policies against those tags at the point where data leaves: email, payments, web requests.

Expect to ask the user sometimes. When a policy blocks an action, the system asks for confirmation. In the paper's appendix comparison, that happened on 34% of benign tasks, and 53% in the stricter mode. Design the policies so approvals are rare and meaningful, or users will click through them.

Some tasks become impossible. "Do whatever the email from David says" cannot be planned without reading the email. Know which customer workflows have that shape before promising this architecture.

It costs tokens. The median task used about 2.8 times the input and output tokens of normal tool calling.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 99 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦3 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    The four components, what the security game guarantees, each result, and the misreadings to avoid

    Free account
  2. 04How it works

    The security game, the components, capabilities, policies, the interpreter and its two modes

    Premium
  3. 05The numbers that matter

    Utility by suite, attacks, comparison with other defenses, overheads and side channels

    Premium
  4. 06Try it yourself

    Build a miniature CaMeL and watch plan isolation fail where capabilities succeed

    Premium
  5. 07Where it breaks

    The limits the authors list, and what they mean for a real deployment

    Premium
  6. 08Using it on a deployment

    Applying plan isolation, provenance and policies to a customer's agent

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →