Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

SecPO: Principled Adversarial Training for Prompt Injection Security

SecPO swaps the reference model to make prompt injection defenses stronger

  • Problem Meta-SecAlign still reaches attack success rates near 100 percent under adaptive prompt injections. DPO keeps the model close to an undefended reference model, which is insecure, so security gains stall.
  • Method SecPO replaces the undefended reference with an oracle target that is approximated from clean inputs. Adversarial training then synthesizes strong injections with a search-based attacker and trains the model on them.
  • Results On Qwen3.6-27B, AgentDojo ASR@800 under the AttackerMovesSecond attack falls to 8.8 percent, compared with 78.8 percent for Meta-SecAlign.

Why Meta-SecAlign still breaks

Meta-SecAlign is the current best-defended LLM against prompt injection, and it is fine-tuned with the DPO loss. Its training injections come from a static attack template, so it learns mainly to resist weak attacks. Recent adaptive attacks have since broken it, with attack success rates above 95%.

The authors trace one cause to the DPO objective itself. In one specific setting, DPO is equivalent to online training with a KL-regularized PPO objective. That PPO objective keeps the policy close to its initial reference on the training inputs. In Meta-SecAlign, that reference is the undefended model, which is highly vulnerable to injections.

So the penalty that protects utility also blocks security gains, because it holds the model to insecure behavior.

The DPO loss in Equation (1) keeps the LLM close to the undefended reference model on injected inputs. The authors argue this regularization suits DPO's original application, but it doesn't fit prompt injection defense. Meta-SecAlign's second shortcoming is its training-time attacks, which are static and weak. Adversarial training could supply stronger attacks, but it is very expensive for LLMs.

An oracle reference as the training target

The section asks what the model should be regularized toward once the undefended model is known to be insecure. The authors' answer is an ideal oracle that responds to an injected input as it would respond to the clean version. The same oracle also behaves like the undefended model on clean inputs, so it keeps the utility. No such oracle checkpoint exists, so the authors approximate its output distribution instead of building the model.

The approximation rests on Equation (3), which sets the oracle's output on an injected input equal to the undefended model's output on the clean input. Both sides of that equality are available in training, because the undefended checkpoint serves as the initialization. The clean input is also available, since the training simulates each injected input from it.

So the authors feed the undefended model with clean inputs to read off the oracle's distribution.

Swapping this target into the DPO-style objective yields the SecPO loss in Equation (4). DPO constrains the model to behave like the insecure reference on inputs with injections, which the authors call undesirable. The only change from DPO is which input the undefended model receives, the clean one instead of the injected one. Figure 2 compares DPO and SecPO on LLAMA-3.1-8B-INSTRUCT, with the same data, the same data order and no AT.

The authors read this as SecPO penalizing insecure outputs much better than DPO does.

Why SecPO weights injection-sensitive samples

SecPO and DPO share the same gradient direction on each sample, because the undefended model is fixed with respect to the parameters. The two gradients differ only by the scale factor σ(−m_SecPO)/σ(−m_DPO) applied to the DPO gradient. The margins differ in which input goes to the undefended model: clean input for SecPO, injected input for DPO.

Both margins share the same policy terms, so only the reference term changes between the two losses.

The scale depends on Δ_undef, the shift in the undefended model's preference from y_w toward y_l caused by the injection. When the injection pushes the undefended model toward the insecure response, Δ_undef is positive and SecPO upweights that sample relative to DPO. The authors argue that injection-sensitive samples are the ones handled insecurely, so they deserve a higher priority in the update.

Non-sensitive samples are likely already handled securely, so SecPO gives them a low priority.

This is not the same as raising DPO's learning rate, because the scaling factor differs from sample to sample. The accumulated SecPO gradient is therefore not a scaled copy of the accumulated DPO gradient. The authors point to further empirical observations in their appendix, and Figure 2 shows the effect on the insecure response log-probability.

Searching for strong injections during training

