mlsanityData to 14 Oct 2026

CommandSans: Securing AI Agents with Surgical Precision Prompt Sanitization

arXiv 2510.08829 ↗First posted 9 Oct 2025cs.CR cs.AI cs.LGcited by 12

On the map: LLM agents and tool use → Agent threats, guardrails and governance

also in 1 more
Abstract (arXiv)

The increasing adoption of LLM agents with access to numerous tools and sensitive data significantly widens the attack surface for indirect prompt injections. Due to the context-dependent nature of attacks, however, current defenses are often ill-calibrated as they cannot reliably differentiate malicious and benign instructions, leading to high false positive rates that prevent their real-world adoption. To address this, we present a novel approach inspired by the fundamental principle of computer security: data should not contain executable instructions. Instead of sample-level classification, we propose a token-level sanitization process, which surgically removes any instructions directed at AI systems from tool outputs, capturing malicious instructions as a byproduct. In contrast to existing safety classifiers, this approach is non-blocking, does not require calibration, and is agnostic to the context of tool outputs. Further, we can train such token-level predictors with readily available instruction-tuning data only, and don't have to rely on unrealistic prompt injection examples from challenges or of other synthetic origin. In our experiments, we find that this approach generalizes well across a wide range of attacks and benchmarks like AgentDojo, BIPIA, InjecAgent, ASB and SEP, achieving a 7-10x reduction of attack success rate (ASR) (34% to 3% on AgentDojo), without impairing agent utility in both benign and malicious settings.

Key facts. Cited by 12 papers in the map (data through 14 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 33 of its 49 references that are in the map. First posted on arXiv 9 Oct 2025.

Builds on

33 of 49 references.

Closest ancestors · 7

Same direction, newest first

  1. 2025BlindGuard: Safeguarding LLM-based Multi-Agent Systems under Unknown Attacks11 Aug
  2. 2025Design Patterns for Securing LLM Agents against Prompt Injections10 Jun
  3. 2025Defeating Prompt Injections by Design24 Mar
  4. 2025MELON: Provable Defense Against Indirect Prompt Injection Attacks in AI Agents7 Feb
  5. 2024The Task Shield: Enforcing Task Alignment to Defend Against Indirect Prompt Injection in LLM Agents21 Dec
  6. 2024Agent Security Bench (ASB): Formalizing and Benchmarking Attacks and Defenses in LLM-based Agents3 Oct
  7. 2024InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated Large Language Model Agents5 Mar

Other references · 26

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  2. 2023GPT-4 Technical Reportcited by 18,396
  3. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
  4. 2019BERTScore: Evaluating Text Generation with BERTcited by 5,512
  5. 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
  6. 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,182
  7. 2019Unsupervised Cross-lingual Representation Learning at Scalecited by 3,935
  8. 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,918
  9. 2024Qwen2 Technical Reportcited by 2,120
  10. 2021WebGPT: Browser-assisted question-answering with human feedbackcited by 1,745
  11. 2016Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translationcited by 1,475
  12. 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,443
14 more
  1. 2024The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructionscited by 493
  2. 2024StruQ: Defending Against Prompt Injection with Structured Queriescited by 375
  3. 2024Defending Against Indirect Prompt Injection Attacks With Spotlightingcited by 267
  4. 2023Benchmarking and Defending Against Indirect Prompt Injection Attacks on Large Language Modelscited by 264
  5. 2024SecAlign: Defending Against Prompt Injection with Preference Optimizationcited by 210
  6. 2025Securing AI Agents with Information-Flow Controlcited by 121
  7. 2024Can LLMs Separate Instructions From Data? And What Do We Even Mean By That?cited by 81
  8. 2025Can Indirect Prompt Injection Attacks Be Detected and Removed?cited by 52
  9. 2025PromptShield: Deployable Detection for Prompt Injection Attackscited by 50
  10. 2025Defending Against Prompt Injection With a Few DefensiveTokenscited by 33
  11. 2025ASIDE: Architectural Separation of Instructions and Data in Language Modelscited by 24
  12. 2024FATH: Authentication-based Test-time Defense against Indirect Prompt Injection Attackscited by 22
  13. 2021Subword Pooling Makes a Differencecited by 18
  14. 2025Sentinel: SOTA model to protect against prompt injectionscited by 6

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 12.

12 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Soft Instruction De-escalation Defense
  2. 2026Defense Against Indirect Prompt Injection via Tool Result Parsing
  3. 2026Skill-Inject: Measuring Agent Vulnerability to Skill File Attacks
  4. 2025Agent Skills Enable a New Class of Realistic and Trivially Simple Prompt Injections
  5. 2026Architecting Secure AI Agents: Perspectives on System-Level Defenses Against Indirect Prompt Injection Attacks
  6. 2024Prompt Infection: LLM-to-LLM Prompt Injection within Multi-Agent Systems
  7. 2026Prompt Injection Attacks on Agentic Coding Assistants: A Systematic Analysis of Vulnerabilities in Skills, Tools, and Protocol Ecosystems
  8. 2026SecOPD: Mitigating Adaptive Prompt Injections by On-Policy Distillation