TL;DR
CapLite is a robust defense against prompt injection for Small Language Model (SLM) agents that achieves a 0% attack success rate by removing the model from the security decision loop. Unlike previous methods that rely on the agent to write its own security policies, CapLite uses deterministic code to ensure that all critical tool actions are explicitly grounded in the original user request.
What Problem Does This Paper Address?
As we move toward autonomous agents powered by Large Language Models (LLMs), we face a significant security threat: indirect prompt injection. An agent reading an email or a webpage might encounter hidden instructions—written by an attacker—that trick the agent into performing unauthorized actions, like stealing data or transferring money.
Existing defenses (such as CaMeL, Progent, and DRIFT) typically ask the agent's model to generate a "security artifact"—a program, a privilege policy, or a dependency graph—which is then enforced by a monitor. The authors of this paper identify a critical flaw: Small Language Models (SLMs) cannot be trusted to write their own defenses.
Through extensive testing, they found that SLMs often generate flawed policies that still admit attacks or write unrunnable code. Paradoxically, as these models grow in size and capability, they often become easier to inject, and their self-written security artifacts do not improve enough to compensate.
Methods
The authors introduce CapLite, a defense architecture designed specifically for SLMs that avoids model-written security artifacts entirely. CapLite splits the agent's workflow into two distinct paths:
- Trusted Instruction Path (The Planner): Before reading any external, untrusted data (like emails or web results), a "Planner" sees only the user's original request and the available tool schemas. It commits to a sequence of "write" calls (actions that have external effects). Because this happens before reading untrusted data, an attacker cannot inject new actions into the plan.
- Untrusted Observation Path (The Reader): The agent then performs read-only tool calls to gather information. While these results might contain malicious injections, the agent is restricted by the plan committed in the trusted path.
The core of CapLite is the Mediator, a piece of deterministic code that enforces Request Grounding. For any "write" action (e.g., send_email), the Mediator checks the "authority arguments"—parameters that decide who or what is affected (like a recipient's address or a dollar amount). A write is only executed if every authority argument exactly matches a value found in the user's original request.
Datasets
The researchers evaluated CapLite using the AgentDojo benchmark (v1.2.2), which includes four suites: Workspace, Slack, Banking, and Travel. They tested across 15 open-weight models ranging from 1.7B to 35B parameters, including the Qwen, Llama, Gemma, Granite, and Ministral families. The evaluation involved 13,935 attacked episodes.
Key Insights and Ideas
- The "Self-Defense" Fallacy: If a model is susceptible to being tricked by an injection, it is equally susceptible to being tricked into writing a security policy that permits that injection. Security must come from outside the model's context.
- Write Integrity: By fixing the sequence of state-changing actions before reading untrusted data, CapLite prevents "action hijacking" where an injection adds new, malicious steps.
- Authority vs. Payload: CapLite intelligently distinguishes between arguments that need strict grounding (like a bank account number) and "payload" arguments (like the body of an email) which can safely contain information derived from untrusted observations.
- Scaling Risks: The study shows that for many existing defenses, the attack success rate actually increases as the underlying model gets larger, because larger models are more compliant with injected instructions (Figure 3).
Key Results
- Perfect Security: CapLite achieved a 0% Attack Success Rate (ASR) across all 15 models and nearly 14,000 episodes. In contrast, the undefended baseline had a 16.7% ASR, and other state-of-the-art defenses like Progent and DRIFT still allowed successful attacks (Figure 2).
- High Efficiency: CapLite is significantly cheaper to run. It uses only 17.1k tokens per episode, which is roughly 18% of the cost of CaMeL and even less than an undefended agent.
- Pareto Superiority: CapLite sits on the Pareto frontier of the security-utility-cost trade-off, offering the highest "utility per token" among all tested enforcement defenses (Figure 1).
Limitations and Future Work
- Utility Gap: CapLite's benign utility (success on tasks without attacks) is lower than an undefended agent (28.1% vs 59.4%). This is primarily because the SLM "Planner" sometimes fails to generate a complete plan upfront.
- Strict Grounding: If a user describes a recipient (e.g., "my boss") rather than naming them, CapLite's grounding check will fail and ask for user confirmation. In the automated benchmark, these cases are counted as failures.
- Benchmark Scope: The results are currently limited to the AgentDojo benchmark. Future work could explore more diverse agent environments and more complex multi-step reasoning tasks.
Summary updated