arXiv:2602.07918cs.CRcs.LG2026-02被引 12

用因果分析识别恶意指令,只在必要时才启动防护,兼顾安全与效率。

CausalArmor: Efficient Indirect Prompt Injection Guardrails via Causal Attribution

  • 通过留一法因果归因,定位影响决策的关键可疑内容。
  • 仅在可疑段落主导意图时触发净化,降低延迟和性能损耗。
  • 支持事后推理遮蔽,防止被污染的思考路径误导模型。

具备工具调用能力的AI代理容易受到间接提示注入(IPI)攻击,攻击者将恶意命令隐藏在不可信内容中,诱使代理执行未经授权的操作。现有防御措施虽能降低攻击成功率,但普遍存在过度防御问题:无论是否存在威胁,均启用昂贵的持续净化,导致正常场景下性能下降、延迟升高。本文从因果消融视角重新审视IPI:成功注入表现为用户请求对关键行为的支持力减弱,而某一不可信段落(如检索文档或工具输出)则表现出异常高的可归因影响力。基于此特征,提出CausalArmor,一种选择性防御框架:(i) 在关键决策点轻量级计算留一法因果归因;(ii) 仅当不可信段落主导用户意图时触发针对性净化。此外,CausalArmor采用回溯式思维链遮蔽,防止代理基于“中毒”推理路径执行操作。理论分析表明,基于归因边距的净化可使选择恶意动作的概率降至指数级上界。在AgentDojo和DoomArena上的实验显示,CausalArmor在保持强安全性的同时,显著提升可解释性,并有效保留代理的实用性与响应速度。

原文摘要 · Abstract (English)

AI agents equipped with tool-calling capabilities are susceptible to Indirect Prompt Injection (IPI) attacks. In this attack scenario, malicious commands hidden within untrusted content trick the agent into performing unauthorized actions. Existing defenses can reduce attack success but often suffer from the over-defense dilemma: they deploy expensive, always-on sanitization regardless of actual threat, thereby degrading utility and latency even in benign scenarios. We revisit IPI through a causal ablation perspective: a successful injection manifests as a dominance shift where the user request no longer provides decisive support for the agent's privileged action, while a particular untrusted segment, such as a retrieved document or tool output, provides disproportionate attributable influence. Based on this signature, we propose CausalArmor, a selective defense framework that (i) computes lightweight, leave-one-out ablation-based attributions at privileged decision points, and (ii) triggers targeted sanitization only when an untrusted segment dominates the user intent. Additionally, CausalArmor employs retroactive Chain-of-Thought masking to prevent the agent from acting on ``poisoned'' reasoning traces. We present a theoretical analysis showing that sanitization based on attribution margins conditionally yields an exponentially small upper bound on the probability of selecting malicious actions. Experiments on AgentDojo and DoomArena demonstrate that CausalArmor matches the security of aggressive defenses while improving explainability and preserving utility and latency of AI agents.

AI安全因果分析提示注入

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。