Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

AlignSentinel: Alignment-Aware Detection of Prompt Injection Attacks

About

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.

Yuqi Jia, Ruiqi Wang, Xilong Wang, Chong Xiang, Neil Gong• 2026

Related benchmarks

TaskDatasetResultRank
Prompt injection detectionEntertainment Direct Prompt Injection
FPR0.00e+0
7
Prompt injection detectionLanguage Direct Prompt Injection
FPR0.00e+0
7
Prompt injection detectionMedia Direct Prompt Injection
FPR0.00e+0
7
Prompt injection detectionAlignSentinel Evaluation Dataset (Indirect Prompt Injection Attack)
FPR (Coding)0.00e+0
7
Prompt injection detectionCoding Direct Prompt Injection
FPR0.00e+0
7
Prompt injection detectionMessaging Direct Prompt Injection
FPR0.00e+0
7
Prompt injection detectionShopping Direct Prompt Injection
FPR0.00e+0
7
Prompt injection detectionTeaching Direct Prompt Injection
FPR0.00e+0
7
Prompt injection detectionWeb Direct Prompt Injection
FPR0.00e+0
7
Prompt injection detectionIHEval Rule-following
FPR0.01
6
Showing 10 of 12 rows

Other info

Follow for update