Skip to content

CommandSans: Protecting AI Agents with Surgical-Precision Prompt SanitizationCommandSans: Securing AI Agents with Surgical Precision Prompt Sanitization

arXiv· arXiv:2510.08829· Debeshee Das, Luca Beurer-Kellner, Marc Fischer, Maximilian Baader·Indexed by this site · 25 days ago· Originally publishedDefenses
AI summary

Researchers propose CommandSans, which uses token-level sanitization to remove instructions directed at AI systems from tool outputs, defending against indirect prompt injection. The method is based on the principle that data should not contain executable instructions, replaces sample-level classification with token-level sanitization, and captures malicious instructions as a byproduct; it does not block, requires no calibration, is independent of tool output context, and can be trained using only off-the-shelf instruction fine-tuning data without relying on unrealistic prompt injection samples from challenges or other synthetic sources. Experiments show it generalizes well on benchmarks such as AgentDojo, BIPIA, InjecAgent, ASB, and SEP, reducing attack success rate (ASR) by 7-10 times, including from 34% to 3% on AgentDojo, and it does not harm agent utility in either benign or malicious scenarios.

Read originalarxiv.org