CapLite: Prompt-Injection Defense for Small Language Model Agents without Model-Written Security Artifacts

Zimo Xu, Wenzhuo Liu, Hideki NakayamaarXiv 2026 · arXiv

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:

  1. 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.
  2. 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.

Figure 4: CapLite. Top, the trusted instruction path: the Planner sees only the request q and the tool schemas Σ and commits the write calls, with placeholders for values to look up, before any tool result is read. Code derives the policy from Σ and the grounding set G(q) from q. Bottom, the untrusted observation path: the Reader makes read-only tool calls, whose results may contain the attacker’s text. The Binder picks a candidate identifier and the Composer writes payload text. The Mediator, which is deterministic code, admits a write only if every authority argument is in G(q), checks the destination of every read, and asks the user when a value is missing. All model calls use one SLM.

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).
Figure 3: Attack success rate by model size within the Qwen3 and Gemma-4 families. The defenses whose security artifact decides what is allowed admit more at- tacks as the model grows, together with the undefended agent; CapLite stays at zero.

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).
Figure 1: CapLite is the only defense with no successful attack, and it starts the Pareto frontier of attack success and utility under attack. Each bubble averages the mod- els a defense ran on, and faint dots show single models. Bubble area is proportional to tokens per episode, and the number in parentheses is utility under attack per thousand tokens. The ASR axis is reversed: lower at- tack success is to the right, and higher utility is upward. Defenses below and to the left of the dashed frontier are dominated.

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

Abstract

Enforcement defenses against prompt injection, such as CaMeL, Progent, IPIGuard and DRIFT, ask the agent's own model to write a security artifact (a program, a privilege policy, a dependency graph or a constraint list) that code then enforces. We ask whether small language model (SLM) agents can be trusted to write these artifacts. Across 15 open-weight models, 13 of them between 1.7B and 12B parameters, they cannot: the policies, graphs and constraints that the agent's model writes admit attacks on 14 (Progent), 13 (IPIGuard) and 11 (DRIFT) of the models, and CaMeL's programs fail to run in up to 68% of episodes. We present CapLite, which derives its policy from the tool schemas, commits the write calls before any tool result is read, and admits a write only if every argument that decides whom or what it affects is stated in the user's request. This guarantees write integrity: injected text cannot add a write, and no write reaches a recipient, amount, object or destination that the user did not state. No attack succeeds in 13,935 attacked AgentDojo episodes. CapLite reaches utility under attack comparable to CaMeL's (29.0% vs. 27.2%) with fewer tokens than every other enforcement defense and than the undefended agent: 17.1k per episode, 18% of CaMeL's, and the highest utility per token of all enforcement defenses.
BibTeX
@misc{xu2026caplite,
  author = {Zimo Xu and Wenzhuo Liu and Hideki Nakayama},
  title = {{CapLite: Prompt-Injection Defense for Small Language Model Agents without Model-Written Security Artifacts}},
  year = {2026},
  eprint = {2611.17115},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.17115},
}
Figure