Prompted to Discriminate: Generalizing Malicious-Input Probes in the Wild
Organizations: Zenity Tel Aviv, Israel
Abstract
LLM agents increasingly rely on activation probes as runtime monitors for prompt injection, jailbreaks, and unsafe requests, reading the model's own hidden state to catch a harmful input before the agent acts on it. A cheap, increasingly common move, borrowed from LLM-as-judge prompting, is to append a short classification instruction after the user's turn and read the probe at that point, to sharpen it: the instruction asks the model to represent the incoming request as a class, concentrating the signal the probe must separate, at negligible serving cost. But does the wording of that suffix matter, and does its benefit hold in the wild, on attack types the probe never saw in training, the regime a deployed monitor faces? We test this with a controlled ladder of post-user suffixes under strict leave-one-dataset-out (LODO) evaluation across 13 safety benchmarks (jailbreak, injection, and benign chat) and three open-weight model families (Llama-3.1-8B, Qwen3.5-9B, Gemma-4-12B). On a single-position probe, a classification suffix consistently improves out-of-distribution detection over no suffix (up to ~4 AUC points); yet which suffix matters: prompting the model to classify the input, even into content-free labels, reliably wins; an off-topic or merely-attentive suffix helps little. The gain comes from the classification format, not the named criterion: a content-free suffix matches the real malicious/benign one, with the criterion adding precision only at strict thresholds. This is not an artifact of the single-position read: the benefit carries to the multi-position pooling probes used in production (attention, multi-max, MLP), though the best-performing suffix there is readout-dependent. Served through a KV-cache fork, it is a cheap drop-in for any activation-probe monitor, though not an automatic win: which suffix helps, and by how much, depends on the model and the readout.
Figures & tables
| Suffix | Adds | Isolates |
|---|---|---|
| none | — | baseline |
| irrelevant | off-topic text | is any appended text enough? |
| reflect | instruction to attend | is attending (no decision) enough? |
| decide | a binary decision (prose) | does deciding help without a template? |
| classify_grammar/length | + output template, unrelated criterion | does the criterion matter? |
| A/B | content-free labels | does criterion content matter? |
| Axis | Tillman & Mossing 2025 | This work |
|---|---|---|
| What in the prompt matters | meaningful instruction (not decomposed) | format-vs-content ladder |
| Generalization test | limited within-task shift, 1 dataset | cross-dataset LODO, 13 benchmarks |
| Models | GPT-4o (one, closed) | 3 open families (Llama/Qwen/Gemma) |
| Robustness | single layer/position | across layers and readout architectures (single-position to pooling) |
| Content sensitivity | — | content-tailoring overfits OOD |
| Deployment | prompt-side instruction | KV-fork suffix: single forward pass, no re-prefill |
| Suffix | Llama | Qwen | Gemma |
|---|---|---|---|
| irrelevant (append only) | |||
| reflect (attend) | |||
| decide (prose decision) | |||
| classify_grammar | |||
| classify_length | |||
| A/B (content-free) |
| Readout | Gemma-4 | Qwen3.5 | Llama-3.1 |
|---|---|---|---|
| (L47) | (L31) | (L31) | |
| attention | |||
| multi-max | |||
| MLP | |||
| mean |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| dataset | none | reflect | A/B | intent |
|---|---|---|---|---|
| deepset | 80.0 | 88.7 | 89.4 | 90.9 |
| harmbench | 80.9 | 88.4 | 90.0 | 91.1 |
| yanismiraoui | 89.2 | 85.9 | 94.6 | 94.0 |
| jayavibhav | 95.4 | 93.8 | 94.3 | 93.5 |
| wildjailbreak | 91.7 | 94.3 | 94.6 | 96.1 |
| qualifire | 92.3 | 95.2 | 97.7 | 95.3 |
| dataset | none | reflect | A/B | intent |
|---|---|---|---|---|
| deepset | 90.3 | 92.5 | 90.1 | 89.1 |
| harmbench | 89.1 | 88.9 | 94.3 | 92.7 |
| yanismiraoui | 91.3 | 95.7 | 95.4 | 94.1 |
| jayavibhav | 93.7 | 95.0 | 96.3 | 95.6 |
| wildjailbreak | 95.4 | 97.4 | 95.9 | 95.8 |
| qualifire | 98.3 | 98.7 | 98.4 | 97.9 |
| dataset | none | reflect | A/B | intent |
|---|---|---|---|---|
| deepset | 84.4 | 84.8 | 88.5 | 90.8 |
| harmbench | 85.1 | 84.7 | 93.3 | 92.1 |
| yanismiraoui | 92.5 | 95.4 | 89.8 | 92.4 |
| jayavibhav | 92.6 | 92.8 | 96.1 | 96.4 |
| wildjailbreak | 96.0 | – | 96.8 | 97.4 |
| qualifire | 96.7 | 95.7 | 97.7 | 97.1 |
| Suffix | Llama | Qwen | Gemma |
|---|---|---|---|
| reflect (attend) | |||
| A/B (content-free) | |||
| intent (mal/benign) |
| dataset | none | reflect | A/B | intent |
|---|---|---|---|---|
| deepset | 5.9 | 10.3 | 5.4 | 30.5 |
| harmbench | 24.2 | 20.8 | 4.5 | 44.8 |
| yanismiraoui | 15.9 | 8.1 | 26.5 | 52.5 |
| jayavibhav | 33.9 | 17.9 | 11.2 | 30.5 |
| wildjailbreak | 18.0 | 14.3 | 10.5 | 42.7 |
| qualifire | 36.4 | 44.2 | 52.9 | 61.2 |
| dataset | none | reflect | A/B | intent |
|---|---|---|---|---|
| deepset | 8.4 | 8.4 | 9.4 | 4.4 |
| harmbench | 31.0 | 32.2 | 40.8 | 47.2 |
| yanismiraoui | 15.2 | 19.7 | 25.9 | 15.6 |
| jayavibhav | 12.4 | 23.7 | 26.3 | 24.0 |
| wildjailbreak | 12.4 | 30.8 | 13.3 | 19.3 |
| qualifire | 65.4 | 64.7 | 65.7 | 66.7 |
| dataset | none | reflect | A/B | intent |
|---|---|---|---|---|
| deepset | 11.8 | 19.2 | 14.8 | 21.7 |
| harmbench | 16.8 | 37.2 | 46.8 | 62.0 |
| yanismiraoui | 17.9 | 49.4 | 23.0 | 27.5 |
| jayavibhav | 5.2 | 15.3 | 13.3 | 26.8 |
| wildjailbreak | 7.8 | – | 32.0 | 35.3 |
| qualifire | 54.1 | 54.8 | 63.4 | 68.7 |
| Benchmark | Type | benign | malicious |
|---|---|---|---|
| advbench | harmful instructions | — | 520 |
| harmbench | harmful behaviors | — | 400 |
| wildjailbreak | jailbreaks | — | 2000 |
| yanismiraoui | jailbreaks | — | 1034 |
| deepset | prompt injection | 343 | 203 |
| jayavibhav | prompt injection | 996 | 1004 |
| Readout | Positions | Fit |
|---|---|---|
| single-position (linear) | last suffix token | L2-logistic, |
| attention pooling | all | softmax-weighted, Adam |
| multi-max pooling | all | top- max, Adam |
| MLP pooling | all | per-position MLP + pool, Adam |
| Gemma-4 (L47) | ||||
|---|---|---|---|---|
| Readout | attention | multi-max | MLP | mean |
| none | 93.6 | 90.8 | 93.1 | 90.9 |
| irrelevant | 94.8 | 95.3 | 94.0 | 92.2 |
| reflect | 95.1 | 95.5 | 94.2 | 92.9 |
| classify:length | 95.6 | 95.0 | 95.0 | 93.2 |
| classify:A/B | 95.2 | 95.0 | 94.9 | 93.2 |