arXiv(opens in a new tab)cs.AIOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.05295

Readable Before Actionable: Causal Tracing of Indirect Prompt Injection

Zhe Yu, Wenpeng Xing, Xingxing Yang, Meng Han

ABSTRACT

Indirect prompt injection causes LLM agents to follow commands embedded in external data. A probe may distinguish instructions from data without identifying a state edit that changes the next action. We study this gap through counterfactual role probes, component-wise activation patching, and separate interventions on AgentDojo trajectories. Role decoding survives changes in content and format. In controlled Qwen tests, it precedes strong tool-choice effects from patches along an independently estimated role direction. On AgentDojo, directions estimated from hijacked and resisted training trajectories reduce attack success at pre-action and injected-span positions, but have little effect at random positions. In longer Qwen trajectories, single-position edits become less effective at later layers; span-wide and repeated edits reduce attack success on the same evaluation set. Removing the learned channel subspace preserves role decoding, yet effective intervention directions transfer poorly across the tested channels. These findings distinguish a readable role signal from an effective behavioral intervention: depth matters in controlled tool choice, while position and context also matter in attack trajectories.

1 INTRODUCTION

LLM agents must use external content without obeying every command it contains. An email may request a database deletion while the user's task is only to summarize it. Whether the command should be executed depends on its role in the task, not its wording alone. Indirect prompt injection (IPI) exploits this distinction: commands in tool outputs, messages, or retrieved memory acquire the authority of an instruction (Ye et al., 2026).

We ask three questions. Can source role be read from model states? Can a role-aligned patch change a controlled tool decision? In separate attack evaluations, do effective edits transfer across channels? These tests distinguish readout, intervention, and transfer. Probe accuracy alone answers neither where to edit nor whether an edit will work in another setting.

Prior work connects internal role perception to injection success (Ye et al., 2026), separates harmfulness recognition from refusal (Wu et al., 2026), and uses IPI-exposure probes to trigger protective reasoning (Dong et al., 2026). We ask when direct role-aligned edits change tool choice, and test behavioral interventions separately on attack trajectories. This requires separating role readout from format cues, and role-aligned patching from a full-state swap that also transfers other donor information.

External content spans multiple positions and remains in context across tool calls. An effect on one controlled decision therefore need not persist across multi-step attacks or external sources. We test position, trajectory length, and channel match as conditions of an intervention’s effectiveness.

We test role readout under counterfactual content and format controls, then compare full-state, role-aligned, and orthogonal patches on separate tool-choice pairs (Figure 1). Independent AgentDojo tests measure attack outcomes after state swaps and edits along outcome-associated directions. Model weights remain fixed throughout.

A Role-aligned intervention

Figure

B Readability before actionability

Figure

Role-aligned patching

Tool-choice pairs, n = 100

Figure 1: Role readout precedes strong patching effects in controlled Qwen tests. (A) Schematic role-component patches at the pre-action token; L16 and L20 are separate runs. (B) Measured role readout and tool-choice flips, evaluated on separate datasets (100 tool-choice pairs). Lines connect measured layers.

In the controlled Qwen tests, we find a readability–actionability gap: role is decodable before role-aligned edits strongly affect tool choice. Here, actionability means sensitivity to the specified edit; the ordering is across network depth, not reasoning steps. We establish three findings:

• Role readout precedes strong tool-choice effects. On controlled Qwen tasks, counterfactual probes decode role before role-component patches produce strong tool-choice effects.

• Attack-trajectory effects depend on the states edited. AgentDojo interventions are position-sensitive. Qwen’s single-position late-layer rebound is largest in longer trajectories; span-wide and repeated edits reduce attack success on the same evaluation set.

• Role readout survives channel removal. Removing the learned channel subspace preserves role decoding. Separate intervention tests favor channel-matched directions over transferred ones.

References (23)