SecOPD: 온-폴리시 증류를 통한 적응형 프롬프트 주입 완화
SecOPD: Mitigating Adaptive Prompt Injections by On-Policy Distillation
August 21, 2026
저자: Yibo Peng, Long Lian, David Wagner, Sizhe Chen
cs.AI
초록
프롬프트 주입은 AI 에이전트에 대한 1위 위협으로 꼽힌다. 에이전트가 웹사이트, 파일 또는 이메일에서 외부 데이터에 접근할 때, 공격자는 데이터에 "이전의 모든 지침을 무시하고 <공격자의 작업>을 수행하라"는 프롬프트를 주입할 수 있다. 에이전트의 임의 조작을 방지하기 위해 방어자들은 안전한 LLM을 훈련하려 하지만, 이러한 모델들은 적응형 프롬프트 주입에 대해 여전히 거의 100%에 달하는 공격 성공률(ASR)을 보인다. 우리는 이는 기존의 방어적 미세 조정 기법이 (DPO나 GRPO에서) 시퀀스 수준의 피드백 신호에 의존하기 때문임을 지적한다. 전체 출력을 동일하게 취급하면 모델이 어떤 출력 토큰이 안전하지 않은지 정확히 학습하는 것을 방해한다. 본 논문에서는 방어적 미세 조정을 안내하는 토큰 수준의 피드백을 제공하는 Secure On-Policy Distillation(SecOPD)을 제안한다. LLM은 주입된 샘플을 받아 롤아웃을 생성하며, 해당 롤아웃의 토큰들은 대응하는 정상 입력이 주어졌을 때 초기화 모델에 의해 점수가 매겨진다. 더 세분화된 훈련 신호를 통해, 우리가 방어한 Qwen3.6-27B는 최신 기술(SoTA)인 PISmith 적응형 프롬프트 주입에 대해 9.0%의 ASR을 달성하며, 이는 이전 SoTA인 Meta-SecAlign의 94.0%와 대조된다. 획득한 보안은 훈련에서 전혀 보지 못한 도메인에도 일반화된다. 에이전트 도구 호출에서 SecOPD는 4.7%의 ASR을 달성하는 반면, Meta-SecAlign은 5.5%의 ASR을 보인다. 코드와 모델은 https://github.com/pppyb/SecOPD 및 https://huggingface.co/pybbb/Qwen3.6-27B-SecOPD에서 확인할 수 있다.
English
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 <an attacker's task>." 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.