cd /news/ai-safety/heads-of-security-learned-attention-… · home › topics › ai-safety › article
[ARTICLE · art-159626] src=arxiv.org ↗ pub= topic=ai-safety verified=true sentiment=↑ positive

Heads of Security: Learned Attention Gates Improve Prompt Injection Robustness

A paper submitted to arXiv on 27 October 2026 introduces Heads of Security (HoS), a prompt injection defense that uses a small set of learned per-head attention gates to separate trusted instructions from untrusted data. Evaluated on Llama-3.3-70B-Instruct and GPT-OSS-20B, HoS held the black-box RL-Hammer attack to a 10% attack success rate, versus 97% against GPT-OSS-20B and 85% against the finetuning-based defense SecAlign, and the white-box attack Claudini required 3 times more FLOPs to reach the same ASR on HoS as on GPT-OSS-20B or SecAlign. HoS also preserved base-model utility on standard multiple-choice benchmarks and few-shot prompting, where SecAlign and ASIDE degrade, while ASIDE reached only 10% utility on tool-use tasks.

read2 min views2 publishedOct 28, 2026
Heads of Security: Learned Attention Gates Improve Prompt Injection Robustness
Image: source
  [Submitted on 27 Oct 2026]


[View PDF](http://arxiv.org/pdf/2610.37657v1)

[HTML (experimental)](https://arxiv.org/html/2610.37657v1)

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.

Additional Features

Current browse context:

cs.LG

References & Citations

...

Bibliographic Explorer

(What is the Explorer?) Connected Papers

(What is Connected Papers?) Litmaps

(What is Litmaps?) scite Smart Citations

(What are Smart Citations?) alphaXiv

(What is alphaXiv?) CatalyzeX Code Finder for Papers

(What is CatalyzeX?) DagsHub

(What is DagsHub?) Gotit.pub

(What is GotitPub?) Hugging Face

(What is Huggingface?) ScienceCast

(What is ScienceCast?) Influence Flower

(What are Influence Flowers?) CORE Recommender

(What is CORE?) IArxiv Recommender

(What is IArxiv?) arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

── more in #ai-safety 4 stories · sorted by recency
── more on @heads of security 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/heads-of-security-le…] indexed:0 read:2min 2026-10-28 · —