AlignSentinel: Alignment-Aware Detection of Prompt Injection Attacks

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Jia, Yuqi, Wang, Ruiqi, Wang, Xilong, Xiang, Chong, Gong, Neil
Natura: Preprint
Pubblicazione: 2026
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866918349387071488
author Jia, Yuqi
Wang, Ruiqi
Wang, Xilong
Xiang, Chong
Gong, Neil
author_facet Jia, Yuqi
Wang, Ruiqi
Wang, Xilong
Xiang, Chong
Gong, Neil
contents Prompt injection attacks insert malicious instructions into an LLM's input to steer it toward an attacker-chosen task instead of the intended one. Existing detection defenses typically classify any input with instruction as malicious, leading to misclassification of benign inputs containing instructions that align with the intended task. In this work, we account for the instruction hierarchy and distinguish among three categories: inputs with misaligned instructions, inputs with aligned instructions, and non-instruction inputs. We introduce AlignSentinel, a three-class classifier that leverages features derived from LLM's attention maps to categorize inputs accordingly. To support evaluation, we construct the first systematic benchmark containing inputs from all three categories. Experiments on both our benchmark and existing ones--where inputs with aligned instructions are largely absent--show that AlignSentinel accurately detects inputs with misaligned instructions and substantially outperforms baselines.
format Preprint
id arxiv_https___arxiv_org_abs_2602_13597
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle AlignSentinel: Alignment-Aware Detection of Prompt Injection Attacks
Jia, Yuqi
Wang, Ruiqi
Wang, Xilong
Xiang, Chong
Gong, Neil
Cryptography and Security
Prompt injection attacks insert malicious instructions into an LLM's input to steer it toward an attacker-chosen task instead of the intended one. Existing detection defenses typically classify any input with instruction as malicious, leading to misclassification of benign inputs containing instructions that align with the intended task. In this work, we account for the instruction hierarchy and distinguish among three categories: inputs with misaligned instructions, inputs with aligned instructions, and non-instruction inputs. We introduce AlignSentinel, a three-class classifier that leverages features derived from LLM's attention maps to categorize inputs accordingly. To support evaluation, we construct the first systematic benchmark containing inputs from all three categories. Experiments on both our benchmark and existing ones--where inputs with aligned instructions are largely absent--show that AlignSentinel accurately detects inputs with misaligned instructions and substantially outperforms baselines.
title AlignSentinel: Alignment-Aware Detection of Prompt Injection Attacks
topic Cryptography and Security
url https://arxiv.org/abs/2602.13597