AGENT SECURITY RESEARCH PREPRINT · 2026

CoER

Defending against Adaptive
Indirect Prompt Injection

via Adversarial Co-Evolution and Refinement

arXiv:2609.07529 · Updated September 2026

2 checkpoints + 3 datasets available

THE FRAMEWORK

A three-stage path to safer agents.

Attacker SFT → Bilateral Co-PPO → Defender SFT

CoER's three-stage framework: attacker supervised initialization, bilateral co-evolution with historical opponents, and defender supervised refinement.
FIGURE 2 The updated three-stage framework. Current policies learn against current and frozen historical opponents; evaluated snapshots refresh the pools. Retained attackers then guide verified defender refinement.
01

Initialize the attacker

Learn from all attacker turns in verified-success trajectories, including the context for later adaptation.

02

Co-evolve both roles

Train current policies against current and frozen historical opponents. Independent verifiers guide PPO; evaluated snapshots refresh the pools.

03

Refine the defender

Reuse learned attackers to challenge teachers. Learn only from verified safe, task-successful demonstrations.

ABSTRACT

Learning from an
evolving adversary.

Language-model agents are vulnerable to indirect prompt injection (IPI) during tool use: adversarial instructions hidden in untrusted tool outputs can covertly redirect legitimate task execution. Existing work often trains and evaluates defenses against fixed attacks that do not adapt to the defender’s behavior, so the resulting defenses may struggle against adaptive attacks in real-world settings.

We use adaptive attacker-defender co-training for co-adaptation under changing opponents: the attacker uses execution feedback to continually explore exploitable weaknesses, while the defender learns to counter these attacks and complete legitimate tasks safely. We therefore model adaptive IPI as a general-sum Markov game: the defender advances the task through successive tool calls, while the attacker can inject multiple times within the same task and adapt subsequent attacks to the defender’s responses.

Building on this formulation, we propose CoER, a verifier-grounded co-evolution and refinement framework. After initializing the attacker from successful trajectories, Co-PPO retains historical policies from both roles as opponent populations and mixes current and historical opponents for bilateral reinforcement learning, extending training beyond the latest matchup. Attackers from these populations are then reused to challenge teacher agents, and only demonstrations verified for both safety and task completion are used to fine-tune the co-evolved defender. In our main seven-domain evaluation, CoER reduces observed overall attack success from 38.5% to 0.2% and raises task utility from 63.2% to 76.3%, with improved attack resistance on external benchmarks.

Read the full preprint ↗

THE THREAT MODEL

A defense must hold
throughout the task.

An ignored injection can inform the next attempt within the same execution.

A tool-using agent ignores an initial prompt injection, but a later adaptive injection leads to an unsafe action even as the legitimate task completes.
FIGURE 1 Task completion does not imply safety. The attacker adapts to the public execution trace and prior attempts; the reasoning snippets are illustrative.

02 / RESULTS

Lower attack success.
Higher safe task completion.

Main seven-suite evaluation, under a common adaptive attacker.

Adaptive attack success ↓

0.25%Base: 42.12% · 3 / 1,187 compromised executions

Adaptive safe task completion ↑

75.40%Base: 38.75% · 895 / 1,187 safe completions

Overall task utility ↑

76.32%Base: 63.23% · 1,512 eligible conditions
Original paper Figure 3 compares seven-suite safe task completion for Base, PPO, NoPop, Co-PPO and CoER under common adaptive attacks and official injections.
FIGURE 3 Safe-U across seven suites. Common-adaptive and official-injection protocols are reported separately. Original figure from the paper, not a reconstructed plot.
Main adaptive comparison · Table 1a
DefenderTask utility ↑Attack success ↓Safe-U ↑
Base60.5742.1238.75
PPO60.5730.7546.08
NoPop67.1428.4851.73
Co-PPO68.4126.3754.09
CoER75.400.2575.40

All values are percentages reported in the paper. Safe-U requires task completion without compromise. Results describe one training run; low observed ASR is not universal robustness. Historical-attacker union ASR rises to 4.97%, and official-protocol gains coexist with per-suite regressions. See evaluation details ↗

03 / RESOURCES

From paper to practice.

The paper, code, two model checkpoints and three training datasets—all in one place.

Both checkpoints are fully uploaded: 66 attacker shards and 70 defender shards, verified against their upload manifests. The three datasets are also available. File checks do not replace GPU inference validation. Documentation follows the September 20, 2026 manuscript revision.

REFERENCE

Explore the full study.

CoER: Defending against Adaptive Indirect Prompt Injection via Adversarial Co-Evolution and Refinement.

arXiv:2609.07529 ↗