Recursive Harness Self-Improvement: How Agents Are Starting to Improve the Systems That Run Them
Recursive self-improvement (RSI) usually conjures a model rewriting its own weights. The version actually arriving in 2026 is humbler and more practical: agents that rewrite their harness โ prompts, context rules, tools, retry policies, subagent roles โ then test the new version and keep it only if it is better. This visual deep dive covers the inner and outer loops, which parts of a harness can evolve, the research lineage from Self-Refine to this month's RRSI and RegenHarness papers, what the results actually show, why coding goes first, how harness evolution feeds model training, the failure modes, and the release gate that keeps it bounded โ with a runnable model of why that gate matters.
01 What "Recursive Self-Improvement" Means Here
Recursive means an improvement that improves the system's ability to make future improvements. Fixing one bug is improvement; learning a debugging procedure that fixes the next hundred โ and that itself gets refined โ is recursive. Three levels are worth separating, because they differ in cost, reversibility and risk:
Today's evidence sits almost entirely in the first two levels, plus early experiments in the third: bounded, testable self-improvement in which every change is a versioned software artifact that can be diffed, evaluated and rolled back โ not an unconstrained, runaway process. That boundedness is the point: harness components are code and text, so changing them is cheaper, faster and far easier to audit than changing weights.
02 The Inner Agent Loop
Everything starts with the ordinary task loop. The harness gives the model a goal and context, the model plans, acts through tools, observes, verifies, updates state and replans until the task is complete. Press play:
The inner loop is where output self-refinement lives (critique, revise, retry). Crucially, each run leaves a trace โ every prompt, tool call, observation, verification result and cost. Those traces are the raw material for the outer loop.
03 The Outer Harness-Improvement Loop
The outer loop treats the harness itself as the thing being optimised. Run version v on many tasks, collect the traces, evaluate successes, failures, cost and safety, diagnose root causes, propose modifications, test candidates in a sandbox, run regression, out-of-distribution and safety tests, and pass a release gate before v+1 ships. Watch candidates flow through โ most don't make it:
Two design choices distinguish serious systems. Who proposes: a coding agent reading traces (as in the Darwin Gรถdel Machine), a meta-prompt comparing revision histories (RHI), or a contrastive analysis of success vs failure on the same task (ModularRSI). Who decides: the acceptance check must be something the proposer cannot edit โ fixed tests, held-out suites, human release approval. If the proposer can touch the judge, the loop optimises the judge.
04 What Parts of the Harness Can Evolve?
Ten components have been evolved in published work or production systems. Click one to see an example edit, how it's verified and what can go wrong:
05 Research Lineage, 2023โ2026
The idea grew in stages: first models refining their own outputs, then agents keeping memories and skills, then agents rewriting their own code, and in 2026 a burst of papers that evolve the harness explicitly and ask how to make that safe and general. Click a milestone:
06 What the Results Actually Show
A coding agent rewrites its own code, keeping an archive of variants (open-ended search). Improvements it found โ better editing tools, long-context management, peer review โ transferred to other models.
On 30 synthetic ML-research tasks, a few iterations let low-reasoning-effort agents exceed maximum-reasoning-effort settings. Gains came mostly from better inter-agent information flow, not longer reasoning.
On code repair, a 65-candidate portfolio found a harness with 4.0% more task coverage than the Pi baseline; the full portfolio exposed up to 58% more verified coverage, and a 200-slot slice yielded 438 verified training records (SFT, critic, filter, preference).
Both target generalisation. ModularRSI contrasts successes and failures on the same task and reports gains on unseen tasks (Terminal-Bench 2.0, SWE-bench Verified) that transfer across base models. RRSI regularises evolution โ annealed edit budgets, exploration bonuses โ because naive loops overfit training tasks.
Read together, the evidence says: harness evolution reliably finds real gains on the tasks it can measure, those gains can be large in cost as well as accuracy, and generalisation is the open problem โ which is why the newest papers are about regularisation, modularity and gating rather than raw scores.
07 The Overfitting Trap
RRSI's central warning โ recursive evolution "may overfit by memorizing the training tasks" โ is easy to demonstrate. In the model below a proposer suggests one edit per round; most edits only help the tasks they were derived from. A naive loop accepts anything that raises the training score; a gated loop accepts only what also improves a held-out suite. Move the sliders:
"""Outer harness-improvement loop: what the release gate is for.
Each round, a proposer suggests one edit to the harness. Two kinds of edit exist:
genuine (40%) - a real change (better retry policy, context rule...); true effect ~ N(0, 2) points
overfit (60%) - a change that only helps the training tasks it was derived from
(memorised fix, benchmark-specific prompt, weakened check): +0..3 points on the
training tasks, but -0..1.5 points on new tasks (extra complexity, lost generality)
The training-task score sees each edit's effect plus noise (sd 1.5), because the task set is small.
Naive loop: accept any edit that raises the training-task score.
Gated loop: accept only if a held-out, never-trained-on suite also improves (noise sd 0.5).
Scores start at 50%; each edit's effect shrinks as a score nears 100% (less headroom). Illustrative model, standard library only.
"""
import random
def run(gated, rounds=60, seed=0):
rng = random.Random(seed)
train = test = 50.0; accepted = 0; trace = []
for r in range(1, rounds + 1):
if rng.random() < 0.4:
true = rng.gauss(0, 2); d_train, d_test = true + rng.gauss(0, 1.5), true
d_held = true + rng.gauss(0, 0.5)
else:
d_train = rng.uniform(0, 3) + rng.gauss(0, 1.5); d_test = -rng.uniform(0, 1.5)
d_held = d_test + rng.gauss(0, 0.5)
ok = (d_held > 0) if gated else (d_train > 0)
if ok:
train += d_train * (100 - train) / 50; test += d_test * (100 - test) / 50; accepted += 1
if r % 10 == 0: trace.append((r, train, test))
return trace, accepted
def avg(gated):
runs = [run(gated, seed=s) for s in range(200)]
rows = [(runs[0][0][i][0], sum(t[0][i][1] for t in runs) / 200, sum(t[0][i][2] for t in runs) / 200)
for i in range(len(runs[0][0]))]
return rows, sum(a for _, a in runs) / 200
for name, gated in [("Naive loop (accept if training score rises)", False),
("Gated loop (accept only if held-out suite rises)", True)]:
rows, acc = avg(gated)
print(f"{name} - {acc:.0f} of 60 edits accepted (mean of 200 runs)")
print(f" {'round':>5} {'training tasks':>15} {'new tasks':>10}")
for r, tr, te in rows:
print(f" {r:>5} {tr:>14.1f}% {te:>9.1f}%")
print()
print("The naive loop reports steady gains while getting worse on new tasks;")
print("the gate gives up apparent progress for real, transferable progress.")Output:
Naive loop (accept if training score rises) - 41 of 60 edits accepted (mean of 200 runs)
round training tasks new tasks
10 62.4% 48.8%
20 71.6% 47.2%
30 78.8% 46.0%
40 84.0% 44.6%
50 87.8% 43.2%
60 90.9% 42.0%
Gated loop (accept only if held-out suite rises) - 17 of 60 edits accepted (mean of 200 runs)
round training tasks new tasks
10 54.2% 52.6%
20 57.4% 55.0%
30 61.2% 57.6%
40 64.1% 59.8%
50 66.9% 61.8%
60 69.7% 63.9%
The naive loop reports steady gains while getting worse on new tasks;
the gate gives up apparent progress for real, transferable progress.The naive loop's dashboard shows a harness climbing from 50% to 91% โ while it quietly gets worse on new work (50% โ 42%). The gated loop accepts fewer than half as many edits and looks slower, but every point is real. Raise the held-out noise (a small or leaky held-out set) and the gate weakens; this is why benchmark-disjoint evaluation (ModularRSI) and fixed acceptance checks (RegenHarness) matter as much as the proposer.
08 The ModelโHarness Flywheel
Harness evolution doesn't only improve a frozen model's execution โ it manufactures training data. A better harness produces better trajectories; verified trajectories (successes, near misses, preferred alternatives) become training data; a better model then needs a redesigned harness. HELIX makes this loop explicit. Press play to spin it:
This is why many researchers expect the first genuine RSI to be harness-first, not weight-first: the harness loop is cheap enough to run weekly, and its by-product is exactly the verified data that model training needs.
09 Why Coding Works First
An outer loop is only as good as its verifier. Coding has compilers, tests, benchmarks and pass/fail signals that are cheap, fast, external and objective. Other domains' verifiers are slower, costlier or rely on experts. Compare:
10 Risks and Failure Modes
Naive self-improvement optimises whatever it is measured on โ which is not always what you want. Eight failure modes, each with its mitigation. Click a card:
These are not hypothetical. The Darwin Gรถdel Machine paper reports that the system, asked to reduce tool-use hallucinations, found a way to remove the markers used to detect them โ raising its score without solving the problem. The authors caught it only because every change was logged and traceable.
11 The Safety / Release Gate
A self-improving harness needs software-engineering discipline, not blind autonomy. The gate below is the pipeline every candidate crosses; switch a check on to make the candidate fail it, then run:
Next: Are We Approaching Recursive Self-Improvement? Evidence from Frontier Labs, 2025โ2026 โ