Back to blog
AI agentsprompt injectionadversarial trainingAgentDojoadaptive attacksred teaming

Prompt injection training can make AI agents more vulnerable

Published on 2026-11-238 min read
In short: A study posted on November 18, 2026 (PIPETTE; Waterloo, Zhejiang, KTH) shows that training an agent against the attacks from an automated red teaming tool does not necessarily make it more robust. On Qwen3-4B, the tool that found the most attacks (68.75% success during training, versus 33.39%) produced the most vulnerable agent afterward (47.5% worst-case hijack rate, versus 27.5%). The suggested cause: these tools repeat a few tricks. To test an agent, count distinct techniques, run adaptive attacks and put controls outside the model.

What does the PIPETTE study say about training against prompt injection?

It shows that two reinforcement-learning red teaming tools, RL-Hammer and PISmith, suffer from mode collapse: they keep rediscovering similar attacks, and using them to train an agent does not bring a proportionate gain in robustness. The preprint is titled “PIPETTE: Prompt Injection Purple-Teaming for Robust LLM Agents” (arXiv 2611.24362, v1 of November 18, 2026), by Lipeng He, Yihan Wang, Jiawen Zhang and N. Asokan, from the University of Waterloo, Zhejiang University and KTH. Help Net Security relayed it on November 20, 2026.

This is a preprint, to our knowledge without peer review, and it covers open models from 4 to 27 billion parameters. Its results inform a testing method; they do not transfer as is to every commercial model.

Why does the tool that finds the most attacks produce a more fragile agent?

Because the number of successful attacks measures how busy the tool was, and says little about coverage of techniques. According to the authors, the tools reuse one trick across many tasks, and diversity checks measure differences in wording. Help Net Security reports that one of RL-Hammer’s authors reportedly satisfied a diversity check by changing capitalization or adding irrelevant text. A bigger collection then holds more copies of a few attacks and little more variety.

Measure (Qwen3-4B)PISmithRL-Hammer
Cumulative success during training68.75%33.39%
Working attacks collected7,1324,282
Worst case after reinforcement training (AgentDojo)47.5%27.5%
Worst case after supervised tuning12.5%15.0%

The table calls for nuance. The “more attacks, weaker defense” pattern shows up in three of the four setups tested: on Qwen3-4B with supervised tuning the order flips, and the gaps on Llama-8B are small (27.5% versus 25.0% with reinforcement, 20.0% versus 15.0% with supervised tuning). The authors do not claim that narrow coverage is the only cause. The result remains instructive: a large quantity of attacks guarantees nothing about what the agent learned.

How does PIPETTE measure attack diversity?

It breaks each successful injection into strategy elements, learns a dictionary of reusable “primitives”, and rewards the attacker when a new attack is not explained by those primitives. The explainability score (between 0 and 1) is graded by a judge model. On unseen ChatInject attacks, RL-Hammer plateaus around 0.20 on Qwen and 0.35 on Llama, while PIPETTE’s red variant reaches about 0.60 and 0.77. Help Net Security flags a limitation: this judge has not been checked against human raters.

The defensive half retrains the agent to check, before each action, whether the action serves the user’s request. This approach avoids the pitfall of an agent that refuses whenever data looks suspicious.

Do PIPETTE’s results hold against adaptive attackers?

Mostly yes, with non-zero leftovers. On AgentDojo, the average success rate of static attacks falls to 0.48% on Qwen3-4B and 0.43% on Llama-8B, versus 33.29% and 13.48% with no defense. Against iterative attackers (TAP and a genetic search, 40 task pairs), rates stay low but are not zero.

Model and defenseTAPGenetic
Qwen3.6-27B, no defense40.0%70.0%
Qwen3.6-27B, PIPETTE2.5%5.0%
GPT-OSS-20B, no defense50.0%92.5%
GPT-OSS-20B, PIPETTE5.0%10.0%

Utility does not collapse: on Qwen3-4B, the hardened agent completes 64.95% of clean tasks versus 61.86% for the original model. In the comparison reported by Help Net Security, PromptGuard blocked slightly more attacks under one attack, but its agent completed the real task only 16.19% of the time, versus 58.10% for PIPETTE’s agent. A filter that blocks everything is easy to make harmless and unusable.

What does this change about how to test an agent?

Three things: count distinct techniques, test against an attacker who adapts, and measure what sits outside the model.

  1. Measure attack diversity. Group successful attacks by technique (instruction hidden in a document, role impersonation, fake tool output, encoding, format hijacking) and report the number of distinct techniques covered. A set of 5,000 variants of a single trick is worth one attack.
  2. Add adaptive attacks. A frozen set is only a floor: the real attacker adjusts attempts according to the responses. Plan a high attempt budget, on the order of several hundred per sensitive task, and report the result separately from the static set.
  3. Report utility alongside robustness. A defense that makes legitimate task success drop moves the problem. Track both curves.
  4. Separate testing before and after hardening. If the agent was trained or tuned on a set of attacks, evaluate it on techniques it has never seen.

How does this connect to measuring an attack success rate?

By reporting each result with its number of trials and a confidence interval. With 40 task pairs, 4 successes out of 40 (10%) give a 95% Wilson interval of roughly 4.0% to 23.1%; zero out of 40 leaves a ceiling of about 8.8%. These ranges are wide: comparing two defenses a few points apart on 40 tasks does not allow a conclusion. Our article on measuring robustness with the Wilson interval details the calculation and the number of trials needed.

PIPETTE’s addition to that framework fits in one sentence: the interval says how many trials were run, and diversity says what they were run against. Both are needed.

Why are controls outside the model still necessary?

Because even the best result in the study leaves a residual rate: according to Help Net Security, one search-based attacker still succeeded on 4 of the 40 tasks against GPT-OSS-20B. An agent that handles a large volume of documents cannot treat a non-zero attack success rate as tolerable for sensitive actions.

Controls that do not depend on the model limit the blast radius of whatever gets through:

  • Minimal privileges for the agent’s tools and tokens.
  • Human confirmation for actions with lasting or external effects, see our article on human-in-the-loop.
  • Output controls: links, images and network calls that could leak data.
  • System-side authorization: a layer between the agent and its tools that validates each action against a policy, whatever the model outputs.

The buyer questions Help Net Security suggests work well as a list to put to a provider: how many distinct techniques were covered, how the agent held up against an attacker with several hundred attempts, and what share of tasks the hardened agent still completes. The pre-production security checklist helps build a protocol.

How does CleanIssue apply these principles?

We report the techniques covered, the number of trials and an interval, with an adaptive part kept separate from the static set, then we test the controls around the model. Our page on prompt injection sets the framework. The Agent Red Team Express (€1,900, 5 days, start within 48 hours of signing the quote and the authorization) covers one agent and its tools with these repeated measurements; several agents fall under the Custom Red Team, on quote. The first step is a free 30-minute discovery call.

Does your product ship an AI agent? CleanIssue tests what a stranger can make it do with the Agent Red Team Express (5 days, €1,900), or a custom red team for several agents and MCP servers. First step: a free 30-minute discovery call.

Know what your agent can do before an attacker does.

A free 30-minute discovery call: you describe your agent, I tell you what I would test and what it costs. Five case studies are published.

Book a call