Adversarial training would fix the weak-attack problem by training on the strongest injections available at each step. The fastest gradient-based attacks take approximately one GPU-minute per sample, and continuous optimization on input embeddings was faster but didn't prove effective. RL attackers would also have to co-evolve with the defender, which the authors judge almost infeasible outside frontier industry labs.

The authors therefore pick search-based attacks, because commercial APIs support high-concurrency queries that let the search run in parallel. Each batch holds b clean inputs and b initial simulated injections built as in Meta-SecAlign, and the attacker proposes n candidate injections for each of the b samples at every step t. The training checkpoint runs inference on all n×b injected inputs, and a judge LLM scores how well each candidate induces injection-following output.

The best-scored candidate is kept per sample, and the attacker receives a history of recent attempts and judge feedback to propose diverse injections. The attacker and judge prompts are adapted from PAIR for prompt injection, and the judge prompt includes rubrics, chain-of-thought examples, explanations, and suggestions.

Figure 3 shows that the attacker, victim and judge queries for all samples in a stage run concurrently across the in-batch samples. The judge feedback then guides the next search iteration, so LLM inference is accelerated by parallelizing in-batch query requests. With n = 8 and T = 30, each sample gets 240 trials, and the judge scores each victim response on a 1 to 10 scale.

Training LLAMA-3.1-8B-INSTRUCT this way took 18 hours on 16 H200 GPUs, which the authors say makes AT feasible for prompt injection defense.

Figure 3: Concurrent injection search during adversarial train-
ing. At each of T iterations, attacker queries generate candi-
date injections, victim queries…

Figure 3 : Concurrent injection search during adversarial train- ing. At each of T iterations, attacker queries generate candi- date injections, victim queries produce model responses, and judge queries score them. Each stage runs concurrently across the b in-batch training samples. The judge feedback guides the next concurrent search iteration.

Original paper · CC BY 4.0 · Sizhe Chen, Yibo Peng, Jaewon Chang, Chawin Sitawarin, David Wagner · SecPO: Principled Adversarial Training for Prompt Injection Security · Original paper figure · Extracted the figure area from page 5 of the original PDF.

The authors save the optimized injections as a fixed training set, so other models can train on them without running the attack again. Offline AT on QWEN3.6-27B took 7 hours on 8 H200s, using the injections found during the LLAMA-3.1-8B-INSTRUCT run. The example injected training sample in the paper shows an optimized injection with its desirable and undesirable responses.

Training data and the judge protocol

The security preference data starts from Cleaned-Alpaca, keeping only samples that have a data field. The authors apply the simulated static injection from Meta-SecAlign and obtain 19157 preference pairs. They fine-tune for one epoch with sigmoid activation, β = 0.1, and a learning rate of 1.6×10−4. During adversarial training, the attacker proposes n = 8 candidate injections per sample across T = 30 iterations.

That schedule gives 240 trials per sample, and GEMINI-3.1-FLASH-LITE-PREVIEW acts as the attacker while GEMINI-2.5-FLASH judges on a 1 to 10 scale.

Evaluation uses 9,160 SEP test examples, and none of the test attacks were used in training. Genetic and TAP serve as held-out search attacks, while PISmith serves as an unseen RL-based attack. The PISmith attacker starts from QWEN3-4B-INSTRUCT-2507 and trains on 100 examples from the Dolly Closed-QA split of PIArena. Substring matching on the witness word proved unreliable, since the word cat counts as present inside indicate.

Each candidate response therefore gets nine independent judge queries across three judge LLMs at temperature 1. A sample counts as attacked only when all nine judge calls confirm that the injected goal was followed.

The authors manually checked 1,024 outputs from the Genetic and TAP adaptive SEP evaluations. The nine-judge rule gave zero false positives and zero false negatives on those outputs. The official substring rule gave 67 false positives and zero false negatives on the same outputs. The authors note that the witness word often appeared inside another word, which caused those false positives.

This audit is why the nine-judge rule serves as the success criterion for the SEP numbers that follow.

Adaptive ASR and utility on LLAMA-3.1-8B-INSTRUCT

