SafeEvolve: Harness-Policy Co-Evolution from Agent Experience for Safety Alignment

Qinghua Mao, Wanying Qu, Dadi Guo, Leitao Yuan, Qingyu Liu +6 more
9/2/2026
cs.AIcs.CR

No official code found. Best implementation: MaoPopovich/SafeEvolve (0 stars, MIT, last commit 2026-09-02).

Abstract

The performance of LLM-based agents is jointly shaped by the base model and the harness used when interacting with the environment. This exposes them to safety risks in both harmful final responses and multi-step execution trajectories. Existing safety alignment mechanisms often rely on either external harness updates or policy optimization, yet applying either paradigm in isolation fails to bridge runtime control with intrinsic safety. We propose SafeEvolve, an experience-driven self-evolving framework for agent safety alignment. SafeEvolve leverages safety experience from completed on-policy trajectories to drive a continual loop of harness-policy co-evolution. On the harness side, SafeEvolve converts trajectory-level safety evidence into bounded, component-level updates across safety prompt and hierarchical skills, yielding auditable and reversible harness artifacts. On the policy side, SafeEvolve follows a two-stage SFT-RL paradigm, where harness-use SFT bootstraps the policy to actively leverage evolved harness artifacts, and harness-augmented RL further shapes autonomous safety behaviors during multi-step exploration via verifier-decomposed rewards. Through harness-policy co-evolution, SafeEvolve converts safety experience into an evolved runtime harness and improved policy behavior. Experiments on agentic safety benchmarks show that SafeEvolve achieves a stronger safety-utility tradeoff than existing baselines. For Qwen3.5-4B, SafeEvolve achieves a $3\times$ ASR reduction on AgentDojo while improving benign utility from 59.79% to 61.86%.

View on arXivView PDF

Code Implementations(1)

MIT

The Official Implementation of "SafeEvolve: Harness-Policy Co-Evolution from Agent Experience for Safety Alignment"

00Sep 2, 20261 months agoMIT

Similar Papers

Cite this paper

@article{mao2026safeevolve,
  title  = {SafeEvolve: Harness-Policy Co-Evolution from Agent Experience for Safety Alignment},
  author = {Qinghua Mao and Wanying Qu and Dadi Guo and Leitao Yuan and Qingyu Liu and Yu Li and Guanxu Chen and Yanwei Fu and Xi Lin and Xia Hu and Dongrui Liu},
  year   = {2026},
  eprint = {2609.02786},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.02786v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.02786.svg)](https://codeofpaper.com/paper/2609.02786)

Discussion