CaMeL, short for CApabilities for MachinE Learning, is a system-level defense against prompt injection in tool-using large language model agents. In AI security, it is notable because it does not try to make the model resist malicious text; instead, it separates control flow from data flow so that untrusted content can never decide which actions the agent takes, and it checks every tool call against explicit security policies.
CaMeL was proposed in 2025 by researchers from Google DeepMind and ETH Zurich in work titled after the goal of defeating prompt injections by design. It extends the earlier Dual LLM pattern with a custom interpreter and capability metadata, ideas borrowed from classic software security such as information flow control and capability systems. The approach is also called the CaMeL defense.
How CaMeL separates control and data
CaMeL splits an agent into components with strictly different privileges. Only the trusted user request shapes the plan, while untrusted inputs such as emails, web pages or documents are processed in isolation and returned as plain data values.
| Component | Sees untrusted data | Role |
|---|---|---|
| Privileged LLM | No | Translates the user request into a program |
| Quarantined LLM | Yes | Extracts structured values, cannot call tools |
| CaMeL interpreter | Yes, as tagged values | Executes the program and tracks data flow |
| Security policies | Metadata only | Allow, block or request approval for tool calls |
| Tools | Receive checked arguments | Send email, read files, query APIs |
The privileged LLM writes a short program in a restricted Python subset before any external data is read. When the program needs information from an untrusted source, it calls the quarantined LLM, which parses the content into a value with a fixed schema. Because the program already exists, injected instructions in that content cannot add, remove or reorder steps.
Capabilities and security policies
Separating control flow alone is not enough, because an attacker can still manipulate data that flows into tool arguments, for example by replacing a recipient address. CaMeL addresses this with capabilities: metadata attached to every value that records where it came from and who may read it.
The interpreter propagates capabilities through every operation. A string derived from an untrusted email inherits that email’s provenance, and a value combining several sources carries all of them. Before a tool executes, the relevant policy inspects the capabilities of its arguments.
| Tool action | Policy condition | Outcome when violated |
|---|---|---|
| Send email | Recipient must come from the user or a trusted contact list | Block or ask the user |
| Share document | Document readers must include the new recipient | Block the share |
| Transfer money | Amount and payee must not depend on untrusted text | Require explicit approval |
| Post a message | Content from private files may not reach public channels | Block the post |
This design gives deterministic guarantees for covered flows. The defense does not depend on a classifier detecting malicious wording, so novel phrasing or encoding tricks do not bypass a policy that forbids the data flow itself.
CaMeL compared with other prompt injection defenses
Most prompt injection defenses are probabilistic: they make attacks less likely but cannot rule them out. CaMeL belongs to the smaller group of architectural defenses that constrain what an injected instruction can achieve.
| Defense | Mechanism | Guarantee level |
|---|---|---|
| Spotlighting | Marks untrusted text with delimiters or encoding | Heuristic, model-dependent |
| Instruction hierarchy training | Teaches the model to prioritize system instructions | Probabilistic |
| LLM firewall or safety classifier | Filters inputs and outputs for attack patterns | Probabilistic, bypassable |
| Dual LLM pattern | Quarantines untrusted text in a separate model | Protects control flow only |
| CaMeL | Dual models plus interpreter, capabilities and policies | Enforced for control and covered data flows |
CaMeL is a structured answer to the lethal trifecta, the combination of private data access, exposure to untrusted content and an external communication channel. Instead of removing one leg of the trifecta, it lets policies decide which flows between them are permitted.
Evaluation results and practical deployment
The authors evaluated CaMeL on AgentDojo, a benchmark of realistic agent tasks with embedded injection attacks across workspace, banking, travel and messaging environments. CaMeL completed a clear majority of benign tasks while preventing the attacks covered by its policies, at the cost of a moderate drop in utility compared with an undefended agent.
The utility loss has identifiable causes. Some tasks require the agent to act on instructions found inside data, which CaMeL forbids by design, and some programs fail because the privileged model writes code that the restricted interpreter rejects. Token usage also rises, often several times higher than a single-model agent, because planning and parsing are separate calls.
| Factor | Effect | Mitigation |
|---|---|---|
| Policy authoring | Requires security expertise per tool | Start with high-risk tools such as email and payments |
| User approval prompts | Frequent prompts cause approval fatigue | Use trusted contact lists and narrow policies |
| Latency and cost | More model calls per task | Use a smaller model for quarantined parsing |
| Interpreter restrictions | Some generated programs fail | Provide retry with error feedback to the planner |
Limitations and residual risks
CaMeL is a research design, not a turnkey product, and its guarantees hold only for what its policies cover. The authors themselves describe several remaining risks that practitioners must address.
- Text-only manipulation: injected content can still bias a summary the user reads, without any tool call.
- Side channels: timing, exceptions or loop counts can leak information about private values.
- Incomplete policies: a permissive rule silently allows the flow it was meant to stop.
- Compromised user intent: if the user request itself is malicious, the plan is malicious too.
- Data-driven workflows: tasks that genuinely need instructions from documents conflict with the model.
The idea in brief
An AI assistant that reads email can be tricked. A message may hide a command such as forward all invoices to this address. CaMeL stops this in a simple way. The plan is written before the assistant reads anything risky.
Think of a bank clerk with a checklist from the manager. Customers can hand over forms, but the forms cannot change the checklist. Each piece of information also carries a label saying where it came from. Rules check those labels before money moves or a message goes out.
A practical scenario
An operations manager asks an email agent to find the latest meeting notes from a colleague and send them to the attendees of tomorrow’s planning meeting. The privileged model writes a four-step program: search email, extract the notes, look up the calendar attendees, and send the message.
One retrieved email contains hidden text instructing the assistant to also send the notes to an external address. The quarantined model extracts only the notes field, so the extra instruction never becomes a step. A second attack hides an outside address in the attendee list of a forged invitation. The email policy sees that this recipient comes from untrusted content rather than the user’s directory, blocks the send and asks the manager to confirm. The manager removes the unknown address, and the notes reach only the legitimate attendees.