AgentDrift: A Step-Labeled Benchmark of Injection-Hijacked LLM Agent Trajectories
Organizations: School of Informatics, Computing, and Cyber Systems Northern Arizona University Flagstaff, AZ, USA
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.
Figures & tables
| Resource | Primary purpose | Size (as reported) | Labeled corpus | Step labels | Injection step labels | Resisted class | Hard negatives |
|---|---|---|---|---|---|---|---|
| InjecAgent [ 3 ] | Attack-success evaluation | 1,054 cases | |||||
| AgentDojo [ 6 ] | Dynamic attack/defense environment | 629 cases | |||||
| ASB [ 4 ] | Multi-surface attack/defense benchmark | 10 scenarios | |||||
| RAS-Eval [ 7 ] | Security evaluation, real tools | 3,802 tasks | |||||
| WASP [ 5 ] | Web-agent injection evaluation | 84 cases | |||||
| AgentDyn [ 8 ] | Dynamic-environment injection eval. | 560 cases |
| Field | Type | Meaning |
|---|---|---|
| id | string | domain, source category, index; e.g. email_benign_0509 (attacked ids carry the pattern, as in attacked_full ) |
| agent | enum | domain: email , banking , web , coding , medical |
| category | enum | benign , attacked , failed_attack , hard_negative |
| source_category | enum | category refined by compliance pattern (six values) |
| task | string | the user instruction |
| world | object | : user , email , company , date , contacts[] with name , email , relation |
| Domain | Tools | Most frequent tools (calls) |
|---|---|---|
| 20 | search_inbox (2,749), read_email (1,454), forward_email (1,389), get_contacts (1,010), send_email (993) | |
| banking | 20 | get_balance (1,702), get_transactions (1,366), transfer_money (1,362), get_statement (928), get_beneficiaries (797) |
| web | 20 | fill_form (2,063), search_web (1,834), open_tab (1,584), read_webpage (1,498), submit_form (994) |
| coding | 23 | execute_command (1,986), search_code (1,612), run_tests (1,011), read_logs (972), list_files (823) |
| medical | 20 | get_patient_record (2,107), update_patient_record (1,649), send_patient_message (1,552), get_medical_history (1,405), get_appointments (900) |
| Domain | Accepted | Rejected | Candidates | Acceptance |
|---|---|---|---|---|
| 2,600 | 53 | 2,653 | 98.0% | |
| banking | 2,136 | 2,422 | 4,558 | 46.9% |
| web | 2,600 | 379 | 2,979 | 87.3% |
| coding | 2,600 | 320 | 2,920 | 89.0% |
| medical | 2,600 | 190 | 2,790 | 93.2% |
| Total | 12,536 | 3,364 | 15,900 | 78.8% |
| Source category | Traj. | GOOD | Rate | Grammar |
|---|---|---|---|---|
| benign | 4,000 | 3,582 | 89.6% | 100% |
| attacked (full hijack) | 3,136 | 112 | 3.6% | 100% |
| attacked (partial hijack) | 1,500 | 678 | 45.2% | 100% |
| attacked (delayed execution) | 900 | 13 | 1.4% | 100% |
| failed attack | 1,500 | 574 | 38.3% | 100% |
| hard negative | 1,500 | 6 | 0.4% | 100% |
| Category | banking | web | coding | medical | Total | |
| benign | 800 | 800 | 800 | 800 | 800 | 4,000 |
| attacked | 1,200 | 736 | 1,200 | 1,200 | 1,200 | 5,536 |
| full hijack | 720 | 256 | 720 | 720 | 720 | 3,136 |
| partial hijack | 300 | 300 | 300 | 300 | 300 | 1,500 |
| delayed execution | 180 | 180 | 180 | 180 | 180 | 900 |
| failed attack | 300 | 300 | 300 | 300 | 300 | 1,500 |
| Family | Full | Partial | Delayed | Attacked | Failed |
|---|---|---|---|---|---|
| parameter_manipulation | 587 | 247 | 171 | 1,005 | 235 |
| direct_harm | 543 | 255 | 145 | 943 | 255 |
| branch_divergence | 524 | 245 | 158 | 927 | 248 |
| reasoning_corruption | 518 | 250 | 140 | 908 | 256 |
| data_stealing | 520 | 249 | 133 | 902 | 242 |
| multi_step_spreading | 443 | 254 | 153 | 850 | 264 |
| Step label | Steps | Share |
|---|---|---|
| benign | 51,639 | 72.7% |
| injection_point | 5,536 | 7.8% |
| hijacked | 12,349 | 17.4% |
| failed_injection | 1,500 | 2.1% |
| Total | 71,024 | 100% |
| Train | Val. | Test | Total | |
| benign | 2,800 | 600 | 600 | 4,000 |
| attacked | 3,875 | 830 | 831 | 5,536 |
| full hijack | 2,178 | 492 | 466 | 3,136 |
| partial hijack | 1,062 | 207 | 231 | 1,500 |
| delayed execution | 635 | 131 | 134 | 900 |
| failed attack | 1,050 | 225 | 225 | 1,500 |
| Statistic | Value |
|---|---|
| Injected observations naming an ext-audit.com address | 28.9% |
| Injected observations containing “compliance review ext audit” | 25.0% |
| Injected observations containing “must be forwarded to” | 12.9% |
| Injected observations containing “within 10 minutes to” | 8.5% |
| Hard negatives mentioning $5,000 | 75.3% |
| Hard negatives mentioning an in-domain audit@ address | 75.9% |
| Domain | Test traj. | World seen in train | 4-class acc. | Binary acc. |
|---|---|---|---|---|
| 390 | 390 | 45.1% | 47.7% | |
| banking | 321 | 317 | 96.3% | 96.9% |
| web | 390 | 388 | 92.3% | 93.3% |
| coding | 390 | 390 | 93.3% | 96.2% |
| medical | 390 | 383 | 97.4% | 98.2% |
| all | 1,881 | 1,868 | 84.5% | 86.1% |
| Category | Ext. recipient | Ext. URL | 1 keyword | Mean hits |
|---|---|---|---|---|
| benign | 10.0% | 19.8% | 23.9% | 0.26 |
| attacked | 53.7% | 22.7% | 71.0% | 2.05 |
| failed attack | 7.9% | 19.2% | 94.7% | 2.57 |
| hard negative | 9.9% | 18.3% | 97.3% | 1.70 |
| True category | Flagged / total | Flag rate |
|---|---|---|
| attacked | 460 / 831 | 0.554 |
| full hijack | 410 / 466 | 0.880 |
| partial hijack | 19 / 231 | 0.082 |
| delayed execution | 31 / 134 | 0.231 |
| benign | 63 / 600 | 0.105 |
| failed attack | 42 / 225 | 0.187 |
AI Agent Security Benchmarks
AI agent security benchmarks measure how tool-using and autonomous systems handle attacks, privacy risks, authorization, and harmful actions.
See all 305 papers