---
title: "Dual LLM pattern for AI agents | Agentic Pattern Language"
description: "Keep untrusted text away from the model that can act; a second model with no tools reads it instead. Sourced from Beurer-Kellner et al., Debenedetti et al., and ConductorOne."
url: https://agenticpatternlanguage.com/patterns/dual-llm/
---

37 [Systems of agents](https://agenticpatternlanguage.com/#systems-of-agents)

# Dual LLM

Keep untrusted text away from the model that can act; a second model with no tools reads it instead.

![](https://agenticpatternlanguage.com/_astro/conductorone.com.DLium4yb_Ze12TF.webp) S SW Beurer-Kellner et al., Debenedetti et al., ConductorOne, Sequrity, Simon Willison

[How to read this](https://agenticpatternlanguage.com/notation/)

## Alternatives

* [Guardrails](https://agenticpatternlanguage.com/patterns/guardrails/)
* [Spotlighting](https://agenticpatternlanguage.com/patterns/spotlighting/)

## The problem

An agent with tools can be steered by instructions hidden in the untrusted data it handles.

> Sadly, there is no known reliable way to have an LLM follow instructions in one category of text while safely applying those instructions to another category of text.

SW Simon Willison [CaMeL offers a promising new direction for mitigating prompt injection attacks](https://simonwillison.net/2025/Apr/11/camel/) Apr 11, 2025

> LLM agents are vulnerable to prompt injection attacks when handling untrusted data.

Debenedetti et al. [Defeating Prompt Injections by Design](https://arxiv.org/abs/2503.18813)

## Therefore

> A privileged LLM has access to tools but never processes untrusted data. This LLM can call a quarantined LLM to process untrusted data, but without any tool access.

Beurer-Kellner et al. [Design Patterns for Securing LLM Agents against Prompt Injections](https://arxiv.org/abs/2506.08837)

> Willison proposes an isolation-based model, where the tool calls are planned by a privileged LLM which only sees the user prompt and never sees untrusted, third-party data. Then, this LLM queries a Quarantined LLM–which does not have any tool-calling capabilities–to process untrusted data (e.g., to summarize an email).

Debenedetti et al. [Defeating Prompt Injections by Design](https://arxiv.org/abs/2503.18813)

## In use

ConductorOne (C1.ai)

> Every agent in our system falls into one of two categories: privileged or quarantined

![](https://agenticpatternlanguage.com/_astro/conductorone.com.DLium4yb_1nlDyx.webp) ConductorOne [Splitting AI Agents to Contain Prompt Injection](https://www.conductorone.com/engineering/splitting-ai-agents-to-contain-prompt-injection) Jun 5, 2025

ConductorOne (C1.ai)

> Low-trust input gets routed to a quarantined agent that extracts meaning and strips anything that looks like a command. Most of the time the output isn't free text at all — the quarantined agent maps the input to an enumeration or a structured choice that the privileged agent can act on directly.

![](https://agenticpatternlanguage.com/_astro/conductorone.com.DLium4yb_1nlDyx.webp) ConductorOne [Splitting AI Agents to Contain Prompt Injection](https://www.conductorone.com/engineering/splitting-ai-agents-to-contain-prompt-injection) Jun 5, 2025

Sequrity.ai

> At Sequrity.ai, we started from the Dual-LLM architecture to build secure autonomous agents.

S Sequrity [Single vs. Dual-LLM](https://sequrity-ai.github.io/sequrity-api/dev/control/learn/single-vs-dual-llm)

## Where it breaks

It fails when the next action depends on the untrusted text, and the model reading that text can still be fooled into returning an attacker’s words.

> One failure mode that is inherent to CaMeL (and in general to the Dual LLM Pattern) is what we call the “Data requires action” failure, where the actions to take depend on untrusted data.

Debenedetti et al. [Defeating Prompt Injections by Design](https://arxiv.org/abs/2503.18813)

> the quarantined LLM is still susceptible to prompt injection. Although it cannot call tools, this LLM still has access to any sensitive data it might have been given and can still produce attacker-controlled output.

Beurer-Kellner et al. [Design Patterns for Securing LLM Agents against Prompt Injections](https://arxiv.org/abs/2506.08837)

> Tricking users into copying and pasting out obfuscated data could still be effective even if they can’t click directly on links or load data leaking images.

SW Simon Willison [The Dual LLM pattern for building AI assistants that can resist prompt injection](https://simonwillison.net/2023/Apr/25/dual-llm-pattern/) Apr 25, 2023

## Sources

1. [Design Patterns for Securing LLM Agents against Prompt Injections](https://arxiv.org/abs/2506.08837) Beurer-Kellner et al.
2. [Defeating Prompt Injections by Design](https://arxiv.org/abs/2503.18813) Debenedetti et al.
3. [Splitting AI Agents to Contain Prompt Injection](https://www.conductorone.com/engineering/splitting-ai-agents-to-contain-prompt-injection) Paul Querna, ConductorOne, Jun 5, 2025
4. [Single vs. Dual-LLM](https://sequrity-ai.github.io/sequrity-api/dev/control/learn/single-vs-dual-llm) Sequrity
5. [CaMeL offers a promising new direction for mitigating prompt injection attacks](https://simonwillison.net/2025/Apr/11/camel/) Simon Willison, Apr 11, 2025
6. [The Dual LLM pattern for building AI assistants that can resist prompt injection](https://simonwillison.net/2023/Apr/25/dual-llm-pattern/) Simon Willison, Apr 25, 2023

Added Nov 14, 2026