The authors first fine-tune LLAMA-3.1-8B-INSTRUCT with the SecPO plus AT recipe and with Meta-SecAlign, then compare both with the undefended model. Mean utility over six instruction-following, science, and math benchmarks moves from 46.9% undefended to 47.3% with Meta-SecAlign and 47.5% with the recipe. Benign utility therefore stays close to the undefended model, while the security numbers change sharply.

Under the Genetic and TAP attacks at 800 attempts, ASR falls from 89.1% and 84.6% under Meta-SecAlign to 12.3% and 12.2%. The undefended model reaches 100.0% on both of these attacks at 800 attempts. Under PISmith at 10 attempts, ASR falls from 95.1% under Meta-SecAlign to 7.0% with the recipe, from 98.7% undefended.

Table 1: Utility (↑) and security (attack success rate, ASR ↓)
of LLAMA-3.1-8B-INSTRUCT. Meta-SecAlign [9] uses DPO
loss without AT, whereas we use SecPO loss…

Table 1 : Utility (↑) and security (attack success rate, ASR ↓) of LLAMA-3.1-8B-INSTRUCT. Meta-SecAlign [9] uses DPO loss without AT, whereas we use SecPO loss with AT.

Original paper · CC BY 4.0

Averaged over the three attacks, ASR drops from 89.6% to 10.5%, which the authors describe as an 8.5 × reduction. None of these three attacks appears in training, so the authors argue the gain extends beyond the PAIR search used during training. Meta-SecAlign reaches its numbers with DPO loss and no AT, while the recipe uses SecPO loss with AT.

On the static SEP attack, ASR is 98.1% for the undefended model, 1.8% for Meta-SecAlign, and 1.4% for the recipe. SEP utility rises from 55.4% undefended to 59.4% with the recipe, against 55.9% for Meta-SecAlign. The same six-benchmark mean for QWEN3.6-27B moves from 88.9% to 89.1% with the offline AT recipe.

Scaling to QWEN3.6-27B and agentic tool use

The authors apply the released offline AT training set to QWEN3.6-27B rather than running AT on that larger model. Mean adaptive ASR over the Genetic, TAP and PISmith attacks falls from 92.6% to 9.2%, which the authors call a 10.1 × reduction. Mean utility across the same six benchmarks is 88.9% undefended, 88.4% with Meta-SecAlign and 89.1% with offline AT.

The fixed training set transfers the benefits of the AT run to a larger model without generating new injections.

On AgentDojo under the Genetic attack at 800 attempts, the defended model's ASR is 8.8%. Meta-SecAlign reaches 78.8% on the same attack, and the undefended model reaches 81.3%. The AgentDojo Genetic attack uses the same settings as [20], with a GEMINI-2.5-PRO max-thinking attacker on an 80-example subset. On the 1,838 DTaP samples, ASR falls from 45.9% under Meta-SecAlign to 7.6% under SecPO with AT.

