cs.AIOct 14, 2026

AgentSafeEvo: Adversarial Co-Evolution for LLM Agent Safety

Authors: Chenxu Wang, Xiaoyu Wen, Han Qi, Ziyuan Zhou, Cheng Jin, Chaochao Lu, Qiaosheng Zhang

Organizations: Shanghai Artificial Intelligence Laboratory · Fudan University · Shanghai Jiaotong University · Zhejiang University

Abstract

Large language model (LLM) agents accomplish complex tasks through multi-turn interactions with external tools. However, malicious content embedded in user queries, tool descriptions, or environment observations can manipulate their decisions and induce unsafe actions. Adversarial co-evolution has emerged as an effective approach to strengthening LLM safety, but existing work primarily focuses on language-level safety or indirect prompt injection in web tasks. In this paper, we introduce AgentSafeEvo, a co-evolutionary reinforcement learning framework for agent safety built on an attacker-defender game spanning diverse tasks and attack types. The attacker learns to construct adversarial agent tasks that expose weaknesses in the defender's tool use, while the defender learns to complete tasks safely under these attacks. We further introduce learnability-guided task weighting, which uses within-task defender-reward variability to adjust each task's contribution to attacker and defender updates. Extensive experiments on agent safety and general capability benchmarks demonstrate that our method improves adversarial robustness while maintaining general agent capabilities.

Figures & tables

Appendix figures & tables6 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. SafeCoEvo: Co-Evolving Safety Harnesses and Guards for LLM Agents at Test-Time

    Sep 29, 2026Yu Cheng, Yongkang Hu, Shuaijie Ma +12Continual Test-Time AdaptationLLM Agents

  2. Model-Agnostic Lifelong LLM Safety via Externalized Attack-Defense Co-Evolution

    May 13, 2026Xiaozhe Zhang, Chaozhuo Li, Hui Liu +4Continual Learning for LLMsAdversarial Attacks on LLMs

  3. SafeHarbor: Hierarchical Memory-Augmented Guardrail for LLM Agent Safety

    May 7, 2026Zhe Liu, Zonghao Ying, Wenxin Zhang +5LLM GuardrailsLLM Agent Security