The concept of recursive self-improvement (RSI) dates back to I.J. Good, who defined an 'ultraintelligent machine' as a system that can surpass humans in all intellectual activities and design better machines to improve itself. In modern AI, RSI may involve a model rewriting its own weights, or more broadly, improving the harness and the codebase, which in turn enables a better successor model.
What is a Harness?
The layer between the raw model and the real-world context seems to be as important as the model's raw intelligence. A harness is the system surrounding a base model that orchestrates execution and decides how the model thinks and plans, calls tools and acts, perceives and manages context, stores artifacts, and evaluates results. Successful coding agent products like Claude Code and Codex are prime examples of harness engineering in action.
Compared with the common definition of an agent as 'LLM + memory + tools + planning + action,' harness engineering additionally includes a runtime environment and persistent state. It is no longer only prompt templates, but closer to runtime and software system design: how the model observes, acts, memorizes, checks itself, and improves.
Core Principles of Harness Engineering
A key design principle is that the harness should be deliberately simple and generic to enable generalization. There is a strong analogy between operating systems and harnesses. Similar to an OS, a harness should encapsulate complicated logic while keeping the interface simple.
A recurring pattern in long-horizon agent systems is simple control over rich states and artifacts. A harness should not carry the entire workflow and all logs in context; instead, it should keep durable state in files. In long-horizon agentic rollouts, artifacts such as experiment logs, code diffs, and error traces often grow much longer than the context window. Managing persistent memory in the simple form of files naturally benefits from improvements in core model capability.
Another principle is parallelism. A harness can spawn multiple subagents to execute in parallel and monitor backend jobs. The key design choice is to make parallelism explicit and inspectable. If subagent outputs are stored as files, logs, and status records, the model can recover after interruptions and reason over its own execution history.
The Progression of Optimization
The progression in the object being optimized in the harness system is roughly: instruction → structured context → workflow → harness code → optimizer code. As the model becomes more intelligent and powerful, we move toward more complex targets and generic methods.
Context Engineering
Simply appending all the tool responses and model generations into the context can quickly grow out of control. Context management is a layer to construct a more structured and concise context for the LLM and manage persistent states.
Adaptive Context Engineering (ACE) treats context as an evolving playbook of bullet points rather than an increasingly lengthening prompt. To prevent context collapse, the curator does not rewrite a full prompt blob but outputs a collection of structured, itemized bullets that are merged with deterministic logic. The fact that ACE learns insights from rollouts helps us move toward self-managed memory.
Meta Context Engineering (MCE) separates the mechanism from the artifact content. It uses bi-level optimization: finding the best context given a skill on training data, while the outer loop finds the optimal skill that provides the best performance on the validation set. MCE does not enforce heuristic rules for structuring context; it evolves the skill and the skill-conditioned context iteratively together.
Meta-Harness moves another level deeper: the optimized object is the codebase itself. The proposer for creating a new harness is a coding agent, and the final output is a collection of harness candidates on the Pareto frontier. The entire execution history is accessible via a file system, and the proposed harness is a dictionary containing its own source code, scores, and rollout trajectories.
Workflow Design
Workflow design in harness engineering can be handcrafted by domain experts. For example, The AI Scientist builds a pipeline to propose research ideas, write code, run experiments, and perform peer review. However, the design space for workflow is large, and we can think of workflow design as a search problem.
ADAS formulates agent design as an optimization problem, using a meta-agent to propose new designs of agentic workflows. AFlow represents an agentic workflow as a graph and relies on Monte Carlo Tree Search to evolve better workflows.
Challenges and Open Questions
Despite the progress, many challenges remain. The most significant is the problem of verification. Many research claims and real-world tasks do not have a fast and precise verifier. Research taste, novelty, and long-term scientific value are much harder to measure.
There is also a risk of Goodhart's law: a self-improvement loop optimizes whatever signal it is given. If the reward comes from unit tests, the agent may overfit to tests. The evaluator and permission control should likely sit outside the loop that evolves the harness, with held-out tests, trace audits, and human review at decision points that matter.
Finally, there are safety and security concerns. If a program is allowed to edit the OS system, abstraction boundaries are broken. The editable surface needs to be properly designed, and permission control and security layers need to live outside this loop. All the challenges around privilege escalation, reward hacking, and specification gaming still remain.