typebraintank dispatch
headlineHijack-resistant AI agents need varied practice attacks, not just successful ones
dekA 2026 preprint finds that red-teamers chasing attack success reuse a few tricks. Also rewarding new strategies gave agents that resisted injections and still did their jobs.
date2026-12-01
sectionAlignment · prompt injection defence
paperPIPETTE: Prompt Injection Purple-Teaming for Robust LLM Agents
statuspreprint, not peer reviewed
originalhttps://braintank.ai/a/arxiv-2611.24362.html
cite
text

AI agents that read emails, web pages and tool outputs on a user's behalf can be hijacked by instructions hidden in that material, an attack known as indirect prompt injection. A common defence is purple-teaming: an internal red team generates attacks, and the blue team uses them to retrain the agent. A 2026 preprint by Lipeng He, Yihan Wang, Jiawen Zhang and N. Asokan, which has not yet been peer reviewed, argues that this pipeline has a hidden flaw. An attack generator that succeeds more often does not necessarily produce better training material.

The authors compared two reinforcement-learning red-teamers, RL-Hammer and PISmith. On the Qwen3-4B model, PISmith compromised 68.75% of training task pairs at least once (its cumulative training-time attack success rate, or ASR; ASR is the share of attacked tasks in which the agent carries out the attacker's task) and collected 7,132 successful attack strings. RL-Hammer managed 33.39% and 4,282. Yet agents retrained on PISmith's attacks ended up more vulnerable in three of four settings. With reinforcement-learning retraining on Qwen3-4B, worst-case ASR rose from 27.5% to 47.5%. The authors attribute this in part to strategy-level mode collapse: the generators keep reusing the same few tricks in different words. Their diversity measures look only at surface text, so rephrasing counts as novelty. Standard retraining also cost usefulness. Llama-3.1-8B completed 40.21% of clean tasks before retraining and 15.46% after supervised fine-tuning on RL-Hammer attacks.

The proposed framework, PIPETTE, has two halves. On the attack side, an LLM turns each successful injection into a structured description of its strategy. Sparse dictionary learning, which finds a small set of basic patterns that can be mixed to describe each example, then distils these descriptions into shared strategy primitives, such as pretending the task is already done. For each new attack, an LLM grader assigns an Explainability Score between 0 and 1 for how well the known primitives account for it. The red-teamer is trained with GRPO, a method that scores several sampled outputs against their group average. On top of the reward for success, it earns a coverage bonus for successful attacks that grows the less the current dictionary can explain them, and the dictionary is rebuilt periodically.

On the defence side, the agent learns to run two checks before every tool call: does the latest observation contain an instruction or redirection attempt, and does each planned action serve a goal the user actually authorised? Training rewards finishing the user's task without executing the attack. A finer token-level signal compares how likely each word is when the model is privately told to ignore the injection versus told to follow it. At deployment, the only addition is the agent's own reasoning through the two checks.

All attack generation and retraining used one benchmark, AgentDyn (560 task pairs). Testing took place on two unseen benchmarks, AgentDojo and Agent Security Bench, across four open-weight models. Against static, pre-written attacks on AgentDojo, the authors report an average ASR of 0.48% for Qwen3-4B, against 33.29% undefended, 3.33% for the PIGuard classifier and 1.71% for the isolation system CaMeL. Benign utility rose to 64.95% from the base model's 61.86%. Against adaptive attackers, which rewrite an injection up to about 250 times, Qwen3.6-27B fell to 2.50% (TAP search) and 5.00% (Genetic search). The undefended model scored 40.00% and 70.00%, and the SecOPD defence 15.00% and 30.00%. An ablation credits the token-level reward with recovering benign utility. Pipette also ran 1.9x-3.1x faster than the runtime defence MELON.

The paper notes real limits. Attacks were generated once, against the original agent, so weaknesses that emerge only in the hardened model went unprobed. The adaptive tests used 40 task pairs, so one task moves ASR by 2.5 points. They also used a 4B attacker model and excluded gradient-based attacks, and a stronger attacker might do better. Each rival trained defence was tested only on its own native model. The red-teamer comparison is confounded by differences in dataset size and sampling. Utility under adaptive attack fell on Qwen3.6-27B from 97.50% to 87.50% and 90.00%. On the ChatInject attack, PromptGuard's 0.24% beat Pipette's 1.43%.

The work takes the opposite route to SPILLWAY, which checks an agent's destinations against typed tool fields largely without a model, and reported no redirected actions under AgentDojo's standard attack. It also offers a concrete case for a survey's argument that agent training data must be genuinely varied rather than merely plentiful.