AutoAgent: The Repo That Lets AI Rewrite Its Own Agent Harness

A meta-agent uses benchmark scores, a fixed adapter boundary, and a simplicity rule to evolve prompts, tools, and orchestration without human micromanagement.

8 min read • View on GitHub • More from kevinrgu

A wide workshop scene shows a human hand placing a sheet labeled program.md on one side of a drafting table while a mechanical arm rewrites a compact agent.py booklet on the other. A narrow fixed gate sits between them, and a score display in the background rises and falls as changes are kept or discarded. The image explains the repo's inversion of authorship and its score-driven loop.
Human strategy on one side, self-edited harness on the other. AutoAgent makes benchmark score the final judge.

The core idea is the same: you're not touching the harness Python files like you normally would as an engineer. Instead, you program `program.md`, the Markdown file that provides context to the meta-agent and defines the agent-engineering loop.

Kevin Gu, Creator · kevinrgu/autoagent
Key Takeaways

The Human Writes the Rules, the Agent Writes the Code

AutoAgent is not trying to be another friendly wrapper around an LLM. It flips the usual workflow: the human writes program.md, and the system rewrites the agent harness until the benchmark score improves. That makes the repo less like an app and more like a machine for improving apps.

Kevin Gu describes it plainly in the README: "Like autoresearch but for agent engineering." That is the right mental model. The interesting object is not the worker agent alone. It is the process that keeps changing the worker agent.

GitHub avatar portrait of Kevin Gu, the creator of AutoAgent. This portrait identifies the person behind the repository and anchors the article's attribution to a verified reference image.

Inside the Hill-Climbing Loop

The loop is simple on purpose. Diagnose failures, edit agent.py, run Harbor tasks, compare scores, then keep or discard the change. There is no romantic notion of creativity here. A candidate survives because it does better, or because it does just as well with less complexity.

The loop is the point. AutoAgent reads failure, edits the harness, scores the result, and keeps only changes that survive the gate.

A close-up of a sealed harness chamber divided by a rigid metal seam. On the editable side, modular components are being rearranged, while the fixed side keeps a Harbor cable and reporting path untouched. Results move through a narrow channel into results.tsv, explaining how the meta-agent can change the harness without breaking the evaluation boundary.
The boundary is the trick. Editable code can move, but the reporting path stays frozen.

Why the Fixed Adapter Boundary Matters

The architecture split in agent.py is the heart of the repo. One section is editable. The other section is fixed. That gives the meta-agent room to improve prompts, tools, and orchestration without mutating the plumbing that speaks to Harbor and records trajectories.

# Editable section
SYSTEM_PROMPT = ...

def create_tools(environment):
    ...

# Fixed adapter boundary

def to_atif(trajectory):
    ...

# Harbor integration remains stable below this line

That split matters because it makes the system legible. The agent can search a large space, but the evaluation surface stays stable. In practice, that is what keeps the optimization loop from becoming a pile of one-off hacks.

The Simplicity Rule Is the Real Secret

AutoAgent does not treat equal performance as a tie. If a change gets the same score with a simpler harness, it wins. That is the guardrail that keeps the meta-agent from growing bloated in the name of progress.

PolicyWhat winsWhat gets rejected
Higher scoreAny harness edit that increases passed tasksA simpler change that does not improve results
Equal score with simplicityA shorter or cleaner harnessA more complex rewrite that adds no value
Same score, more machineryNothingPrompt bloat disguised as improvement

This is not a footnote. It is the quality function. Without it, the system could keep adding tools, layers, and indirection while looking busy and getting harder to debug.

AutoAgent vs. the Usual Agent Stack

Most agent stacks help you assemble behavior by hand. AutoAgent changes the job description. It optimizes the harness itself, not just the prompt, and it uses benchmark feedback as the only arbiter that matters.

ApproachWho edits whatWhat is optimizedHow success is measuredUnattended improvement
Manual prompt engineeringA human edits prompts and toolsThe prompt or workflowSubjective or ad hoc testsNo
Standard agent frameworksA human assembles the stackThe application behaviorTask success during developmentOnly if the human keeps tuning
AutoAgentThe meta-agent edits the harness within a fixed boundaryThe harness and its orchestrationBenchmark score in Harbor tasksYes

The difference is subtle but important. AutoAgent is not simply a better agent. It is a better process for producing agents.

What Harbor and ATIF Unlock

The repo leans on Harbor and ATIF to make failure inspectable. That gives the meta-agent structured evidence, not just a vague feeling that something went wrong. Once failures are serialized well, the system can make informed edits instead of guessing in the dark.

That is what turns optimization from folklore into procedure. A benchmark runner, a trajectory format, and a stable adapter boundary together create a loop where changes can be compared cleanly and repeated reliably.

Why This Is More Than a Benchmark Trick

AutoAgent points at a different division of labor. Humans define the objective, the environment, and the constraints. The model iterates on the implementation. If that pattern holds up, the unit of work changes from writing agents to designing the systems that evolve them.

That is the bigger story here. AutoAgent is not just a clever repo. It is a sketch of a new development primitive, where the codebase is intentionally editable by AI and intentionally fenced where stability matters most.