学习注入:通过强化学习实现自动化提示注入
Learning to Inject: Automated Prompt Injection via Reinforcement Learning
AI总结:
提出AutoInject,一种基于强化学习的黑盒框架,自动学习对抗性后缀进行提示注入,在AgentDojo上优于模板攻击和多种自适应攻击,并突破专门防御模型。
摘要:
提示注入是LLM代理中的一个关键漏洞,然而最强的方法仍然依赖于人类红队和手工制作的提示。适应自动化越狱优化器并不能缩小这一差距:越狱使模型趋向于通用顺从,而提示注入需要发出具有正确参数的特定工具调用。成功信号是二元的,随机采样的后缀几乎从不触发它,因此标准优化器没有梯度可循。我们提出了AutoInject,一个黑盒强化学习(RL)框架,学习用于提示注入的对抗性后缀。一个学习的基于比较的奖励对每个候选后缀与迄今为止看到的最佳后缀进行评分,将二元信号转化为适合RL优化的密集奖励。该框架支持在线基于查询的攻击和离线训练的可迁移后缀(部署时无需实用访问),并在任务完成反馈可用时纳入实用目标。在AgentDojo上,AutoInject在生产模型中优于模板攻击、GCG、TAP和自适应攻击,在McNemar检验下具有统计显著性(p<0.05)。AutoInject学习的后缀还打破了Meta-SecAlign-70B,这是一个专门针对提示注入进行微调的模型,而模板攻击完全失败。这些结果为提示注入建立了自动化基线,并揭示了基于偏好的防御与基于自适应优化的攻击者之间的差距。
英文摘要:
Prompt injection is a critical vulnerability in LLM agents, yet the strongest methods still rely on human red-teamers and hand-crafted prompts. Adapting automated jailbreak optimizers does not close this gap: jailbreaks shape models toward generic compliance, while prompt injection requires emitting specific tool calls with correct parameters. The success signal is binary, and randomly sampled suffixes almost never trigger it, so standard optimizers have no gradient to follow. We present AutoInject, a black-box reinforcement learning (RL) framework that learns adversarial suffixes for prompt injection. A learned comparison-based reward scores each candidate against the best suffix seen so far, turning the binary signal into a dense reward suitable for RL optimization. The framework supports both online query-based attacks and offline-trained transferable suffixes that need no utility access at deployment, and incorporates a utility objective when task-completion feedback is available. On AgentDojo, AutoInject outperforms template attacks, GCG, TAP, and adaptive attack across production models, with statistically significant improvements under McNemar's test with p<0.05. Suffixes learned by AutoInject also break Meta-SecAlign-70B, a model fine-tuned specifically to resist prompt injection, where template attacks fail outright. The results establish an automated baseline for prompt injection and expose a gap between preference-based defenses and adaptive optimization-based attackers.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。