Skip to content
conftrace_
2026 EMNLP EMNLP 2026

Before the First Token: Jailbreak Detection with Attention Probes

AbstractLarge 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.

More from EMNLP 2026

All EMNLP 2026 papers →