PIPETTE: Prompt Injection Purple-Teaming for Robust LLM Agents

Lipeng He, Yihan Wang, Jiawen Zhang, N. Asokan

University of Waterloo · Zhejiang University · KTH Royal Institute of Technology

Published November 18, 2026 · on the feed November 19, 2026 · ▲ 8 · arXiv 2611.24362

Safety, alignment & securityAgentsLLM training & RL No code arXiv ↗Hugging Face ↗

The abstract

Large language model (LLM) agents routinely interact with untrusted external data, exposing them to indirect prompt injection (IPI) attacks that hijack agents into executing attacker-chosen tasks. To uncover these vulnerabilities at scale, automated red-teaming methods often leverage reinforcement learning (RL) to generate attacks that achieve high attack success rates (ASR). Model developers use the attacks discovered during internal red-teaming to harden agents through adversarial training before deployment, a collaborative offensive-defensive process known in cybersecurity as purple-teaming. However, we show that achieving high ASR during red-teaming does not guarantee robustness gains from subsequent adversarial training. Specifically, we find that two state-of-the-art RL-based red-teaming methods, RL-Hammer and PISmith, suffer from mode collapse, repeatedly discovering similar attack strategies whose additional successes add no additional robustness improvements to adversarial training. To address this gap, we introduce PIPETTE, a unified prompt injection purple-teaming framework that effectively converts red-teaming discoveries into defender robustness improvements. PIPETTE employs a dictionary learning-based reward that encourages broader coverage of attack strategies during red-teaming. It also integrates an on-policy adversarial training pipeline tailored to IPI defense, enabling agents to resist attacks while completing legitimate user tasks. Extensive evaluations across agentic benchmarks (AgentDojo and ASB) demonstrate that PIPETTE produces defenders that achieve near-zero attack success rates on static attacks and can withstand strong adaptive attacks, while maintaining benign task utility close to that of the undefended baseline.

The Brief

2:38

A short podcast summary of the paper. Written and voiced by AI.

Transcript

PIPETTE. Prompt Injection Purple-Teaming for Robust LLM Agents. By Lipeng He and three others, from the University of Waterloo, Zhejiang University, and one other institution. Published on the eighteenth of November.

Agents built on large language models routinely handle untrusted external data. That exposes them to indirect prompt injection, attacks that hijack an agent into carrying out a task the attacker chose. To find such weaknesses at scale, automated red-teaming often uses reinforcement learning to generate attacks with high success rates. Developers then feed the attacks found internally into adversarial training, hardening the agent before it ships. Cybersecurity calls that combined offensive and defensive process purple-teaming.

The authors show that the chain can break in the middle. A high attack success rate during red-teaming does not guarantee that the later adversarial training makes the agent more robust. Two state-of-the-art red-teaming methods based on reinforcement learning, RL-Hammer and PISmith, suffer from mode collapse. They keep rediscovering similar attack strategies, and those extra successes add nothing to the robustness that adversarial training achieves. The red team's scoreboard keeps climbing, but the extra attacks do not make the defender trained on them any harder to break. Counting successes, in other words, is not the same as finding new ways in, and only the second helps the defense.

PIPETTE is a unified purple-teaming framework for prompt injection, aimed squarely at that break. Its goal is not just to find attacks that succeed, but to turn what red-teaming discovers into real gains in robustness for the defender. Attack and defense are treated as one pipeline rather than two separate exercises, with the attacker shaped by what the defender will need to learn from.

It has two parts. On the red-teaming side, a reward based on dictionary learning encourages the attacker to cover a broader range of attack strategies, rather than collapsing onto a few. On the defending side, an on-policy adversarial training pipeline is tailored to defense against indirect prompt injection, so that the agent learns to resist attacks while still completing the legitimate tasks its user asked for.

Evaluation runs across the agentic benchmarks AgentDojo and ASB. The defenders PIPETTE produces reach attack success rates near zero on static attacks, and they withstand strong adaptive attacks as well. Their utility on benign tasks stays close to that of the undefended baseline, so the added robustness does not come at a large cost to ordinary work.

The lesson sits in the gap between the two halves of purple-teaming. A red-team score measures how often attacks land, but repeated successes with the same strategy taught the defender nothing new. PIPETTE rewards that variety directly, and couples it to training built for the defense, so the attacks it discovers are ones the agent actually learns from.

More with an account

Listen to every day’s papers

Daily playlists, deep dives, quests for the papers, and quizzes on their key terms.

Join free
KipQuest: the day’s AI research, as podcasts and quests. All papers Android app Privacy Contact Episodes are written and voiced by AI from each paper. Summaries can contain mistakes: the paper is the source.