Skip to content
AI Security and Privacy Lab, Imperial College London·Indexed by this site · Originally publishedDate not givenSelectedAttention38

Heads of Security: Learned attention gating improves prompt injection robustness

Heads of Security: Learned Attention Gates Improve Prompt Injection Robustness

AI summary

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.

Why it was selected

Training only attention gate parameters can prevent the model from executing instructions injected in tool outputs, and is more robust against adaptive attacks than SecAlign and ASIDE.

Related papers
Read originalimperial-aisp.github.io