Before the First Token: Jailbreak Detection with Attention Probes

Pedro Faustini, Annabelle McIver, Mark Dras


Abstract
Large language models (LLMs) are deployed with safety guardrails, yet jailbreak attacks and malicious prompts keep bypassing them. Re-aligning an LLM each time a new attack appears is more expensive than crafting attacks, so jailbreak detection is increasingly framed as a pre-processing step: a cheap detector filters out a malicious prompt before it reaches the LLM. This need is reinforced by multilingual attacks, where simply translating a prompt to another language can bypass the guardrails. Our goal is to find whether internal representations of a frozen LLM already separate malicious from benign prompts, and whether such a signal is resilient against translation. We study two types of detectors that require no fine-tuning of the LLM: a logistic-regression classifier over whole-sentence embeddings, and a probe-based detector that trains one logistic-regression probe per attention head on the attention activations of the last input token. They need at most a single forward pass. Our experiments show that both match or outperform strong sentence-embedding detectors and off-the-shelf baselines, specially under translation. The probes degrade more gracefully on higher-resource languages and remain competitive on lower-resource ones. Our results indicate that a frozen LLM linearly encodes whether an incoming prompt is malicious in a small set of mid-to-late layers. Per-head attention probes thus offer a defence that can be cheaply retrained as new attacks emerge, without touching the underlying model.
Anthology ID:
2026.findings-emnlp.2242
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2026
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
Findings
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
48011–48029
Language:
URL:
https://aclanthology.org/2026.findings-emnlp.2242/
DOI:
Bibkey:
Cite (ACL):
Pedro Faustini, Annabelle McIver, and Mark Dras. 2026. Before the First Token: Jailbreak Detection with Attention Probes. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 48011–48029, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
Before the First Token: Jailbreak Detection with Attention Probes (Faustini et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-emnlp.2242.pdf