Beyond Handcrafted Security: Towards Self-Evolving Defense for LLM Agents

Jiajun Ruan, Peiyang Li, Yukun Chen, Fengting Li, Chao Feng
8/13/2026
cs.CRcs.AI

No confident code implementation found for this paper.

Abstract

The expanding operational capabilities of large language model (LLM) agents introduce sophisticated security threats. Runtime defenses have emerged as an effective approach to mitigating these risks by integrating security mechanisms into the agent execution loop.

Show full abstract

However, existing runtime defenses rely heavily on manually designed interventions and lack a principled framework for their construction and maintenance. In this work, we first develop a harness-level formulation of runtime defense that systematically characterizes how harness mechanisms enable defense construction and provides a unified view of existing runtime defense interventions from a harness perspective. Building on this formulation, we propose HARD (Harness-based Autonomous Runtime Defense Evolution), a self-evolving runtime defense framework that automatically identifies appropriate intervention strategies and iteratively improves defense artifacts based on observed failure traces. HARD transforms runtime defense development from manual engineering into an autonomous evolution process, and extensive experiments demonstrate that it improves security performance over existing handcrafted defenses while preserving benign task utility. Our findings highlight autonomous defense evolution as a promising new paradigm for securing deployed LLM agents, enabling agents to identify defense weaknesses and continuously improve their protection mechanisms.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ruan2026beyond,
  title  = {Beyond Handcrafted Security: Towards Self-Evolving Defense for LLM Agents},
  author = {Jiajun Ruan and Peiyang Li and Yukun Chen and Fengting Li and Chao Feng},
  year   = {2026},
  eprint = {2608.12977},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.12977v1}
}

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/2608.12977.svg)](https://codeofpaper.com/paper/2608.12977)

Discussion