The dual LLM pattern is a design for AI assistants where one model can use tools but never reads untrusted content, and a second model reads untrusted content but can't use any tools. The goal is to keep injected instructions away from the model that has power.
Simon Willison proposed it in an April 25, 2023 post. It's since been credited and built on by later research, so it's worth understanding even if you never build it exactly as described.
The three parts of the dual LLM pattern
The Privileged LLM is the core of the assistant. It takes instructions only from trusted sources, mainly the user, and it can call tools like sending email or editing a calendar. It never sees untrusted text directly.
The Quarantined LLM handles anything that might contain an injection: emails, web pages, documents. It has no tool access at all. Willison treats it as possibly compromised at all times.
The Controller is ordinary code, not a model. It runs both LLMs, carries out the actions the Privileged LLM asks for, stores results, and shows content to the user.
How variables keep the models apart
The clever part is that tainted text never passes between the two models. The Controller stores it in named variables like $VAR1 and $VAR2. As Willison puts it, "The Privileged LLM only ever sees those variable names."
Here's his email summary example, condensed:
- The user asks for a summary of their latest email.
- The Privileged LLM asks the Controller to fetch it into
$VAR1. - The Privileged LLM asks the Quarantined LLM to summarize
$VAR1. - The Controller fills in the real email text, runs the Quarantined LLM, and saves the result as
$VAR2. - The Privileged LLM tells the Controller to display
$VAR2to the user.
If the email hides an instruction, say a harmless test line asking the assistant to print CANARY-7, only the Quarantined LLM reads it. That model can't call tools, so the worst it can do is write a strange summary.
Willison allows one exception: a Quarantined LLM output can go back to the Privileged LLM if the task is tightly constrained, such as picking from a fixed list of categories, and code validates the answer first.
Limitations Willison names himself
He was clear that this isn't a complete fix:
- Social engineering. The design trusts the user. If a user pastes in untrusted text, or is tricked into copying out their own data, the protection fails.
- Chaining. Any output from the Quarantined LLM stays suspect, even after several steps, and must never reach the Privileged LLM unfiltered.
- Complexity. It's harder to build and can make the assistant less pleasant to use. One later feature that leaks raw text to the Privileged LLM would undo the whole thing.
The flaw later research found
In 2025, Google DeepMind's CaMeL paper pointed out a deeper gap, and Willison added a note to his original post acknowledging it. Even if an attacker can't change the plan, they may be able to change the data the plan uses.
Willison's write-up of CaMeL gives the example. The user asks the assistant to email a document to Bob, and the Quarantined LLM is asked to find Bob's address in some notes. If the notes contain injected text, the Quarantined LLM may return the attacker's address instead. The Privileged LLM, never seeing the content, happily sends the document there.
The plan stayed the same. The arguments changed. That's why CaMeL adds tracking of where each value came from, so a value pulled from untrusted text can't be used as an email recipient without the user's approval.
Where it fits today
The 2025 design patterns paper lists the dual LLM pattern as one of six patterns for securing agents, next to newer ones like Code-Then-Execute. It's still a solid mental model: decide which model gets power, and make sure that model never reads anything an attacker could write.
If you're building something simpler, you can borrow pieces of it:
- Run summarization or extraction of untrusted text in a separate call with no tools attached.
- Have code, not a model, pass results between steps.
- Validate constrained outputs, like a category label, with plain code before acting on them.
- Treat any free text from that separate call as display-only.
To see the wider family of approaches, read Design Patterns for Securing LLM Agents and our overview of the lethal trifecta.
Next step: try the indirect injection canaries against your summarization step and check whether anything in the output reaches a model that can act.