通过任务对齐推理,有效防御自适应提示注入攻击
Defending against Adaptive Prompt Injection Attacks via Reasoning-enabled Task Alignment
- 基于任务意图而非攻击模式进行防御判断
- 在六种自适应攻击下平均成功率仅2.92%
- 适合需要高安全性的智能代理系统使用
间接提示注入攻击通过第三方数据中的恶意指令劫持基于大模型的智能体。现有防御在静态基准上表现接近零成功率,但在自适应评估中迅速失效。本文指出两大失败原因:一是防御局限于识别特定攻击模式,而非判断指令意图是否相关;二是基于训练的防御依赖少量手工模板生成对抗样本,泛化能力差。为此提出RETA方法,使防御决策基于用户任务而非攻击控制的数据。在每一步工具输出时,防御者进行链式思考,验证行为与用户任务的一致性。利用红队模拟攻击生成对抗训练数据,并采用字典学习多样性奖励,覆盖广泛注入改写策略。结合多目标强化学习优化,实现更优的安全-效用平衡。在六种黑盒自适应攻击中,各攻击成功率均低于10%,两目标模型平均为2.92%和3.75%,且在攻击和干净输入下均保持高可用性。
原文摘要 · Abstract (English)
Indirect prompt injection attacks hijack LLM-based agents by embedding malicious instructions in third-party data that the agent retrieves during task execution. Existing defenses report near-zero attack success rate on static benchmarks, yet recent adaptive evaluations show that these results collapse once the attacker is allowed to optimize against the deployed defense. In this work, we trace this collapse to two failure modes. First, existing defense methods are confined to recognizing specific attack patterns, rather than assessing whether the intent of every embedded instruction is relevant to the user task. Second, training-based defenses, which otherwise offer the strongest safety-utility trade-off, assemble their adversarial examples from a handful of hand-crafted templates, and the resulting defender fails to generalize outside that narrow strategy distribution. To address these gaps, we propose RETA, a training-based method that grounds defense decisions on the user tasks rather than attacker-controlled data. At each tool-output step, the defender undertakes chain-of-thought reasoning verifying that its actions are consistent with the user task. Leveraging red-teaming, a simulated attacker synthesizes adversarial training data and receives a dictionary-learning diversity reward, achieving broad coverage of injection-reformulation strategies. Together, these allow the defender to be optimized via multi-objective reinforcement learning and achieve better safety-utility trade-off. Across six black-box adaptive attacks, RETA keeps every per-attack ASR below 10%, with average ASR of 2.92% and 3.75% on the two target models, while preserving most utility under attack and on clean inputs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。