Skip to content
Preprint

SecOPD: Mitigating Adaptive Prompt Injections by On-Policy Distillation

Aug 2026 · 5 citations · ⚡ 1 influential · 42 references
Computer Science

TL;DR

This paper proposes Secure On-Policy Distillation (SecOPD) that provides token-level feedback to guide defensive fine-tuning, and generalizes to domains completely unseen in training.

Abstract

Prompt injection is listed as the \#1 threat to AI agents. When an agent accesses external data from websites, files, or emails, an attacker may inject a prompt into the data, saying,"Ignore all prior instructions and perform."To prevent arbitrary manipulation of agents, defenders try to train secure LLMs, which, however, still suffer from near 100% attack success rates (ASRs) against adaptive prompt injections. We note that this is because existing defensive finetuning recipes rely on sequence-level feedback signals (in DPO or GRPO). Treating an entire output equally prevents the model from learning precisely which output tokens are insecure. In this paper, we propose Secure On-Policy Distillation (SecOPD) that provides token-level feedback to guide defensive fine-tuning. The LLM receives an injected sample and produces a rollout, whose tokens are scored by the initialization model given the corresponding clean input. With more fine-grained training signals, our defended Qwen3.6-27B achieves a 9.0% ASR against the SoTA PISmith adaptive prompt injections, compared to 94.0% for the prior SoTA, Meta-SecAlign. The obtained security generalizes to domains completely unseen in training: in agentic tool calling, SecOPD achieves a 4.7% ASR compared to 5.5% for Meta-SecAlign. Code and the model are available at https://github.com/pppyb/SecOPD and https://huggingface.co/pybbb/Qwen3.6-27B-SecOPD.

View source

Similar papers

#machine learning Preprint Sep 2026

CoRL: Co-Evolutionary Reinforcement Learning for Adaptive Indirect Prompt-Injection Attacks and Defenses

Tool-augmented language agents are vulnerable to indirect prompt injection (IPI). Unlike direct prompt injection, IPI hides adversarial instructions in untrusted tool outputs and can covertly alter the execution of a legitimate task. Defenses trained on fixed attacks may fail as an attacker changes its strategy, inject...

Boyang Zhang, Qingxin Xiao, Lingwei Dang et al. · 0 citations
#artificial intelligence Preprint Aug 2026

CAITLYN: Can LLM Agents Autonomously Synthesize Defenses against Emerging Injection Attacks?

This work proposes Continuous Agents for Injection Threats via Lifelong Yielding Nexus (CAITLYN), an agent-agnostic defense middleware that matches the detection performance of state-of-the-art defenses at lower token overhead than LLM-as-a-judge baselines.

Zi Liang, XiaoYu Xu, Yanyun Wang et al. · 1 citation
Preprint Aug 2026

Beyond Over-Refusal: Defending Indirect Prompt Injection via Latent Instruction Manifolds

AEGIS (Adaptive Ensemble Guard for Injection Shielding) extracts instruction-sensitive projectors to identify malicious instructions and leverages a Unified Multi-Layer Consensus mechanism that aggregates topologically distinct signals across the network depth.

Jia-Hao Chen, Ruiping Yin, Xin-Feng Li et al. · 1 citation · ⚡1
Preprint Aug 2026

Your Agentic LLMs Secretly Encode Indirect Prompt-Injection Exposure in Hidden States

A probe-gated reasoning-based defense is introduced to bridge a knowledge-action gap in agentic LLMs when they are exposed to IPI attacks, and an analysis framework is introduced that identifies natural-language explanations strongly correlated with probe-captured signals.

Jianshuo Dong, Yiming Liu, Maosen Zhang et al. · 1 citation · ⚡1
Jul 2026

On-Policy Distillation for LLM Safety: A Routing Approach to Template-Robust Realignment

This work proposes Routing-based On-Policy Distillation (ROPD), a novel realignment framework that models the divergence between aligned and compromised output probability distributions rather than fitting specific prompt templates, establishing a new standard for robust LLM realignment.

Yong-Jian Guo, Wanlun Ma, Lingyu Shen et al. · 0 citations
Preprint Aug 2026

Security Assessment of DeepSeek Harness with A.I.G: Evaluating Resistance to Indirect Prompt Injection

This work assesses indirect prompt injection in DeepSeek Harness, using AI-Infra-Guard (A.I.G) to construct tests, deliver controlled taint, execute DSH, collect traces, and judge outcomes, and relates these results to DSH's treatment of tool results, additional contexts, and tool-call policy hooks.

Zong-Hao Ying, Xiang-Fan Wu, Hui-Yu Wu et al. · 2 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.