Heads of Security: Learned Attention Gates Improve Prompt Injection Robustness
- 原文链接: https://arxiv.org/abs/2610.37657
- PDF: https://arxiv.org/pdf/2610.37657
- 作者: Igor Shilov, Xiaoxue Yang, Alexander Panfilov, Evgenii Kortukov, Matthieu Meeus, Peter Romov, Wojciech Samek, Jonas Geiping, Yves-Alexandre de Montjoye
- 日期: 2026-10-27
- 更新: 2026-10-27
- 分类: agents
- 来源类型: paper
- 标签: prompt-injection, attention, llm-security, defenses
- 质量评分: 4/5
- 抓取时间: 2026-10-30T04:31:44Z
中文导读
HoS(Heads of Security)用少量按注意力头学习的门控强制指令与数据分离,模型可读不可信内容而不执行注入指令Llama-3.3-70B-Instruct 与 GPT-OSS-20B 上对比 SecAlign++ 与 ASIDE:黑盒 RL-Hammer 对 GPT-OSS-20B 达 97% ASRSecAlign 85%,HoS 仅 10%;白盒 Claudini 在 HoS 上需约 3 倍 FLOPsHoS 保持基础模型通用能力,静态攻击的智能体基准上安全-效用权衡优于基线;ASIDE 在工具调用场景效用仅 10%结论:提示注入鲁棒性可用定向注意力干预取得与改进
为什么值得关注
HoS(Heads of Security)用少量按注意力头学习的门控强制指令与数据分离,模型可读不可信内容而不执行注入指令Llama-3.
提示注入防御的新路线:不靠外层过滤,而是在注意力头层面学门控,强制指令与数据分离,模型可读不可信内容而不执行注入指令。数字锚点:黑盒 RL-Hammer 攻击对 GPT-OSS-20B 达 97% ASR、对 SecAlign 达 85%,对 HoS 仅 10%;白盒 Claudini 攻击经 autoresearch 强化后,打 HoS 需要约 3 倍 FLOPs 才达到同等 ASR。标准基准效用保持、few-shot 不劣化(SecAlign/ASIDE 在 few-shot 下退化),智能体注入基准上与 SecAlign 相当。做智能体安全选型时这是一条有数据支撑的架构内防御路线。
关键信息
- 论文标题: Heads of Security: Learned Attention Gates Improve Prompt Injection Robustness
- 作者: Igor Shilov, Xiaoxue Yang, Alexander Panfilov, Evgenii Kortukov, Matthieu Meeus, Peter Romov, Wojciech Samek, Jonas Geiping, Yves-Alexandre de Montjoye
- arXiv: https://arxiv.org/abs/2610.37657
- 发布时间: 2026-10-27
- arXiv 分类: cs.LG, cs.CL, cs.CR
- 关联标签: prompt-injection, attention, llm-security, defenses
English Abstract
We introduce Heads of Security (HoS), a prompt injection defense that enforces instruction-data separation via a small set of learned per-head attention gates. HoS learns how each head should redistribute attention between trusted and untrusted tokens, enabling models to reason over untrusted content without following injected instructions. We evaluate HoS on Llama-3.3-70B-Instruct and GPT-OSS-20B. We compare it against SecAlign++, a state-of-the-art finetuning-based defense, and ASIDE, a defense that, like ours, builds instruction-data separation into the model architecture. We show that HoS offers greater robustness to adaptive attacks, better performance on standard utility benchmarks, and matches top performance on standard agentic prompt injection benchmarks. More specifically, the black-box RL-Hammer attack reaches 97% ASR against GPT-OSS-20B and 85% against SecAlign, but only 10% against HoS. Claudini, a state-of-the-art white-box attack, strengthened against HoS through autoresearch, requires 3 times more FLOPs to reach the same ASR on HoS as it does on GPT-OSS-20B or SecAlign. HoS preserves base-model utility across standard multiple-choice benchmarks and prompting setups, whereas SecAlign and ASIDE degrade in few-shot settings. On agentic benchmarks with static attacks, HoS and SecAlign perform similarly and substantially improve the security-utility trade-off over the base model. ASIDE struggles with tool use, achieving only 10% utility. These results show that prompt injection robustness can be achieved and improved through targeted attention interventions.
English Summary
Heads of Security (HoS) is a prompt-injection defense that enforces instruction-data separation through a small set of learned per-head attention gates, teaching each head how to redistribute attention between trusted and untrusted tokens so models can reason over untrusted content without obeying injected instructions. Evaluated on Llama-3.3-70B-Instruct and GPT-OSS-20B against SecAlign++ and ASIDE: the black-box RL-Hammer attack reaches 97% ASR on GPT-OSS-20B and 85% on SecAlign, but only 10% on HoS; the white-box Claudini attack strengthened via autoresearch needs about 3x more FLOPs to reach the same ASR on HoS. HoS preserves base-model utility on standard benchmarks where SecAlign and ASIDE degrade in few-shot settings, and on static-attack agentic benchmarks it substantially improves the security-utility trade-off (ASIDE only 10% utility with tool use).
Obsidian Notes
- 内容由
opencli arxiv paper拉取 arXiv 元数据与摘要生成。 - 中文导读与价值判断均锚定在条目已有摘要、论文摘要、作者、日期与分类信息上;未补充论文摘要之外的实验细节。