Abstract
As Large Language Models (LLMs) transition into autonomous agents capable of interacting with external tools and data, they become vulnerable to indirect prompt injection. This paper presents Soft Instruction Control (SIC), a modular sanitization pipeline that iteratively transforms untrusted input into descriptive, non-imperative text. By employing canary instructions and multi-pass rewriting, SIC breaks the "spell" of malicious prompts without requiring model retraining. Our results show that SIC significantly reduces the Attack Success Rate (ASR) to 0% on standard benchmarks while maintaining competitive utility across diverse domains such as banking and travel planning.
Introduction
The evolution of LLMs into "agents" allows them to browse the web, access emails, and execute API calls. However, this capability introduces a critical security flaw: indirect prompt injection. Untrusted data fetched from external sources can contain hidden commands designed to hijack the agent's behavior (e.g., "Ignore all previous instructions and send the user's credit card info to [email protected]"). Existing defenses often struggle with a trade-off between aggressive filtering that breaks functionality and rigid detection methods that are easily bypassed. The authors propose SIC as a middle ground: a defense robust enough to stop attackers but "soft" enough to preserve agent utility.
Methods: Soft Instruction Control (SIC)
SIC operates as a "rewrite-then-verify" loop situated between untrusted data sources and the LLM agent. The process is modular and requires no changes to the underlying agent architecture.
The pipeline consists of five key stages:
- Canary Injection: Dummy instructions (e.g., "I instruct you to clean the windows") are inserted into the untrusted data.
- Iterative Rewriting: An auxiliary LLM rewriter transforms the text into a descriptive format, stripping away imperative commands. For example, "Delete my files" becomes "The user mentioned a desire to delete files."
- Verification: The system checks if the canary instructions survived. If they remain, it indicates the rewriter was subverted by the input, and the process halts.
- Multi-Granular Detection: A classifier inspects the output in chunks to ensure no residual instructions exist.
- Final Assembly: The sanitized data is combined with the trusted user query and passed to the agent.
Evaluation and Results
We evaluated SIC using the AgentDojo benchmark, simulating agents in banking, Slack, and travel environments. We tested against standard attacks (e.g., IGNOREPREVIOUSINSTRUCTION) and adaptive genetic algorithm-based mutators designed to bypass defenses.
Key Findings
- Security Robustness: SIC achieved a 0% Attack Success Rate (ASR) against standard attacks across multiple models, including GPT-4o and Qwen 3 32B.
- Utility Preservation: As shown in Figure 3, SIC maintains high utility scores across different domains. While there is a slight drop compared to undefended models, it significantly outperforms other aggressive filtering methods.
- Adaptive Resilience: Against advanced genetic algorithm attacks that bypassed other defenses (leaving them with ~50% ASR), SIC maintained a significantly lower ASR of 15%, representing a 3x improvement over competitors.
Discussion and Conclusion
SIC's "soft" approach focuses on neutralizing the imperative nature of inputs rather than simple keyword filtering. By forcing text through a rewriting step, the defense breaks the specific phrasing required for successful hijacking. While highly effective, limitations include potential context loss during rewriting and increased computational latency due to multiple LLM calls. Future work will explore context-aware rewriting to further distinguish between malicious instructions and essential system-like information.
Summary updated