AgentDojo and InjecAgent: how prompt injection is measured in tool-using agents

Two benchmarks put numbers on prompt injection against agents with tools. AgentDojo checks the environment's state after each run; InjecAgent counts harmful tool calls. Here is what each measures, what they found, and what to take from it.

The short answer

AgentDojo and InjecAgent are benchmarks that measure how often tool-using agents follow instructions planted in the data they read, the attack known as indirect prompt injection.3 AgentDojo gives agents real tasks in four simulated environments, plants injections in what they retrieve, and checks the environment’s state afterwards with deterministic functions.1 InjecAgent builds 1,054 cases where a tool’s output carries an attacker’s instruction and counts how often the agent then calls the attacker’s tool.2

Their findings point the same way. In AgentDojo, agents solved under 66% of tasks even without attacks, attacks succeeded against the best agents in under 25% of cases, and restricting the tools available before untrusted data was read cut attack success to about 7.5%.1 In InjecAgent, ReAct-prompted GPT-4 was vulnerable 24% of the time.2

Every MCP tool call goes through your rules first. Here a delete that doesn’t say which rows is stopped before it reaches the database. These are the rules deedglass init starts with; the call is made up.

Two benchmarks, two questions

AgentDojo InjecAgent
Authors ETH Zurich and Invariant Labs1 Zhan, Liang, Ying, Kang2
Size 97 user tasks, 629 security cases1 1,054 cases2
Setting Workspace, Slack, Travel, Banking1 17 user tools, 62 attacker tools2
Scored by Functions over environment state1 Whether the attacker’s tool call happens
Measures usefulness too? Yes: utility with and without attack No
Extensible? Yes, a framework1 A fixed set

The key difference is that AgentDojo also measures whether the agent still does its job. A defence that refuses everything would score perfectly on security and zero on utility; AgentDojo shows both.

AgentDojo: tasks checked by state

Each AgentDojo security case pairs a user task with an injection task the attacker wants done instead, and places the injection in data the agent will read while doing the user task. To picture it (our illustration, not a quoted case): the user asks for a summary of unread email, and one email tells the assistant to forward a document to an outside address.

Success isn’t judged by another language model. The authors use deterministic functions that inspect the environment’s state, and they explain why: an LLM judge could itself be hijacked by the injection it’s evaluating.1 Did the email get sent to the attacker? Look at the outbox. Did the user’s task get done? Check the expected changes.

That gives three numbers:1

  1. Benign utility: task success with no attack.
  2. Utility under attack: task success with an injection present and no attacker side effects.
  3. Targeted attack success rate: how often the attacker’s goal was met.

InjecAgent: harmful calls counted

InjecAgent is narrower and larger. Each case gives an agent a user instruction that calls a tool; the tool’s response contains an attacker’s instruction; and the test checks whether the agent then calls one of 62 attacker tools. The attacks aim either at direct harm to the user or at stealing private data.2

It also tested a stronger variant: a “hacking prompt” that reinforces the attacker’s instruction. That nearly doubled the attack success rate on ReAct-prompted GPT-4.2 The lesson isn’t about one model. It’s that small changes in attacker wording move results a lot, so a single success rate understates what a determined attacker can do.

What the numbers say

The headline results, with the models those papers tested in 2024:

Finding Number
AgentDojo: tasks solved without any attack Under 66%1
AgentDojo: attack success against the best agents Under 25%1
AgentDojo: with a secondary attack detector 8%1
AgentDojo: with a tool filter applied before untrusted data About 7.5%1
InjecAgent: ReAct-prompted GPT-4 vulnerable 24% of cases2
InjecAgent: with a hacking prompt Nearly double2

Model numbers age fast; newer models score differently. Two results age slowly.

The tool filter works, with limits. Restricting which tools the agent can call, decided before it reads any untrusted data, was one of the most effective defences. The authors note where it fails: when the tools a task needs can’t be planned in advance, and when the tools the task legitimately needs also enable the attack.1 An email assistant that must send email can be told to send it to the wrong person.

Detectors help, and aren’t zero. A separate detector cut attack success to 8%. Eight percent of a thousand agent runs a day is eighty.

How to read a prompt-injection score

When a vendor or paper quotes an attack success rate, ask:

  1. Against which attacks? A fixed set, or adaptive ones written against the defence? Fixed sets flatter defences.
  2. What happened to utility? A defence that halves attacks and halves useful work isn’t a win.
  3. How was success judged? State checks are harder to fool than a model’s opinion.1
  4. Which model, which date? Results don’t carry over between models.
  5. What was the agent allowed to do? An attack can only succeed through tools the agent has.

The last question is the one under your control in production.

What to take into your own system

These benchmarks measure the model-and-prompt layer. In a deployment, you can also change the layer underneath: what tools exist, and what each call is allowed to do.

  • Plan tools before reading data, as the tool filter does. Give the agent the smallest tool set for the task before it opens any email, ticket or page.
  • Put rules on arguments, not just tool names. “Send email only to our domain” survives an injection that a tool filter can’t, because the tool is still needed.
  • Check state, not transcripts, as AgentDojo does. Know what changed after each run.
  • Test with your own tasks. Write cases where the model is assumed fooled and check what its calls could do; our attack suite post describes one approach.

For the history behind the attack, see indirect prompt injection research; for a related benchmark that also scores by database state, τ-bench. The prompt injection entry has the short definition. To see rules on tool calls refuse an action on a real database in your browser, try the playground; to grade what an agent can reach on your machine, run npx deedglass scan (the grade, explained).

Written with AI assistance and checked against our claims register.

The takeaway

AgentDojo found agents finished under 66% of tasks unattacked and attacks beat the best in under 25% of cases; restricting tools early cut that to about 7.5%.

Read nextIndirect prompt injection: what the 2023 paper predicted, and what happened next Try it: install in 7 s

Related on this site

More posts

Sources

  1. 1Debenedetti et al. AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents (arXiv 2406.13352) · arxiv.org · checked 26 October 2026
  2. 2Zhan et al. InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated LLM Agents (arXiv 2403.02691) · arxiv.org · checked 26 October 2026
  3. 3Greshake et al. Indirect prompt injection (arXiv 2302.12173) · arxiv.org · checked 26 October 2026

Published 26 October 2026, sources last checked 26 October 2026. If something here is out of date, write to hello@deedglass.com.

Try it on your own setup

npx deedglass scan

Grades only your own setup. Nothing is uploaded.

Pricing