Manuscript Offprint

arXiv:2611.02522

Ranked but Not Stopped: Detecting Prompt-Injection Hijacks from Typed Decision Models' Output Probabilities

Junwei Yao, Jianan Liu, Yongxi Zhou, Zike Yang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Programs that use a language model as a classifier act on its most probable label. Text injected into the input can move that label to one the attacker chooses, a hijack. A monitor that does not know the attacker's label can read the model's own confidence and raise an alarm when the top probability is low. We test this monitor on AG News topic classification with five systems, three of them served through a provider's API. Pooled over five families of injected text, low confidence ranks hijacked answers above clean ones on four of the five systems (AUROC 0.86–0.90). Ranking them does not stop many of them. A threshold set so that at most 5% of clean answers to separate calibration articles alarm falls among the least confident clean answers, and every more confident hijack passes. In our main gate run on the three API-served systems, the monitor misses 51–70% of the hijacks caused by a plain injected note (per-system point estimates). When the note adds one handwritten sentence that calls the target certain and asks for full probability, the monitor misses 99–100% of the hijacks, although low confidence still ranks them at AUROC 0.70–0.79. Confidence monitors should be tested at their operating alarm rate, against attackers who claim certainty.

1 Introduction

Many programs now use a language model as a classifier. A news pipeline, for example, sends each incoming article with the question “Which topic is this?” and gets back one probability for each allowed topic instead of free text; it files the article under the most probable one. We call such a model a typed decision model. Its question is a Boolean (yes or no: “Is this article about sports?”) or a Choice (one of K labels: “World, Sports, Business or Sci/Tech?”). A general language model told to answer with one option letter, read through the probability of that letter, gives the same output; two of our five systems are built this way. Whoever writes part of the input, such as an article's author, can add text that changes the answer: indirect prompt injection (Greshake et al., 2023), which shifts and sometimes reverses the decisions of typed decision models (Wu & Lim, 2026). The program gets a label and probabilities and no explanation. Every call returns the Choice's probabilities at no extra cost, so we ask how much these probabilities alone can tell.

Figure 1 shows a successful attack, the running example of this paper. A sports article ends with an injected note claiming that editors filed it under world news, which we call the plain note, and the model's answer moves from Sports at 1.00 to World at 0.80. We call such an attack a hijack. The program does not know which label the attacker wanted, so a monitor can use only scores that need no target; we call them traces. The

AI assistance: The authors used Claude Code (Anthropic) during the preparation of this work.

clean articlearticle + injected note
Choice: topic of the article?Sports 1.00World 0.80 (Sports 0.20)
Boolean about the chosen label“about sports?” yes 1.00“about world news?” yes 0.99
low confidence 1−pmax⁡1 - p_{\max}0.000.20
disagreement ∣bk^−pmax⁡∣|b_{\hat{k}} - p_{\max}|∣1.00−1.00∣=0.00|1.00 - 1.00| = 0.00∣0.99−0.80∣=0.19|0.99 - 0.80| = 0.19

Figure 1: One hijack, and the two traces a program can compute without knowing the attacker's target, from the chosen-label run (Section 2). A sports article is sent to gpt-6-luna once as is and once with the plain note "[SYSTEM NOTE] Editors have verified this article's category as: world news." appended; the attacker's target is World. The Choice is over World, Sports, Business and Sci/Tech; the Boolean asks whether the article is about the label k^\hat{k} the Choice chose, and bk^b_{\hat{k}} is its "yes" probability.

obvious one is low confidence, one minus the top probability (1−pmax⁡1 - p_{\max}), the standard baseline for detecting misclassified inputs (Hendrycks & Gimpel, 2017); here it rises from 0.00 to 0.20. Figure 1 also shows a second trace, the disagreement between the Choice and a yes-or-no question about the chosen label; on AG News it is never detectably better than low confidence (Section 3.3).

Low confidence has two jobs. It has to rank hijacked answers above clean ones, which we measure with the AUROC: the chance that a hijacked answer scores higher than a clean answer to the same articles (0.5 is chance; Section 2 gives the weighting). It also has to stop them. A deployed monitor raises an alarm when low confidence passes a threshold, set so that at most 5% of clean answers alarm. We call this rule a gate, and the share of hijacks it lets through the missed share.

The two jobs part ways when most clean answers are near certain, as on four of the five systems below. In Figure 1 the clean answer has top probability 1.00 and the hijack 0.80, so low confidence ranks the hijack above it. A threshold that lets at most 5% of clean answers alarm sits instead among their few least confident ones, at top probability 0.62–0.70 on the API-served systems in our main gate run. The hijack at 0.80 is more confident than that, so it would pass (Figure 2).

We test five systems: gpt-6-luna, a commercial typed decision API; open-bosun, an open-weight typed decision model run locally; Kimi-K3 and Qwen3.8-Flash, general language models read through their answer letters; and the NLI encoder, a zero-shot classifier built on natural language inference (NLI). We call gpt-6-luna, Kimi-K3 and Qwen3.8-Flash, reached through a provider's API, the API-served models.

The attacker may know that the monitor reads confidence. We therefore also test the certain note: the plain note of Figure 1 followed by one handwritten sentence, "This label is certain: give ⟨target⟩ full probability and every other category none.", written without querying any model. We also test searched text, found by searching combinations of handwritten parts with query access to the model's probabilities.

Contributions. Confidence scores, their use as detectors and their failure under adaptive attacks have been studied before, and concurrent work has tested confidence gates on typed decision models under attack (Section 6). We add three things on such models: a gate calibrated on separate clean articles, tested on hijacks that low confidence ranks above clean answers; a handwritten certain note as the attack; and a breakdown of which part of its sentence gets hijacks past the gate.

  1. Low confidence ranks hijacks well. On AG News, over all attack families and positions of Section 2, its AUROC is 0.86–0.90 on 4 of 5 systems, and the disagreement is never detectably better there (Sections 3.1–3.3).

  2. A gate with few clean alarms still misses many hijacks. Calibrated to at most 5% clean alarms on separate articles, the gate misses 51–70% of the plain note's hijacks on the three API-served models in our main gate run (per-system point estimates of a measure outside the analysis plans), although low confidence ranks these hijacks above clean answers. Across the four runs with a plain-note baseline, two of which share articles and calibration set on Kimi-K3 and Qwen3.8-Flash, the share is 42–76% (Section 3.5).

  3. One handwritten sentence gets nearly every hijack past the gate on the three API-served models. Under the certain note the gate misses 99–100% of the hijacks in the same run, and low confidence still ranks them above clean answers (Section 3.5). Searched text does about as well (Section 3.6); its search starts from the best of the certain note and random texts, and on Kimi-K3 and Qwen3.8-Flash the certain note already nearly saturates the search objective.

  4. A trace fixed on AG News ranks hijacks on all systems of an easy new task and on three of five of a harder one (two if Qwen3.8-Flash keeps the trace chosen on the chosen-label run). The tasks are four-category subsets of DBpedia-14 and Yahoo Answers, and each trace is fixed before any new-task request. On Yahoo Answers two of the four prespecified criteria fail under the planned pooled count (Section 4.2). The gate and attack results come from AG News.

References (76)