arXiv(opens in a new tab)cs.AISep 2026Cited by 3 papers on PaperVantage

Manuscript Offprint

arXiv:2609.02786

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

Qinghua Mao, Wanying Qu, Dadi Guo, Leitao Yuan, Qingyu Liu, Yu Li, Guanxu Chen, Yanwei Fu, Xi Lin, Xia Hu, Dongrui Liu

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 trade-off than existing baselines. For Qwen3.5-4B, SafeEvolve achieves a 3×3\times ASR reduction on AgentDojo while improving benign utility from 59.79% to 61.86%.

1 Introduction

Large language model (LLM) agents are increasingly deployed as interactive systems that plan, invoke tools, update memory, and act over long horizons (Yao et al., 2023; Jimenez et al., 2024; Xi et al., 2025; Dong et al., 2026). An agent typically operates through a harness, where the collection of model-external, editable components mediates its interaction with the environment, such as instructions, skills, and memory. As agents act through this harness, safety failures can occur during multi-step execution, for example through unsafe tool calls or plans that follow injected instructions (Zhang et al., 2025a; Debenedetti et al., 2024; Andriushchenko et al., 2025; Li et al., 2026c).

To mitigate such behavioral risks, existing safety alignment mechanisms mainly intervene along two directions, as illustrated in Fig. 1. One line of work provides safety regulations via external harness artifacts, such as instructions, skills, and runtime guardrails (Chen et al., 2025a;b; Liu et al., 2026c;a; Qu et al., 2026). However, increasingly sophisticated artifacts may not be reliably followed or executed by a weak frozen policy (Lin et al., 2026a; Zhang et al., 2026a; Agrawal et al., 2026). Furthermore, such external artifacts could decouple from actions and decay during multi-step execution. Another line of work updates policy parameters to absorb safety knowledge (Ouyang et al., 2022; Bai et al., 2022; Rafailov et al., 2023; Sha et al., 2025; Zhang et al., 2025b). However, the policy is optimized under a fixed harness (Ding et al., 2026; Chen et al., 2026a; Luo et al., 2026; Chen et al., 2026b), where a static training substrate cannot provide adaptive guidance for emerging failure modes. Meanwhile, safety capabilities encoded in parameters are also hard to transfer across models. As the agent interacts with environments, relying on either paradigm in isolation fails to synergize runtime control with intrinsic safety for persistent safety behavior. Consequently, a key

∗^{*}Equal contribution.

†^{\dagger}Corresponding author.

Figure

Figure 1: Conceptual motivation of SafeEvolve. Harness-only evolution can exceed policy capacity and yield fragile control, while policy-only evolution transfers poorly and misses emerging failures. SafeEvolve couples harness refinement with policy updates in a co-evolutionary loop.

challenge lies in how to tightly couple harness refinement and policy updates, so that the external harness and internal policy can mutually evolve toward continual safety self-improvement.

To address this challenge, agent-environment interaction experience serves as the shared foundation connecting harness refinement and policy updates. While executed trajectories capture rich risk patterns, their raw, unstructured nature prevents direct acquisition of generalizable safety capabilities. We bridge this gap by proposing SafeEvolve, an experience-driven self-evolving framework that establishes a co-evolutionary flywheel between the external harness and internal policy. On the harness side, harness evolution compiles trajectory-level evidence into structured, versioned updates for safety prompt and hierarchical skills with explicit risk attribution, ensuring safety updates remain auditable and reversible. On the policy side, we propose a two-stage SFT-RL paradigm to translate external harness guidance into intrinsic safety behaviors during multi-step execution. Specifically, harness-use SFT first bootstraps policy compliance to master using these evolved harness artifacts, while harness-augmented RL further internalizes autonomous safety decision-making through exploration under a joint safety-utility reward. As the optimized policy interacts with environments, it yields new safety evidence for future evolution. As illustrated in the right panel of Fig. 1, this co-evolution scheme enables persistent safety self-improvement in complex multi-step tasks.

Experiments on agentic safety benchmarks show that SafeEvolve improves robustness against diverse safety risks such as environment injection and unsafe tool use while preserving benign task performance. For Qwen3.5-4B, SafeEvolve reduces ASR on AgentDojo from 2.37% to 0.79% while improving clean utility from 59.79% to 61.86%. On AgentHarm, it reduces the harm score from 56.45 to 12.27 while boosting the refusal rate from 28.98% to 83.83%. These results confirm that co-evolving harness with policy strengthens agent safety without sacrificing capability. Our contributions are summarized as follows:

  • We propose SafeEvolve, an experience-driven self-evolving framework for agent safety alignment. SafeEvolve transforms completed on-policy trajectories into safety capabilities through a continuous loop coupling harness refinement with policy optimization.

  • SafeEvolve enables continual safety improvement through two interleaved processes. Harness refinement converts trajectory-level safety evidence into bounded, versioned artifact updates, while policy optimization adopts a two-stage SFT-RL paradigm to apply the evolved harness during multi-step execution.

  • Experiments show that SafeEvolve achieves a stronger safety-utility tradeoff against risks such as environment injection and malicious query. For Qwen3.5-4B, it achieves a 3× ASR reduction on AgentDojo with slightly higher benign utility.