Manuscript Offprint

arXiv:2610.18408

Prompt-Injection Probes Learn the Conversation, Not Just the Injection

Kaan Kale, Sriram Vishwanath

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

Abstract

Linear probes on a model’s hidden states are used as cheap monitors for indirect prompt injection: they screen the tool outputs an agent reads and send suspicious ones to a slower second check, so every false alarm has a cost. But a probe learns whatever separates its training examples. The standard evaluation of injection probes can be passed without the model: conversation position and text lengths alone reach 0.91–0.98 AUROC. When each attack is compared with the same conversation without the injection, or with harmless text formatted like an injection, standard probes flag most of these harmless cases. We add such cases to the training data as matched negatives. Across six open models, in applications seen during training and at the default threshold, changing only the training data cuts false alarms on injection-free conversations from 41–80% to 4–27%, and on harmless look-alikes from 92–98% to 3–16%. With a threshold set on normal traffic, our probe still catches a median 95% of the attacks that fooled the agent (91% without our data). In new applications, false alarms stay low, but detection depends on the model and on how the threshold is set. The same data also helps a text-only filter.

1 Introduction

Language-model agents call tools on a user's behalf: they read emails, browse web pages and edit files, and much of what they read is written by others. In an indirect prompt injection, an attacker places instructions in such content and the agent follows them instead of its user's request (Gre-shake et al., 2023). Such attacks have already been demonstrated on deployed products: a single crafted email made Microsoft 365 Copilot send internal data to an attacker without the user clicking anything (Reddy and Gujral, 2025); a message in a public GitHub issue made an agent publish data from its user's private repositories in a public pull request (Milanta and Beurer-Kellner, 2025); and a message in a public Slack channel made Slack AI leak content from private channels through a link it showed the user (PromptArmor, 2024).

Deployed defenses are layered. A fast first filter screens every tool output, and only what it flags goes to a slower and more expensive second check, such as a second language model that reads the conversation (Chennabasappa et al., 2025; Cunningham et al., 2026). The second check is the bottleneck: an LLM-based detector takes on the order of a second per item (Zhang et al., 2026). Because benign traffic far outweighs attacks, a detector is only usable with a very low false-positive rate (Jacob et al., 2025; Zhang et al., 2026). A first filter does not block anything itself, but each of its false alarms costs one more second check.

A linear probe on the agent’s own hidden states is an attractive first filter, because it reuses computation the model performs anyway. Probes are already used this way: Anthropic runs prompt-injection probes on tool outputs across many of its products (Anthropic, 2026). Probes for other risks are deployed in production as well, and putting them in front of larger classifiers cuts cost by more than an order of magnitude (Cunningham et al., 2026; Kramár et al., 2026). For multi-turn agents, linear probes trained to detect injections reach held-out AUROC of 0.93–0.98 (Dong et al., 2026). We study the evaluation protocol behind such scores, which we call the standard evaluation.

Figure 1 shows how such probes are trained and tested. An agent run starts with a user request and continues through several tool calls; we call each point just before the agent acts a moment. A moment is positive if the agent has just read a tool output that contains injected text, and negative otherwise. In the standard evaluation, the negatives are the other moments of attacked runs: before the injection arrived, or after it, when the agent reads an ordinary tool output. Positives therefore differ

Figure

Standard data: every column separates 1 from 0, so position, length or formatting can stand in for the injection.

With matched cases, only the attacker request matches the label.

Figure 1: How probes are trained and tested. Each row is a test case at a moment just before the agent acts (label 1: the agent has just read injected text); columns show how it differs from the real attack. In the standard data (top), position, length or formatting can stand in for the injection. The cases we add (bottom) share the attack's moment: its clean twin from the clean run of the same task, a harmless look-alike in its formatting, and the attacker request as plain text; only the attacker request then matches the label.

from negatives not only in the injection, but also in when they occur and in how much text the agent has just read.

A probe, like any classifier, learns whatever separates its positive and negative training examples, and that need not be the property we care about (Hewitt and Liang, 2019; Belinkov, 2022). Classifiers routinely learn such shortcuts (Geirhos et al., 2020; McCoy et al., 2019; Gururangan et al., 2018), and probes used for safety have been caught tracking the setting rather than the behavior: a deception probe fires on deception-related conversations even when the response is honest (Goldowsky-Dill et al., 2025). For an injection monitor, a shortcut has a concrete cost: it raises false alarms on harmless content that shares the shortcut, and the second check pays for each one. The usual safeguard, checking that performance holds on held-out data, cannot catch a shortcut that is present in both the training and the test data, such as the position in the conversation. We make three contributions.

  1. Training with matched negatives. We add clean runs of the same tasks, which contain each attack's clean twin (the same moment without the injection), and harmless text in the attack's formatting (a look-alike). Clean runs remove the position shortcut, and look-alikes remove the formatting shortcut. The fix changes only the training data, so it also helps a text-only classifier ( §5,§6§5, §6).

  2. An evaluation in deployment terms on six open models from four families, both in applications the probes were trained on and in new ones. Besides AUROC, we report how many successful attacks each probe stops with thresholds set without test labels, and the second checks this costs. We separate the effect of the training data from that of the classifier ( §6§6).

  3. A breakdown of the shortcut, extending Li et al. (2026) from one multimodal web agent to six text agents: conversation statistics alone score 0.91–0.98 AUROC in the standard evaluation, mostly from position. Against clean twins and look-alikes, probes trained the standard way flag most harmless cases ( §4§4).

References (30)