85 agentic tools audited for security incidents · Talk to the lab →
MotionticBook a call
Glossary

What is the dual LLM pattern?

The dual LLM pattern is a prompt injection defence in which a privileged LLM plans and calls tools using only trusted input, while a quarantined LLM with no tool access processes untrusted content.

Simon Willison proposed the pattern in April 2023 as a way to build assistants that resist prompt injection. If a model with tools reads attacker-written text, that text can steer the tools. So the work is split: one model can act but never sees untrusted content, and another reads untrusted content but cannot act.

Google DeepMind's CaMeL paper (March 2025) found a gap in the original design and closed it with a custom interpreter that tracks where every value came from. CaMeL is the version of the idea most cited in 2026.

How the original pattern works

  • Privileged LLM

    Takes input only from trusted sources, mainly the user, and has the tools that change state, such as sending email or editing a calendar.

  • Quarantined LLM

    Handles any untrusted content, has no tools, and is assumed to be compromisable. Its raw output never reaches the privileged LLM, except output that can be verified, such as a choice from a fixed set of categories.

  • Controller

    Ordinary software, not a model. It calls both LLMs, executes actions for the privileged one, stores results and shows content to the user.

  • Variables instead of content

    The controller stores a fetched email as $VAR1 and the quarantined summary as $VAR2. The privileged LLM only ever handles the names, never the text behind them.

The gap CaMeL closed

The privileged model still decides what to do with the quarantined model's results. Suppose the plan is to find a colleague's email address in a document and send them a report. The quarantined model extracts the address from content an attacker may have written, and the attacker can substitute their own. The control flow is protected; the data flow is not.

In CaMeL, the privileged model writes its plan as code in a restricted subset of Python. A custom interpreter runs the code, tracks which values derive from which, and attaches capabilities to each value: where it came from and who may read it. Security policies check those capabilities at every tool call, for example allowing an email only to a trusted recipient and otherwise asking the user. On the AgentDojo benchmark, CaMeL solved 77% of tasks with provable security, against 84% for an undefended system.

Costs and limits

  • A less capable agent

    Some tasks need the planner to read untrusted content to decide what to do next. On AgentDojo the trade was about 7 points of task completion.

  • Policies to write and maintain

    Willison notes that someone has to define the security policies and keep them current.

  • Approval fatigue

    When policies fall back to asking the user, frequent prompts lead people to approve without reading.

  • The user is trusted

    Willison's original post points out that a user can be tricked into pasting untrusted content into the trusted channel.

  • Not a complete solution

    Both the CaMeL authors and Willison say prompt injection is not fully solved. Willison still called CaMeL the first mitigation he had seen that claims strong guarantees, by relying on security engineering rather than more AI.

How Motiontic's engineers apply it

Motiontic's engineers apply the split wherever an agent must both read outside content and act. The step that reads untrusted documents returns structured, validated fields, such as a category, an amount within a range or an ID that exists in the system, and the step that calls tools sees only those fields. Full interpreter-based designs like CaMeL are reserved for workflows where the injection risk justifies the extra engineering.

Dual LLM pattern compared with CaMeL

Dual LLM pattern compared with CaMeL
Dual LLM pattern (2023)CaMeL (2025)
Proposed bySimon WillisonGoogle DeepMind researchers and co-authors
PlannerPrivileged LLMPrivileged LLM writing restricted Python
Untrusted contentQuarantined LLM with no toolsQuarantined LLM with no tools
Control flow protectedYesYes
Data flow protectedNo: extracted values can be attacker-chosenYes: capabilities checked by policy at each tool call
EvidenceDesign proposal77% of AgentDojo tasks solved with provable security

Common questions

What are privileged and quarantined LLMs?

A privileged LLM plans and uses tools but only sees trusted input. A quarantined LLM reads untrusted content, such as emails or web pages, and has no tools, so an injected instruction it reads cannot trigger an action.

What is CaMeL?

CaMeL is a prompt injection defence from Google DeepMind researchers, published in March 2025. It extends the dual LLM pattern with an interpreter that tracks data flow and enforces security policies at every tool call.

Does the dual LLM pattern stop prompt injection?

It stops injected text from changing the agent's plan, and CaMeL also protects the data that flows into tool calls. Neither is described by its authors as a complete solution.

When is the pattern worth its cost?

When one agent must read untrusted content and also has high-impact tools, such as sending email or making payments. Agents without such tools usually get more from a sandbox and least privilege.

Running agents that have to hold up?

Describe the agent, the systems it touches and what it must never get wrong. The first call is with a lab engineer, who will say plainly whether it is ready for production, and whether Motiontic is the right team.