Skip to content
EventPast event

HoS: Learned Attention Gating Defense Against Prompt Injection

3 reports3 reporting sourcesLatest report

Start here

AI overview

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)

Nov 7Nov 8Nov 9Nov 10Nov 11Nov 12Nov 13Now 38

Related research

Progress timeline

Oct 31
  1. X @kotekjedi_mlSelected
    Team 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.

Oct 29
Oct 28
  1. arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses
    Heads 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 provided
  1. Date not given
    AI Security and Privacy Lab, Imperial College LondonSelected
    Heads 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

Total 12 items

Attention trend

New sources per day

5 in 14 days·most 4 (Oct 31)·today 0

  • 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)

Hourly attention

Current attention 38·Peak in the comparable period 38 (Nov 6 03:00)·Change over the comparable past 24 hours 0%

010203040Nov 603:00Nov 811:00Nov 1018:00Nov 1302:00