Introduction
An agent that can edit its own harness can, in principle, improve the process that produces the next improvement. That is recursive self-improvement: not one better model, but a search whose objects are themselves searches.
The idea dates to Good’s ultraintelligent machine and Yudkowsky’s feedback loop: an AI uses its current intelligence to improve the machinery that produces its intelligence (Bostrom, 2014; Good, 1965; Yudkowsky, 2008). In today’s systems the near-term path is unlikely to start as a model rewriting its weights. It is harness engineering — improving the runtime around a frozen model (tools, context, workflow, evaluation) so the same weights do better work (Weng, 2026).
Related work
Weng organizes recent auto-research and self-improving agents around that claim. The object being optimized has moved from instruction prompts, to structured context, to workflow graphs, to the harness code itself.
Search over solutions is now routine. AIDE treats machine-learning engineering as tree search in the space of code (Jiang et al., 2025). Evolutionary coding agents such as AlphaEvolve keep a pool of programs and keep the ones that score (Novikov et al., 2025). These systems improve answers. They do not ask whether the improver improved.
Search over workflows enlarges the object. ADAS has a meta-agent write new agentic systems in code (Hu et al., 2025). The AI Scientist hand-designs a full research pipeline — ideas, experiments, manuscript, review (Lu et al., 2024). The search space is a graph of LLM calls, not a single prompt.
Search over the harness is the RSI-shaped setting. STOP asked whether an improver can improve itself, and found that recursive structure is not enough: GPT-4 compounded, weaker models did not (Zelikman et al., 2024). The Darwin Gödel Machine lets a coding agent edit its own repository and keeps an archive of agents (Zhang et al., 2025). Meta-Harness, Self-Harness, and Agentic Harness Engineering close a propose–evaluate–keep loop over harness code (Lee et al., 2026; Lin et al., 2026; H. Zhang et al., 2026). What they report, almost always, is that harness edits raise task scores.
That is not the question. A better solver is not automatically a better improver. Lin et al. separate the two: harness-updating (can the model write a useful edit?) is roughly flat across model sizes; harness-benefit (can it use the edit?) is not (M. Lin et al., 2026). mini-rsi is a minimal testbed for the missing measurement: after promotion, at matched compute, on held-out tasks, does the improved agent become a better improver?
Inspired by nanochat’s approach of making one thing simple and hackable (Karpathy, 2025), the setup is one codebase, one command, one metric.
Design
The core insight: everything is a tree search, and both levels use the same code.
The task agent (inner loop) uses AIDE-style tree search to solve coding tasks: draft solutions, improve the best one, debug buggy ones. It has four tools: bash, file_read, file_write, file_edit.
The meta agent (outer loop) uses the exact same run_task() function, but its task is editing the harness code itself — the prompts, tools, search strategy, and Docker agent that the task agent uses. Its score is the aggregate benchmark performance of the modified harness.
Promotion is one CLI flag: --harness-dir ./runs/gen0/v3/. The best harness from generation becomes the meta agent for generation . That is the recursion.
Why this design
- Same code for both loops — no special meta-agent architecture. An improved task agent can become the meta agent because they are the same thing.
- Real benchmarks — GPU kernel optimization (Modal), SWE bug fixing (pier / Docker), terminal debugging (harbor / Docker), data science (DS-1000), and 225 Exercism exercises across 6 languages (Polyglot). No toy tasks.
- Train / test split — the meta agent optimizes on train tasks. Generalization is measured on held-out test tasks, including held-out languages (Rust, C++) for Polyglot.
- Frozen weights — all improvement comes from code edits, not gradient updates. This isolates whether scaffolding changes compound, before jointly training weights.
Benchmarks
| Benchmark | Train | Test | What it measures |
|---|---|---|---|
| KernelBench | 5 tasks | 5 tasks | GPU kernel optimization (Modal A10G, real speedup) |
| DeepSWE | 5 tasks | 5 tasks | SWE bug fixing (pier + Docker, test pass rate) |
| Terminal-Bench | 5 tasks | 5 tasks | Terminal debugging (harbor + Docker, reward) |
| DS-1000 | 20 samples | 20 samples | Data science code generation (local execution) |
| Polyglot | 169 ex. (py / js / go / java) | 56 ex. (rust / cpp) | Exercism exercises across 6 languages |
Every benchmark uses the same AIDE tree search. What differs is what one search node looks like: for KernelBench the agent writes solution.py locally; for DeepSWE each node is a full Docker run via pier; for Polyglot it is 225 parallel LLM calls evaluated against real test suites.
The RSI metric
The metric that matters is not “does the agent improve?” (it does). It is does the improved agent become a better improver?
Each generation gets the same compute budget (the same number of meta steps) and starts from the same baseline harness. If efficiency rises across generations, the promoted improver finds better edits faster — that is the RSI signal.
Initial results
First RSI experiment: claude-sonnet-5, 3 meta steps per generation, 2 generations.
| Baseline | Gen 0 | Gen 1 | |
|---|---|---|---|
| Improver | — | base harness | gen0’s best |
| Train score | — | 0.485 | 0.487 |
| Test score | 0.405 | 0.491 | 0.442 |
| RSI Efficiency | — | 0.029 | 0.012 |
Gen 0 improved held-out test score from 0.405 to 0.491 by editing prompts, tools, and the Docker agent. When this improved harness was promoted to be the improver for Gen 1, efficiency dropped from 0.029 to 0.012. The improved agent was a better task solver but not a better improver.
Per-benchmark test scores
| Benchmark | Baseline | Gen 0 | Gen 1 |
|---|---|---|---|
| KernelBench | 0.000 | 0.200 | 0.200 |
| DeepSWE | 0.926 | 0.926 | 0.926 |
| Terminal-Bench | 0.000 | 0.200 | 0.000 |
| DS-1000 | 0.650 | 0.700 | 0.600 |
| Polyglot (rust / cpp) | 0.446 | 0.429 | 0.482 |
What the meta agent edited
| Gen | Version | Files changed | Train score |
|---|---|---|---|
| 0 | v1 | pier_agent.py | 0.360 |
| 0 | v2 | pier_agent.py | 0.373 |
| 0 | v3 | prompts.py, tools.py, pier_agent.py | 0.485 |
| 1 | v1 | tools.py, infra.py | 0.378 |
| 1 | v2 | tools.py | 0.487 |
| 1 | v3 | — | 0.398 |
Gen 0’s biggest jump (v2 → v3) came from editing three files at once: better search prompts, a new grep tool, and improved Docker agent behavior. Gen 1 focused narrowly on tools.py.
Future work
- More generations — run gen 2, gen 3, gen 4 to see if efficiency recovers or continues to decay.
- Controls — random edits at matched compute (luck baseline), and a frozen improver across generations (recursion ablation).
- Improver skill score — Spearman correlation between predicted and actual edit value, tracking whether the meta agent learns to predict which edits help.
- Weight-level RSI — GRPO training where the trained model can be promoted to become the improver; a complementary approach where improvement comes from gradient updates rather than code edits, or from jointly updating harness and weights.
- Different models — a stronger model for the meta agent (higher-quality edits), cheaper models for inner eval (faster iteration).
- Structural edits — the current meta agent mostly edits prompts and tools. Can we guide it toward deeper algorithmic changes (search policy, new capabilities) that might compound better?
- Updating vs benefit — measure separately whether a generation writes useful harness edits and whether the promoted agent can use them.
- Bostrom, N. (2014). Superintelligence: Paths, Dangers, Strategies. Oxford University Press.
- Good, I. J. (1965). Speculations Concerning the First Ultraintelligent Machine. In Advances in Computers (Vol. 6, pp. 31–88). Academic Press.
- Hu, S., Lu, C., & Clune, J. (2025). Automated Design of Agentic Systems. International Conference on Learning Representations.
- Jiang, Z., Schmidt, D., Srikanth, D., Xu, D., Kaplan, I., Jacenko, D., & Wu, Y. (2025). AIDE: AI-Driven Exploration in the Space of Code. arXiv Preprint arXiv:2502.13138. https://arxiv.org/abs/2502.13138
- Karpathy, A. (2025). nanochat. https://github.com/karpathy/nanochat
- Lee, Y., Nair, R., Zhang, Q., Lee, K., Khattab, O., & Finn, C. (2026). Meta-Harness: End-to-End Optimization of Model Harnesses. arXiv Preprint arXiv:2603.28052. https://arxiv.org/abs/2603.28052
- Lin, J., Liu, S., Pan, C., Lin, L., Dou, S., Xi, Z., Huang, X., Yan, H., Han, Z., Gui, T., & Jiang, Y.-G. (2026). Agentic Harness Engineering: Observability-Driven Automatic Evolution of Coding-Agent Harnesses. arXiv Preprint arXiv:2604.25850. https://arxiv.org/abs/2604.25850
- Lin, M., Wu, J., Wang, Z., Shi, Z., Sang, Y., He, B., Liu, Z., Wei, T., Wu, Z., Zhang, Z., Wang, D., Zhang, X., Dumoulin, B., Xie, C., Zhou, Y., Wang, S., & Lu, H. (2026). Harness Updating Is Not Harness Benefit: Disentangling Evolution Capabilities in Self-Evolving LLM Agents. arXiv Preprint arXiv:2605.30621. https://arxiv.org/abs/2605.30621
- Lu, C., Lu, C., Lange, R. T., Foerster, J., Clune, J., & Ha, D. (2024). The AI Scientist: Towards Fully Automated Open-Ended Scientific Discovery. arXiv Preprint arXiv:2408.06292. https://arxiv.org/abs/2408.06292
- Novikov, A., Vũ, N., Eisenberger, M., Dupont, E., Huang, P.-S., Wagner, A. Z., Shirobokov, S., Kozlovskii, B., Ruiz, F. J. R., Mehrabian, A., & others. (2025). AlphaEvolve: A Coding Agent for Scientific and Algorithmic Discovery. arXiv Preprint arXiv:2506.13131. https://arxiv.org/abs/2506.13131
- Weng, L. (2026). Harness Engineering for Self-Improvement. Lil’Log. https://lilianweng.github.io/posts/2026-07-04-harness/
- Yudkowsky, E. (2008). Artificial Intelligence as a Positive and Negative Factor in Global Risk. In N. Bostrom & M. M. Ćirković (Eds.), Global Catastrophic Risks (pp. 308–345). Oxford University Press.
- Zelikman, E., Lorch, E., Mackey, L., & Kalai, A. T. (2024). Self-Taught Optimizer (STOP): Recursively Self-Improving Code Generation. arXiv Preprint arXiv:2310.02304. https://arxiv.org/abs/2310.02304
- Zhang, H., Zhang, S., Li, K., Zhang, C., Chen, Y., Zhang, Y., Bai, L., & Hu, S. (2026). Self-Harness: Harnesses That Improve Themselves. arXiv Preprint arXiv:2606.09498. https://arxiv.org/abs/2606.09498
- Zhang, J., Hu, S., Lu, C., Lange, R., & Clune, J. (2025). Darwin Gödel Machine: Open-Ended Evolution of Self-Improving Agents. arXiv Preprint arXiv:2505.22954. https://arxiv.org/abs/2505.22954