PIPETTE:面向鲁棒LLM智能体的提示注入紫队测试
研究论文 · 2026/11/19
大型语言模型(LLM)智能体经常与不可信的外部数据交互,面临间接提示注入(IPI)攻击的风险,攻击者可通过此类攻击劫持智能体执行其指定的任务。为大规模发现这些漏洞,自动化红队方法常利用强化学习(RL)生成高攻击成功率(ASR)的攻击。模型开发者利用内部红队发现的攻击进行对抗训练,以在部署前加固智能体,这种攻防协作过程在网络安全中称为紫色团队(purple-teaming)。然而,我们表明,红队过程中实现高ASR并不能保证后续对抗训练带来鲁棒性提升。具体而言,我们发现两种最先进的基于RL的红队方法RL-Hammer和PISmith存在模式崩溃问题,反复发现相似的攻击策略,这些额外的成功对对抗训练的鲁棒性提升没有额外贡献。为弥补这一差距,我们提出PIPETTE,一个统一的提示注入紫色团队框架,能有效将红队发现转化为防御者鲁棒性的提升。PIPETTE采用基于字典学习的奖励,鼓励红队过程中更广泛地覆盖攻击策略。它还集成了针对IPI防御的在线策略对抗训练流程,使智能体在完成合法用户任务的同时抵御攻击。在智能体基准(AgentDojo和ASB)上的广泛评估表明,PIPETTE产生的防御者在静态攻击上达到接近零的攻击成功率,并能抵御强大的自适应攻击,同时保持与未防御基线接近的良性任务效用。
该研究指出了当前LLM智能体红队测试与对抗训练之间的关键脱节问题,并提出了一个有效的紫色团队框架,对于提升LLM智能体在实际部署中的安全性具有重要价值。
Large language model (LLM) agents routinely interact with untrusted external data, exposing them to indirect prompt injection (IPI) attacks that hijack agents into executing attacker-chosen tasks. To uncover these vulnerabilities at scale, automated red-teaming methods often leverage reinforcement learning (RL) to generate attacks that achieve high attack success rates (ASR). Model developers use the attacks discovered during internal red-teaming to harden agents through adversarial training before deployment, a collaborative offensive-defensive process known in cybersecurity as purple-teaming. However, we show that achieving high ASR during red-teaming does not guarantee robustness gains from subsequent adversarial training. Specifically, we find that two state-of-the-art RL-based red-teaming methods, RL-Hammer and PISmith, suffer from mode collapse, repeatedly discovering similar attack strategies whose additional successes add no additional robustness improvements to adversarial training. To address this gap, we introduce PIPETTE, a unified prompt injection purple-teaming framework that effectively converts red-teaming discoveries into defender robustness improvements. PIPETTE employs a dictionary learning-based reward that encourages broader coverage of attack strategies during red-teaming. It also integrates an on-policy adversarial training pipeline tailored to IPI defense, enabling agents to resist attacks while completing legitimate user tasks. Extensive evaluations across agentic benchmarks (AgentDojo and ASB) demonstrate that PIPETTE produces defenders that achieve near-zero attack success rates on static attacks and can withstand strong adaptive attacks, while maintaining benign task utility close to that of the undefended baseline.