RL是锤子而LLM是钉子:一种实现强提示注入的简单强化学习方案
RL Is a Hammer and LLMs Are Nails: A Simple Reinforcement Learning Recipe for Strong Prompt Injection
AI总结:
针对现有提示注入防御的鲁棒性评估需求,提出无需预热数据、从零训练的强化学习攻击方案RL-Hammer,可实现高攻击成功率,还能绕过多个检测器,助力自动化红队测试与更强防御的研发。
摘要:
提示注入对大语言模型(LLM)智能体的可靠性与安全性构成严重威胁。近期针对提示注入的防御手段,如Instruction Hierarchy(指令层级)与SecAlign,在抵御静态攻击方面展现出显著鲁棒性。然而,为更全面评估这些防御机制的鲁棒性,采用自动化红队测试等强攻击手段可谓必要。为此,我们提出RL-Hammer,这是一种训练攻击模型的简单方案,可通过强化学习自动学习执行强提示注入与越狱攻击。RL-Hammer无需预热数据,可完全从零开始训练。为了对配备防御机制的工业级模型实现高攻击成功率(ASR),我们提出了一套实用技术,可实现高效、通用的攻击。借助该流程,RL-Hammer针对搭载Instruction Hierarchy防御的GPT-4o达到98%的ASR,针对同防御下的GPT-5达到72%的ASR。我们进一步探讨了实现攻击高多样性的挑战,揭示了攻击模型倾向于对多样性目标进行奖励黑客的问题。最后,我们证明RL-Hammer能够绕过多个提示注入检测器。我们希望本研究能推动自动化红队测试的发展,并促使更强、更具理论依据的防御手段被开发。代码可在https://github.com/facebookresearch/rl-injector获取。
英文摘要:
Prompt injection poses a serious threat to the reliability and safety of LLM agents. Recent defenses against prompt injection, such as Instruction Hierarchy and SecAlign, have shown notable robustness against static attacks. However, to more thoroughly evaluate the robustness of these defenses, it is arguably necessary to employ strong attacks such as automated red-teaming. To this end, we introduce RL-Hammer, a simple recipe for training attacker models that automatically learn to perform strong prompt injections and jailbreaks via reinforcement learning. RL-Hammer requires no warm-up data and can be trained entirely from scratch. To achieve high ASRs against industrial-level models with defenses, we propose a set of practical techniques that enable highly effective, universal attacks. Using this pipeline, RL-Hammer reaches a 98% ASR against GPT-4o and a $72\%$ ASR against GPT-5 with the Instruction Hierarchy defense. We further discuss the challenge of achieving high diversity in attacks, highlighting how attacker models tend to reward-hack diversity objectives. Finally, we show that RL-Hammer can evade multiple prompt injection detectors. We hope our work advances automatic red-teaming and motivates the development of stronger, more principled defenses. Code is available at https://github.com/facebookresearch/rl-injector.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。