← All papers  /  Oct 30, 2026
Reinforcement Learning · Agents

SecPO: Principled Adversarial Training for Prompt Injection Security

First page
SecPO: Principled Adversarial Training for Prompt Injection Security
The curator’s take

Sizhe Chen, Chawin Sitawarin, David Wagner and colleagues (UC Berkeley, with an Anthropic co-affiliation and work done at Google DeepMind) propose SecPO, a training loss and adversarial training pipeline for prompt injection defense that replaces the DPO objective used by Meta-SecAlign.

Ask this paper

Key points
01

Diagnosis. DPO anchors the defended model to the undefended reference model, which is itself insecure. The authors show that an injection-invariant, utility-preserving oracle reference can be approximated during training, and derive the SecPO loss from it.

02

Adversarial training. The pipeline synthesizes strong injections (best@240) and trains on them. This alone cuts attack success rates 1.5 to 14.5x against three adaptive attacks compared with Meta-SecAlign, and SecPO cuts them a further 2.4 to 4.6x compared with DPO.

03

Agentic result. The SecPO + AT Qwen3.6-27B model reaches 8.8% AgentDojo ASR@800 under the AttackerMovesSecond attack, against 78.8% for Meta-SecAlign.

04

Utility. No noticeable drop across nine benign benchmarks covering agentic tool calling, instruction following, science and math. Code, training data and model weights are released.

Abstract

Recognized as a top threat to AI agents, prompt injection allows instructions from untrusted data (email, documents, websites) to manipulate the agent's operation. The existing best-defended LLM, Meta-SecAlign, is trained with the DPO loss but still suffers from attack success rates (ASRs) approaching 100% under adaptive prompt injections. One reason is that DPO anchors the model around the undefended reference model, which is insecure. We show an idealized reference model---an injection-invariant, utility-preserving oracle---can nevertheless be approximated, as its output distribution in training is interestingly accessible. This new observation motivates a theoretically principled SecPO loss. Another Meta-SecAlign shortcoming is that it trains on weak simulated attacks. We implement an efficient adversarial training (AT) pipeline that synthesizes strong injected inputs (best@240), and train the model on them. Our AT reduces ASRs by 1.5-14.5$\times$ across three SoTA adaptive attacks, compared with Meta-SecAlign; the SecPO loss reduces them by a further 2.4-4.6$\times$ compared with using DPO loss. In agentic workflows, our SecPO + AT Qwen3.6-27B is much more secure than Meta-SecAlign: 8.8% vs. 78.8% AgentDojo ASR@800 under the AttackerMovesSecond attack. Moreover, our defended model shows no noticeable reduction in benign utility in nine benchmarks covering agentic tool calling, instruction following, science, and math. We release our $\href{//github.com/Sizhe-Chen/SecPO}{\text{code}}$, $\href{//huggingface.co/datasets/Sizhe-Chen/Qwen3.6-27B-Instruct-SecPO-trainset}{\text{training data}}$ (with optimized injections from AT), and $\href{//huggingface.co/Sizhe-Chen/Qwen3.6-27B-Instruct-SecPO}{\text{model}}$.

Every Monday
Get next week’s papers.
Subscribe on Substack