arXiv(opens in a new tab)cs.CRSep 2026Cited by 3 papers on PaperVantage

Manuscript Offprint

arXiv:2609.06972

AgentDrift: A Step-Labeled Benchmark of Injection-Hijacked LLM Agent Trajectories

Asif Pinjari, Mithun Paul Saint-Germain

Asif Pinjari

School of Informatics, Computing, and Cyber Systems Northern Arizona University Flagstaff, AZ, USA ap3929@nau.edu

Mithun Paul Saint-Germain

School of Informatics, Computing, and Cyber Systems Northern Arizona University Flagstaff, AZ, USA mithun.paul@nau.edu

Abstract—LLM agents complete tasks by issuing sequences of tool calls, and every observation they read is a channel through which an indirect prompt injection can enter. A successful injection has a characteristic shape when the trajectory is read in order: a benign prefix gives way to actions that serve the attacker rather than the user. Existing benchmarks measure whether such attacks succeed against live agents, and existing guard models judge a trace as a whole; no public corpus labels, step by step, where an injection enters a trajectory and which steps it corrupts. We present AgentDrift, a benchmark of 12,536 synthetic tool-call trajectories over five agent domains in which every one of the 71,024 steps carries one of four labels: benign, injection point, hijacked, or failed injection. The corpus contains 4,000 benign, 5,536 attacked, 1,500 failed-attack, and 1,500 hard-negative trajectories; attacked trajectories follow three compliance patterns whose label strings obey a stated regular grammar. Failed attacks carry an injection the agent resisted, and hard negatives carry legitimate content that resembles an attack, so a detector must separate attempt from success and deviation from novelty. Trajectories were generated by a single open model under category-specific protocols, enforced by a closed-vocabulary structural validator, screened by an LLM judge, and audited by hand on 1,200 trajectories; we show that the LLM judge was itself fooled by the hard negatives. A surface-feature logistic regression recovers only 55.4% of attacks (F1 0.647), including only 8.2% of partial hijacks and 23.1% of delayed executions, so nearly half of the attacks require modeling the behavioral sequence. We measure template concentration, attack-goal-family collapse, and world-identity leakage in the generated data, and release the corpus with its documentation under CC BY 4.0.

Index Terms—LLM agents, indirect prompt injection, benchmark dataset, step-level labels, tool-call trajectories, behavioral drift, runtime monitoring, AI security

I. INTRODUCTION

LLM agents act on the world by interleaving reasoning with tool calls. In the now-standard pattern popularized by ReAct [1], each step pairs a thought with a tool invocation, its arguments, and the observation the tool returns, and agents built this way already read inboxes, move money, browse the web, edit code, and retrieve patient records. Every observation the agent reads is also an attack surface. Indirect prompt injection [2] plants instructions inside content the agent retrieves, and because a language model has no hard boundary between data and instructions, the agent may adopt the planted goal as its

own. The threat is measured, not hypothetical: on InjecAgent a ReAct-prompted GPT-4 agent followed injected instructions in roughly a quarter of test cases [3], Agent Security Bench reports attack success rates above 80% for some backbones [4], and web agents built on frontier models are diverted from the user's goal by simple human-written injections in up to 86% of realistic cases, even though the attacker's full goal is reached in at most 16% [5].

Our starting observation is that a successful injection has a characteristic shape when the trajectory is read as a sequence. Execution begins benignly, a poisoned observation arrives in the middle of the task, and the steps that follow begin serving the attacker's goal instead of the user's. Injection, in other words, manifests as behavioral drift across the trajectory. Detecting it is a sequence problem: a monitor must judge each step against the user's task, the world the agent operates in, and everything that came before. Localizing it, that is, identifying the step where the injection entered and the steps it corrupted, is what makes a detection actionable, because it tells an operator what to roll back and which content source to distrust.

The resources available today do not support building or evaluating such monitors, and the gap is precise. Attack benchmarks such as InjecAgent, AgentDojo, ASB, RAS-Eval, WASP, and AgentDyn [3]–[8] measure whether attacks succeed against a live agent and output success rates, not labeled trajectories. Guard models and their datasets judge a trace as a whole and fold resisted injections into the safe class [9]–[11]. Step-level labels exist for procedural failures [12]–[14] and for rogue behavior that originates in the agent rather than in injected content [15]; the one static trace benchmark that localizes injection to a step marks a single mutated step without the corrupted span and has no resisted class [16]; and the two concurrent efforts whose label designs come closest had not released their data at the time of writing (September 2026) [17], [18]. What no public dataset provides is a corpus in which every step of every trajectory carries an injection-specific label, with the two contrast classes that keep detectors honest.

AgentDrift fills exactly this gap. It contains 12,536 tool-call trajectories over five agent domains, divided into benign executions, successful attacks, failed attacks in which the agent saw the injection and resisted it, and hard negatives whose legitimate content superficially resembles an attack. Every one of its 71,024 steps carries one of four labels, and every label string belongs to a stated regular grammar that the construction pipeline enforces. The corpus is synthetic, produced by a single open model under a labeling protocol that is specified at generation time and verified structurally, screened, audited, and measured afterwards; we report the verification in full, including the parts that did not work.

Our contributions are as follows.

  • The AgentDrift benchmark. A corpus of 12,536 trajectories, 71,024 step labels, five domains with closed tool pools, four categories, three compliance patterns, and per-trajectory world context that grounds the distinction between legitimate and attacker-directed actions (Section IV).

  • A formal label grammar and task definitions. Trajectories, labels, category constraints, the injection index, and the detection, localization, and attempt-versus-success tasks are defined precisely, with metrics (Section III).

  • A construction pipeline with measured yield. Protocol-specified labels, a closed-vocabulary validator, and per-cell rejection statistics that explain every count in the corpus, including its one anomaly (Section V).

  • Quality assurance reported honestly. Programmatic checks over the whole corpus, an LLM screening pass that we show to be an unreliable verifier of security labels, and a 1,200-trajectory manual audit (Section VI).

  • Shortcut and diversity analysis. Measurements of template concentration, attack-goal-family collapse, world-identity leakage, and surface-cue prevalence, with evaluation protocols that guard against memorization (Section VIII).

  • Benchmark validation. A surface baseline that recovers 55.4% of attacks overall and 88.0% of full hijacks but only 8.2% of partial hijacks and 23.1% of delayed executions, and that flags failed attacks at nearly twice the benign rate, establishing that the benchmark cannot be solved without sequence modeling (Section IX).

One scope statement up front. AgentDrift is designed for injection detection and step-level localization. It is not certified for attack-goal-family classification, and Section VIII-B explains why. The remainder of the paper proceeds from related work (Section II) through formulation, design, construction, quality assurance, statistics, shortcut analysis, and the baseline, to access and documentation (Section X), limitations (Section XI), and future work (Section XII).

References (46)