HoS: Learned Attention Gating Defense Against Prompt Injection
Start here
Researchers from Imperial College London and other institutions proposed the Heads of Security (HoS) prompt injection defense: train a learned gate for each attention head, label tokens as trusted, untrusted or template channels, and have each head scale attention scores by channel before softmax, preventing instruction-following heads from reading untrusted content while other heads can still process that content; the method trains only the gate parameters. The authors compared it with the fine-tuning-based SecAlign++ and ASIDE, which implements instruction-data separation at the architecture level, on Llama-3.3-70B-Instruct and GPT-OSS-20B; the black-box attack RL-Hammer achieved a 97% attack success rate against GPT-OSS-20B. Subsequently, researcher Alexander Panfilov released a prompt injection defense model with only 46k parameters, evaluated with attacker-second-mover attacks based on RL and attacks discovered by Claudini, stating that Claudini is suitable for use in adaptive attack evaluation, that the resulting model exhibits less role confusion than SecAlign, and that the model contains attention heads that help identify instructions and attention heads that prompt the model to execute instructions, and that strengthening the former can improve prompt injection detection.
Generated by AI from reports · Updated 13 days ago
Attention and developments
Attention, hourly
Now 38, 0% in 24 hours·Peak 38 (Nov 6 03:00)
Related research
This event's paper
Progress timeline
- X @kotekjedi_mlSelectedTeam releases prompt injection defense model with only 46k parameters
Researcher Alexander Panfilov released a prompt injection defense model with only 46k parameters. The work used attacker-moves-second evaluations with attacks based on RL and attacks discovered by Claudini, and the authors say Claudini is well suited for use in adaptive attack evaluation. The authors say the resulting model exhibits less role confusion than SecAlign. The authors also note that the model contains attention heads that help identify instructions and attention heads that push the model to execute instructions, and that strengthening the former can improve prompt injection detection. Collaborators say their attacks show HoS is not unbreakable, but is harder to break than other methods they tried, and they provide a Hugging Face online demo, the paper arXiv 2610.37657, and a code repository.
- arXiv: Jailbreaks, Prompt Injection, Poisoning & DefensesHeads of Security: Learned Attention Gating Improves Prompt Injection Robustness
Researchers propose Heads of Security (HoS), a prompt injection defense that enforces instruction-data separation by learning each attention head's attention allocation between trusted and untrusted tokens. The authors compare it with the fine-tuning-based SecAlign++ and with ASIDE, which likewise implements instruction-data separation at the architectural level, on Llama-3.3-70B-Instruct and GPT-OSS-20B: the black-box attack RL-Hammer achieves a 97% attack success rate on GPT-OSS-20B and 85% on SecAlign, but only 10% on HoS; for the white-box attack Claudini, strengthened against HoS via autoresearch, the FLOPs required to reach the same attack success rate on HoS are 3 times those on GPT-OSS-20B or SecAlign.
- Date not givenAI Security and Privacy Lab, Imperial College LondonSelectedHeads of Security: Learned attention gating improves prompt injection robustness
Researchers from Imperial College London and other institutions proposed the Heads of Security (HoS) defense method, which trains learned gates on each attention head so that the model can read tool outputs without executing instructions injected into them. Each token is labeled as trusted, untrusted, or template channel, and each head scales attention scores by channel before softmax, thereby preventing instruction-following heads from reading untrusted content while other heads can still process that content. The method trains only gate parameters: 18,432 scalars on GPT-OSS-20B and 46,080 on Llama-3.3-70B, trained with the SecAlign++ DPO recipe, with base weights unchanged.
Related discussion
- Older than 72 hours · Not included in the 72-hour figures
- X@Iam_Shivanshu · Shivanshu | AI BRO97% → 10%. That's the best RL-trained prompt-injection attacker's success rate on GPT-OSS-20B before and after a defen…(opens the original post in a new tab)
1 comments·Nov 1 00:41Collect
- X@xiaoxue__yang · Xiaoxue YangOur attacks show that HoS isn't unbreakable, but it's a lot harder to break with everything we've tried. We'd love to s…(opens the original post in a new tab)
7 likes·Nov 1 00:41Collect
- X@xiaoxue__yang · Xiaoxue YangCaveat: HoS enforces an externally supplied trust boundary. It doesn't decide what's trusted, and it's not designed for…(opens the original post in a new tab)
3 likes · 1 comments·Nov 1 00:41Collect
- X@xiaoxue__yang · Xiaoxue Yang📣 New paper: Heads of Security (HoS)! Can 18K parameters defend agents against prompt injection without sacrificing ut…(opens the original post in a new tab)
41 likes · 4 comments·Nov 1 00:41Collect
- X@_igorshilov · Igor ShilovWant to see more? We have more cool results on GPT-OSS-20B and Llama-3.3-70B Check out our resources: Full paper: htt…(opens the original post in a new tab)
6 likes · 1 comments·Nov 1 00:41Collect
- X@_igorshilov · Igor ShilovThere are of course caveats. 1) We aim for instruction-data separation. It is useful in some scenarios (e.g. summarizi…(opens the original post in a new tab)
5 likes · 1 comments·Nov 1 00:41Collect
- X@_igorshilov · Igor ShilovI'm very excited to share our new paper on prompt injection defences: "Heads Of Security"! Inspired by interp work sho…(opens the original post in a new tab)
72 likes · 7 comments·Nov 1 00:41Collect
- X@okey_amy · okPrompt injection defenses usually mean more prompts. Heads of Security learns per-head attention gates that enforce ins…(opens the original post in a new tab)
- X@pryzmat_tech · pryzmatpl3/7 RL-Hammer hits 97% ASR on GPT-OSS-20B, 85% on SecAlign++, only 10% on HoS. White-box Claudini needs 3x more FLOPs…(opens the original post in a new tab)
1 comments·Nov 1 00:41Collect
- X@pryzmat_tech · pryzmatpl2/7 Heads of Security: Learned Attention Gates Improve Prompt Injection Robustness arXiv:2610.37657 Learned per-head…(opens the original post in a new tab)
1 likes · 1 comments·Nov 1 00:41Collect
- X@bravish_ · BravishImperial, the Tübingen AI Center / ELLIS and Max Planck trained 46,080 numbers to make a 70B model far harder to prompt…(opens the original post in a new tab)
4 likes·Nov 1 00:41Collect
- X@robinliu2022 · 小微4/6 Heads of Security: learned attention gates to prevent prompt injection. Learn a gate for each attention head, reallocating attention between trusted/untrusted tokens to achieve instruction-data separation; on Llama-3.3-70B and GPT-OSS-20B compared with SecAlign…(opens the original post in a new tab)
1 likes·Nov 1 00:41Collect
Attention trend
New sources per day
- Oct 31: 4 new sources (2 outlets, 2 accounts)
- Nov 1: 1 new sources (0 outlets, 1 accounts)
- Nov 2: 0 new sources (0 outlets, 0 accounts)
- Nov 3: 0 new sources (0 outlets, 0 accounts)
- Nov 4: 0 new sources (0 outlets, 0 accounts)
- Nov 5: 0 new sources (0 outlets, 0 accounts)
- Nov 6: 0 new sources (0 outlets, 0 accounts)
- Nov 7: 0 new sources (0 outlets, 0 accounts)
- Nov 8: 0 new sources (0 outlets, 0 accounts)
- Nov 9: 0 new sources (0 outlets, 0 accounts)
- Nov 10: 0 new sources (0 outlets, 0 accounts)
- Nov 11: 0 new sources (0 outlets, 0 accounts)
- Nov 12: 0 new sources (0 outlets, 0 accounts)
- Nov 13: 0 new sources (0 outlets, 0 accounts)