How the pattern works
The dual-LLM pattern splits an agent into two models with different levels of trust. A quarantined model reads untrusted content. A privileged model can invoke tools. Deterministic code, called the controller here, moves data between them and enforces handling rules.
The privileged model plans actions and requests tool calls, but it does not read raw untrusted content. The quarantined model processes that content, but it has no tool access and no sensitive data.
Dual-LLM trust boundary
| Component | Role |
|---|---|
| Quarantined model | Processes untrusted content. Has no tool access and no sensitive data. |
| Controller | Deterministic code that moves data between models and enforces handling rules. |
| Privileged model | Plans actions and requests tool calls. Does not read raw untrusted content. |
| Policy layer | Checks each tool call outside the model before it executes. |
| Audit log | Records inputs, outputs, tool calls, and policy decisions. |
What the pattern protects against
The dual-LLM pattern does not stop prompt injection. It limits what injected instructions can do.
It removes one attack path: direct hijacking of a tool-capable model by untrusted text. Because the model that reads untrusted content cannot invoke tools or access sensitive data, instructions embedded in that content have no direct route to a tool call.
Where it falls short
Risks remain after the models are separated. They sit in three places:
- Data passed between the models. Output from the quarantined model still reaches the privileged model, so it should be treated as untrusted.
- Output handling. How outputs are handled after each model responds remains a source of risk.
- Confused-deputy behavior. The privileged model can still be led to act on someone else's behalf in ways that were not intended.
Complementary runtime controls
The dual-LLM pattern works best alongside controls that operate outside the models:
- Least-privilege permissions scoped for each task and user.
- External tool-call policy enforcement, so each tool call is checked before it executes.
- Audit logging of inputs, outputs, tool calls, and policy decisions, for audit and incident investigation.
Questions for reviewing an agent architecture
- Which components read untrusted content, and which can invoke tools or access sensitive data?
- How does data move from the quarantined model to the privileged model, and is it treated as untrusted?
- Does a policy layer outside the model check tool calls before they execute?
- Are permissions scoped to least privilege for each task and user?
- Are inputs, outputs, tool calls, and policy decisions logged for audit and incident investigation?