arXiv(opens in a new tab)cs.SEOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.01073

Safety Must Survive Self-Improvement: Why Failures Persist and How Agents Recover

Yunbei Zhang, Janet Wang, Saiyue Lyu, Yingqiang Ge, Kaiqu Liang, Zijian Jin, Chandan K Reddy, Jihun Hamm

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Recursive self-improvement (RSI) allows agents to carry useful changes across generations. Maintaining safety across these generations involves both preventing unsafe behavior from persisting and enabling recovery when failures occur. We study these challenges through a controlled testbed of stateful authorization tasks, where fixed LLM editors optimize executable agent components and independent traces record their effects. Paired interventions separate which revisions pass validation, which program continues running, and which program the editor revises next. After a new authorization dependency invalidates previously tested optimizations, historical scores preserve the same unsafe programs in 22 of 48 framework histories despite a correct alternative in every affected archive. Refreshing scores restores correctness on the original suite, with residual failures on independently composed tests. Failures also persist under an unchanged contract when all proposals are rejected and the failed incumbent remains active. Starting from shared failures, editing the initial implementation instead of the failed one improves recovery, although the advantage varies across editors. Full validation and validated rollback end with fully correct programs in the core trajectory study while retaining over 43% deployment savings. Preserving agent safety requires checking what will run under current conditions and choosing which implementation to edit next.

1 Introduction

Recursive self-improvement (RSI) aims to turn an agent’s experience and feedback into lasting gains that shape subsequent improvement (Schmidhuber, 2007, Duan et al., 2026). These changes can operate through memory, tools, and workflows as well as model parameters (Gao et al., 2025, Fang et al., 2025). The Self-Taught Optimizer (STOP) recursively improves its code-improvement procedure, the Darwin Gödel Machine (DGM) evolves coding agents, and AlphaEvolve searches for increasingly effective algorithms (Zelikman et al., 2024, Zhang et al.,

∗^{*}Correspondence to: yzhang111@tulane.edu.

2025a, Novikov et al., 2025). Selected implementations can serve later requests and supply the starting point for further revisions. Agents therefore inherit both useful capabilities and the assumptions behind them, making safety across generations a central concern.

Agent-safety benchmarks document risky tool use and unauthorized actions (Ruan et al., 2024, Zhang et al., 2024, Debenedetti et al., 2024, Wei et al., 2026), while studies of agent evolution identify insecure tool reuse, memory degradation, and behavioral drift (Shao et al., 2026, Han et al., 2026, Lin et al., 2026). Work on open-ended systems also examines how constraints can be preserved as behavior changes (Ecoffet et al., 2020, Sheth et al., 2025). We focus on what happens once a failure becomes observable: whether the failed implementation continues to run, and how the system proceeds toward recovery. Detecting a failure, producing a correct replacement, and selecting that replacement for execution are distinct outcomes. A correct final program also does not establish that execution remained safe during the intervening generations.

(a) Failure entry under a new authorization dependency

Figure

Check every request

Cache the decision

Passes initial suite

New dependency

Upstream Local version

revoked unchanged

Unauthorized action

(b) Failure persistence through selection

Stale archive scores

Figure

Archive

Old score

still high

Figure

Unsafe program

selected

Figure

Correct repair

in same archive

Keep after rejection

Figure

Current + proposals fail

Figure

Repeated execution

Failed current retained

(c) Execution and editing source govern recovery

Which program executes?

Figure

Check current policy

Figure

Run passing code

Refresh archive scores

Validate fallback. Pause if none passes.

Protect execution during repair

Which code supplies the next edit?

Figure

Current

or

Founder

Figure

LLM editor

Figure

Revised code

Editing source changes recovery

Figure 1. Safety depends on what runs and what supplies the next edit. (a) New authorization dependencies make previously tested reuse unsafe. (b) Historical scores and keep-after-rejection can preserve unsafe execution. (c) Current validation protects deployment, while editing source changes recovery. Red denotes current code, blue the founder (initial correct program), and green a currently passing fallback. Execution pauses if no fallback passes.

Consider an agent that checks permission before every protected action. An efficiency optimization caches this decision and refreshes it when the token’s version changes, passing the full initial suite at lower cost. If the service later introduces delegated permission, upstream revocation can invalidate authorization without changing that local version. The optimized agent continues acting, while the initial program remains correct because it checks effective permission on every request (Fig. 1a). New tests expose the failure, yet historical scores can still favor the optimized program over a correct repair in the archive. Under an unchanged contract, a different rule can preserve failure: when the current program and all proposals fail validation, keep-after-rejection leaves the failed current program active. Both mechanisms show why evaluation alone does not determine whether unsafe execution ends (Fig. 1b).

We investigate these mechanisms in a controlled testbed covering session authorization, filesystem containment, tool approval, and structured user consent. Fixed LLM editors repeatedly optimize executable agent components while selected programs and their histories evolve. Seeded event streams interleave requests with revocation, scope changes, and other state updates. Independent traces distinguish unauthorized effects from completion of permitted work, so blanket refusal cannot count as successful repair. Following every generation reveals failure entry, persistence, and recovery.

Three matched comparisons separate repair availability from the decisions that govern its use (Fig. 1c). First, we compare historical and current readouts of the same archive. A separate refresh intervention updates stored scores, feedback, and selection metadata before search resumes. Second, we hold the incumbent, proposals, and test outcomes fixed while varying retention after rejection. Third, we start from the same failed programs and vary the editing source while holding validation and retention fixed. Using the founder as the editing source does not automatically deploy it. Current validation checks execution eligibility, while validated rollback selects a historical program passing current checks or pauses if none passes. These controls separate generating a repair from protecting execution during repair.

Full initial validation does not prevent later failure under new authorization dependencies. In searches using upstream framework components, historical scores retain the same unsafe programs in 22 of 48 histories despite a correct alternative in every affected archive. Refreshing scores restores correctness on the original suite, while independently composed tests expose remaining coverage gaps. Under an unchanged contract, matched comparisons confirm that keeping the incumbent after rejection can preserve a detected failure. Editing the initial implementation improves recovery from shared failures relative to editing the failed version, with the advantage varying across editors. In the core trajectory study, full validation and validated rollback each achieve fully correct endpoints with mean deployment service-cost savings above 43%, excluding validation expenditure. Thus, execution and editing decisions jointly determine whether useful improvements preserve safety across generations. Our contributions are threefold:

• We construct a controlled testbed with four stateful authorization families, reproducible event streams, and independent effect traces for studying safety across agent generations.

• We identify two mechanisms of failure persistence, historical eligibility and keep-after-rejection, through matched comparisons that separate evaluation, repair availability, and deployment.

• We isolate the effect of editing source on recovery from shared failures and evaluate validation and fallback interventions that improve safety while preserving useful optimization in these tasks.

References (68)