SpanGuard: Decoupling Instruction Localization from Authorization for Lightweight IPI Defense
Yinxiang Wang, Zehua Ma, Kejiang Chen, Weiming Zhang, Han Fang
Key points
From the paper's conclusion- These results show that strong IPI defense need not rely on strong LLMs when localization and decision-making are explicitly decoupled.
Abstract
LLM-based guardrails are effective against indirect prompt injection (IPI), but their performance depends heavily on model capability: as the guardrail model becomes smaller or weaker, detection degrades substantially. This raises a natural question: can we retain strong IPI defense while relying only on a small LLM? To understand why, we revisit what an LLM guardrail actually does. Detecting IPI requires simultaneously locating potentially injected instructions within heterogeneous tool outputs and judging whether they are authorized by the user's request. We find that the difficulty for small models arises largely from satisfying both requirements jointly, rather than from either subproblem alone. This suggests a different path to lightweight defense: explicitly decoupling localization from decision-making. In particular, localization needs no strong language-model reasoning, since injected instructions are often semantically discontinuous with their surrounding content and can be partitioned into local regions via lightweight unsupervised segmentation. Once the observation is partitioned this way, the remaining authorization check becomes a localized judgment that a small LLM can handle. Building on this insight, we design a lightweight IPI guardrail that performs attack-agnostic localization followed by block-level authorization judgment with a small language model. By separating where to look from what to decide, our approach substantially reduces the capability required of the guardrail model while preserving strong defense performance. Empirically, our guardrail achieves a 0.32% attack success rate with negligible loss in benign utility while remaining effective with substantially smaller models. These results show that strong IPI defense need not rely on strong LLMs when localization and decision-making are explicitly decoupled.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- APEX: Active Protection at Execution Boundaries for LLM AgentsarXiv · 2026
- LTBD: Learnable Trust-Boundary Delimiters for Prompt Injection DefensearXiv · 2026
- Right Tool, Wrong Parameters: Defending LLM Agents Against Parameter PoisoningarXiv · 2026
- MetaPI: Constructing Prompt Injection Benchmarks from LLM Agent BenchmarkarXiv · 2026
- CapLite: Prompt-Injection Defense for Small Language Model Agents without Model-Written Security ArtifactsarXiv · 2026
- INFUSE: A Unified Surface Benchmark for Indirect Prompt Injection in Agentic SystemsarXiv · 2026