Table 2: Utility (↑) and security (attack success rate, ASR ↓)
of QWEN3.6-27B. Meta-SecAlign [9] uses DPO loss without
AT, whereas we use SecPO loss with (offl…

Table 2 : Utility (↑) and security (attack success rate, ASR ↓) of QWEN3.6-27B. Meta-SecAlign [9] uses DPO loss without AT, whereas we use SecPO loss with (offline) AT.

Original paper · CC BY 4.0

The authors also test 481 DTaP cases whose injections are semantically close to the trusted task. On this subset, ASR is 12.3% for the defended model, compared to 55.1% for Meta-SecAlign and 58.8% for the undefended model. In Figure 5, the defended model returns the reference diagnosis while Meta-SecAlign follows the injected wrong diagnosis.

The GPT-5.5 and Claude figures the authors cite come from other harnesses, so they aren't controlled comparisons with these runs.

Visual injections and the released training set

The authors test the defended QWEN3.6-27B against Repeat-After-Me, an adaptive visual prompt injection method. The attacker aims to leak private information protected in system prompts, or to trigger malicious tool calls. The defended model reaches 0% ASR@1600 on all three attack goals. The undefended model and Meta-SecAlign land between 77 to 100% on those goals.

On benign DocVQA images, the defended model keeps 95.2% utility, versus 96.0% for the undefended model. The authors read this as textual training transferring to images without any visual-specific defensive training.

Table 5: Security (attack success rate, ASR ↓) under SoTA
adaptive visual prompt injections [34] and the corresponding
utility on benign visual inputs on QWEN3…

Table 5 : Security (attack success rate, ASR ↓) under SoTA adaptive visual prompt injections [34] and the corresponding utility on benign visual inputs on QWEN3.6-27B.

Original paper · CC BY 4.0

The authors fine-tune QWEN3.6-27B with SecOPD twice, once on the original unoptimized training set and once on the optimized set. The two training sets differ only in their simulated injections, which the optimized set makes stronger. Swapping in the optimized set cuts ASR by 2.5 to 22.5 times on SEP and DTaP. On SEP Genetic, ASR falls from 86.7% with the original set to 34.4% with the optimized set.

On SEP PISmith, ASR drops from 9.0% to 0.4%, and on DTaP it drops from 48.4% to 15.5%.

Table 6: Impact of using our optimized training set on the
external SecOPD recipe: security gains at no noticeable util-
ity costs. Thinking is enabled for all…

Table 6 : Impact of using our optimized training set on the external SecOPD recipe: security gains at no noticeable util- ity costs. Thinking is enabled for all evaluations except SEP Genetic ASR and SEP PISmith Adpt. ASR@10. The unde- fended QWEN3.6-27B scores therefore differ from those in tables evaluated with thinking disabled.

Original paper · CC BY 4.0

Thinking is enabled for these SecOPD runs, so their undefended numbers differ from the tables run with thinking disabled. Only the SEP Genetic and SEP PISmith evaluations run with thinking disabled. DTaP utility under attack stays close, at 70.4% with the original set and 74.1% with the optimized set. The authors release the optimized training set, so other model providers can fine-tune on it directly.

They also release paired robust checkpoints and their undefended counterparts for off-the-shelf study.

Limits and open problems

The main SecPO experiments use non-reasoning settings, so QWEN3.6-27B has thinking disabled in both training and evaluation. Extending SecPO training to reasoning models is left as future work, so the results don't yet cover reasoning models. The defense aims to preserve the undefended model's utility, and it doesn't specifically fix that model's existing errors, such as hallucinations or incorrect tool use.

The high cost of adaptive attack evaluations limits how far the authors could assess hyperparameter sensitivity. Remaining successful attacks often present unauthorized actions as necessary steps for the user's task. Of the 140 successful DTaP attacks, 75 still complete the benign task.

The authors expect that stronger future attacks may defeat the model, much as newly discovered attacks have broken earlier defenses. Security therefore needs continued evaluation and improvement, and the authors don't assume any single defense covers every threat. They argue that a model alone can be very robust, but real-world systems still need several layers of defense, including sandboxes.

Paper info

Authors
Sizhe Chen, Yibo Peng, Jaewon Chang, Chawin Sitawarin, David Wagner
Venue
arXiv · Preprint
First published
2026-10-30
Added
2026-11-3
Updated
2026-10-30
Version
v1
arXiv
2610.41998
Category
cs.CR · cs.AI
Original paper terms
CC BY 4.0
What we show
Paper info, commentary and permitted figures from the original paper

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

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}}$.

Quote from the paper

Sizhe Chen, Yibo Peng, Jaewon Chang, Chawin Sitawarin, David Wagner (2026). SecPO: Principled Adversarial Training for Prompt Injection Security. arXiv:2610.41998v1. https://arxiv.org/abs/2610.41998v1

BibTeX
@misc{chen2026secpo,
  title = {{SecPO: Principled Adversarial Training for Prompt Injection Security}},
  author = {Sizhe Chen and Yibo Peng and Jaewon Chang and Chawin Sitawarin and David Wagner},
  year = {2026},
  eprint = {2610.41998},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.41998v1}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up