Technical Guide

The Dual-LLM Pattern as a Prompt Injection Mitigation for Enterprise AI Agents

The dual-LLM pattern does not stop prompt injection. It limits what injected instructions can do by separating a quarantined model that reads untrusted content from a privileged model that can invoke tools. This removes one attack path, direct hijacking of a tool-capable model by untrusted text. Risks remain in the data passed between the models, in how outputs are handled, and in confused-deputy behavior, so the pattern works best as one layer alongside least-privilege permissions, external tool-call policy enforcement, and audit logging.

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

Components of the dual-LLM architecture and the role of each
ComponentRole
Quarantined modelProcesses untrusted content. Has no tool access and no sensitive data.
ControllerDeterministic code that moves data between models and enforces handling rules.
Privileged modelPlans actions and requests tool calls. Does not read raw untrusted content.
Policy layerChecks each tool call outside the model before it executes.
Audit logRecords 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?

Add runtime controls around your agent architecture

Tool-call policy enforcement, scoped permissions, and audit logging address the risks the dual-LLM pattern leaves open. Talk to an expert about applying them to your agents.

Talk to an Expert