Across 629 security test cases spanning 97 stateful tasks, AgentDojo shows that stronger tool-calling models are paradoxically easier to hijack via prompt injection, and that restricting an agent’s tool list upfront cuts GPT-4o’s targeted attack success rate from 57.69% down to 6.84% while improving benign task completion.

Unlike earlier benchmarks that test single-turn text outputs or use an LLM to simulate tool execution (which an injection can hijack alongside the agent), Debenedetti et al. run agents against mutable Python environments (Workspace, Slack, Travel, and Banking, totaling 74 tools and 27 injection goals) scored by deterministic state assertions. Running all 629 security tests on GPT-4o costs roughly $35 (and $4 for the 97 benign tasks).

  • High baseline failure rate: Even without attacks, top LLMs fail many multi-step tasks: Claude 3.5 Sonnet leads at 78.22% benign utility, followed by GPT-4o (69.00%), Claude 3 Opus (66.61%), and Llama 3 70B (34.50%).
  • Inverse capability-security trend: More capable agents follow injected instructions more reliably; GPT-4o suffered 47.69% targeted attack success rate (ASR) under the baseline attack, versus 8.43% on GPT-3.5 Turbo and 0.95% on Command-R+.
  • Phrasing and position dominate: Wrapping an injection as an "Important message" drove 57.7% targeted ASR on GPT-4o (versus 5.41% for "Ignore previous" and 5.72% for InjecAgent’s prompt), and injections placed at the end of a tool’s output reached up to 70% ASR.
  • Utility loss under attack: Even the strongest defenses lose 15 to 20 percentage points of benign task utility when an attack is present in the environment.
GPT-4o defense tradeoffs across 629 AgentDojo security cases
DefenseBenign UtilityUtility w/ AttackTargeted ASR (lower better)
No defense69.00%50.01%57.69%
Data delimiting72.66%55.64%41.65%
Repeat prompt85.53%67.25%27.82%
PI detector (DeBERTa)41.49%21.14%7.95%
Tool filter73.13%56.28%6.84%

Source: Debenedetti et al. (2024), Table 5. 95% CIs are ±2.0% to ±3.9%; Section 4.3 prose cites ~7.5% for tool filtering, while Table 5 reports exact v3 numbers above.

How AgentDojo separates utility and security

Each AgentDojo suite pairs realistic user tasks (requiring up to 18 chained tool calls across 7,000 data tokens and 4,000 tool-schema tokens) with attacker injection tasks (spanning 1 to 20 steps, from posting phishing links in Slack to exfiltrating 2FA codes or transferring bank funds). Because the environment exposes explicit ground-truth call sequences and attack placeholders, attacks automatically land in tool outputs the agent actually queries.

Scoring tracks three independent metrics rather than collapsing everything into refusal rates. Benign utility measures task completion with no attack present. Utility under attack measures whether the agent finishes the user’s job with zero malicious side effects. Targeted ASR measures whether the attacker’s state mutation succeeded. Separating these prevents a lazy defense (like aborting every session) from looking safe while destroying usability.

Key findings across models, attacks, and defenses

Testing 10 frontier and open-weight models reveals sharp differences in how capability trades off against hijack risk. Claude 3.5 Sonnet sits on the best overall frontier (78.22% benign utility, 51.19% under attack, 33.86% targeted ASR), whereas Claude 3 Opus achieves similar benign utility (66.61%) with a notably lower 11.29% targeted ASR. By contrast, GPT-4o (69.00% benign utility) was hijacked in 47.69% of baseline cases (rising to 57.69% with matched user/model names).

Attack anatomy ablations show how sensitive prompt injection is to framing and context share. In the Slack suite, where attackers control large portions of web pages fetched by tools, targeted ASR reached 92% on individual tasks; on Travel task 6 (booking an expensive hotel while emailing personal data), ASR was 0% because GPT-4o rarely chained two unrelated malicious goals. Knowing the real user and model names added only +1.9% ASR (45.8% to 47.7%), while guessing the wrong user or model cut ASR in half (23.2% and 23.7%).

On defenses, tool filtering (having the LLM lock down its tool subset before reading untrusted outputs) lowered targeted ASR from 57.69% to 6.84% while lifting benign utility to 73.13%. Repeating the user prompt after tool outputs (Repeat prompt) boosted benign utility to 85.53%, though ASR remained 27.82%. Meanwhile, ProtectAI’s DeBERTa prompt-injection classifier cut ASR to 7.95% at a brutal false-positive cost, slashing benign utility from 69.00% to 41.49%.

Benign utility vs. targeted attack success rate across models
ModelBenign UtilityTargeted ASR (under attack)
Claude 3.5 Sonnet78.22%33.86%
GPT-4o69.00%47.69%
Claude 3 Opus66.61%11.29%
GPT-4 Turbo63.43%28.62%
Llama 3 70B34.50%20.03%
GPT-3.5 Turbo33.86%8.43%

Source: Debenedetti et al. (2024), Table 3. Evaluated with the “Important message” injection across 629 security cases.

Caveats and builder takeaway

Tool filtering is no silver bullet. It fails when the required tools cannot be predicted before reading external data, when the tool needed for the user’s task is already sufficient to execute the attack (17% of AgentDojo test cases), or in multi-turn sessions where an injection waits for a later write-capable task. It also cannot stop in-tool manipulation, such as a hotel listing injecting text so the agent picks that hotel.

For stronger guarantees, teams need architectural separation of control flow from untrusted data, such as CaMeL or action-resampling protocols like Ctrl-Z and AI control monitoring. As a practical baseline today, prune write tools before ingesting untrusted inputs, enforce hard authorization checks outside the model, and benchmark both benign utility and ASR together so you never mistake a broken agent for a secure one.