DISARM: Taint-gated counterfactual auditing for efficient defense against indirect prompt injection
Yuewantong Song, Guanhang Shi, Xuemei Luo, Jin Li, Yiran Chen, Jin Wei, Yu Liu, Ping Chen, Lei Shi, Kai Wang, Jiangxing WuThe integration of external tools and untrusted data has transformed large language models (LLMs) into autonomous agents, but also exposes them to indirect prompt injection (IPI) attacks, where adversarial instructions in external content can manipulate tool use and compromise system behavior. Existing defenses use input filtering, reasoning correction, or execution control, but often trade attack suppression against task utility or runtime cost. We propose DISARM , a training-free defense that mediates action commitment at the tool boundary between agent-internal planning and external tool execution. DISARM keeps ordinary steps on a lightweight fast path and invokes one additional planner run only for selected checkpoints after removing any detected suspicious spans. It compares the proposed and replayed actions by tool path and critical arguments, allowing consistent actions, using the replayed action when only critical arguments differ within an unchanged tool path, and blocking tool-path deviations. This selective single-replay policy jointly targets security, utility, and low latency. On AgentDojo with GPT-4o,