Security
Injection-resistant design patterns
Architectures that limit what injected text can do: quarantined readers, plan-then-execute, action selectors.
What it is and why it exists
Dual LLM / quarantined LLM: a privileged model plans and calls tools but never reads untrusted text; a quarantined model reads it and returns only constrained values. Plan-then-execute: fix the plan before reading untrusted content. Action selector: the model only chooses among predefined actions. Context minimisation: drop the user’s raw input before later steps. Research systems like CaMeL track data provenance through the plan.
Quick prototype
—
In production, at scale
Pick the pattern that fits the product: action selectors for narrow assistants, plan-then-execute for workflows, quarantined extraction (to enums, IDs, numbers) for agents reading email or web.
Vendors and tools
| “Design Patterns for Securing LLM Agents against Prompt Injections” (2025) | Catalogue of patterns |
|---|---|
| Google DeepMind CaMeL | Capabilities and provenance |
How it fails
- Quarantined model’s output passed back as free text, re-opening the hole
What the interviewer asks next
Explain the dual-LLM pattern.
The planner model has tools but only sees trusted input and symbolic references to untrusted data ($email_1). The quarantined model reads the untrusted data with no tools and returns structured values the planner can use without reading the raw text.