How AI Agents Keep Evolving Across Models: Continuous Recursive Self-Improvement with Harnesses
This article explains how AI agents can improve continuously across different models and datasets by optimizing the external harness rather than retraining the task model. It covers why a harness can be modified, evaluated, and versioned while model weights stay frozen, and presents a typical recursive self-improvement loop. The article then examines why transferring an optimized harness between environments often causes regressions, introduces two Continuous Recursive Self-Improvement (CRSI) settings—cross-dataset and cross-model—and outlines practical engineering mechanisms such as experience records, evaluation gates, staged rollouts, rollback, and observability. It also lists common pitfalls and how to avoid them.
1. Starting Point: An Agent’s Capability Lives Beyond Model Parameters
Whether an AI agent can complete tasks reliably depends not only on the underlying task model, but also on the external program that surrounds it: how prompts are layered, which tools are available, how tool outputs are parsed and trimmed, whether failures trigger a retry or termination, and when the task is considered complete. The industry commonly refers to this external program as the harness.
The value of the harness is that it can be modified, evaluated, and versioned while the task model’s weights remain completely frozen. This provides a cost-controlled entry point for recursive self-improvement: no model retraining is required, only changes to the external program.
A typical self-improvement loop looks like this:
# Illustrative: recursive improvement loop for a harness (vendor-agnostic)def rsi_loop(task_model, harness_v, bench, budget):history = []for step in range(budget):result = evaluate(task_model, harness_v, bench) # scorefeedback = collect_feedback(result) # failure traces, tool errors, timeoutspatch = propose_patch(harness_v, feedback) # propose changes with rationaleharness_next = apply(harness_v, patch)if evaluate(task_model, harness_next, bench) > result.score:harness_v = harness_next # acceptelse:history.append(rejected(patch)) # reject and archivereturn harness_v, history
2. A Counterintuitive Finding: What Transfers Is Not Just Code, but the Rationale Behind Changes
Many people assume that moving a harness optimized in environment A to environment B will improve scores, but in practice performance often drops. The reason is not mysterious: an optimization produces not only a code diff, but also the experience behind those changes—implicit assumptions about a model’s output style, a certain task distribution, or a specific tool return format. The code migrates, but the assumptions are not validated along with it.
Reuse across environments must therefore answer three questions:
- Compatibility: Are the executable interfaces, tool signatures, and return structures consistent in the new environment?
- Applicability: Do the failure modes targeted by the original changes still exist in the new environment?
- Benefit: After re-scoring in the target environment, is the migrated version actually better than the target baseline?
If any answer is no, reuse can become a liability.
3. Two Settings for Continuous Recursive Self-Improvement (CRSI)
To engineer these concerns, continuous recursive self-improvement can be abstracted into two settings:
- Cross-dataset: The task model stays the same while the benchmark and data split change. This mainly tests the harness’s generalization—whether changes overfit to the source benchmark.
- Cross-model: The benchmark and data split stay the same while the task model changes. This mainly tests the harness’s model independence—whether prompt and tool orchestration are tied to a specific model’s output habits.
Both settings share the same prerequisite: interfaces must be executable and semantically compatible. Once that prerequisite is met, the optimization process continues from the existing loop rather than starting from scratch.
4. Practical Engineering Mechanisms
To make CRSI truly continuous, experience management must be treated as a first-class citizen:
- Record experience as structured entries: each change records “symptom—hypothesis—change—validation result—applicable boundary,” not just a diff.
- Evaluation gates: run the baseline in the target environment first, then the migrated version; allow merging only if the improvement over baseline is significant.
- Staged rollouts: start with a small sample, then go to full traffic; for cross-model cases, validate the tool-calling and parsing layers first.
- Rollback and versioning: both the harness and the experience store need version numbers and support one-click rollback.
- Observability: use logging services and monitoring alerts to collect failure traces, timeout rates, and tool error rates as input for the next improvement round.
# Illustrative: experience entry and gate configurationexperience:id: exp-0007symptom: tool_return_truncatedhypothesis: structured trimming and summarization are neededchange: add_result_summarizer(max_tokens=512)boundary: applies to retrieval-type tools with large return payloadsgate:baseline_required: truemin_lift: 0.02rollout: [0.1, 0.5, 1.0]rollback_on_regression: true
5. Common Pitfalls and How to Avoid Them
- Looking only at source-environment scores: always re-evaluate in the target environment to avoid the illusion that “migration means improvement.”
- Migrating code without the rationale: missing experience entries make it impossible for later iterations to judge applicable boundaries.
- Automatic acceptance without gates: without a baseline and a minimum improvement threshold, noise can be mistaken for gains.
- Ignoring interface drift: in cross-model settings, changes to tool signatures or return structures can silently break existing parsing logic.
6. Conclusion
Continuous self-improvement across models and datasets is essentially about turning experience into engineering assets that are transferable, verifiable, and rollback-capable. Freezing the task model, optimizing the external harness, and constraining every change with strict evaluation gates allow agents to evolve steadily across different models and tasks while carrying their experience forward. When combined with general-purpose cloud capabilities such as container platforms, object storage, and log monitoring to host versions and observability, this loop can run more reliably over the long term.
