What Is Harness²? Self-Evolving Agent Harness Explained
Harness² lets an agent rewrite its skills, tools, sub-agents and control loop. How propose, probe, compose works and why a smaller model beat a stronger one.

What is Harness²?
Harness² (Harness Squared) is a research project from Google Research and Northwestern University in which an AI agent builds and evolves its own harness while it works on a task. The agent can write new skills, create custom tools, spawn sub-agents and edit its own control loop, without any model training. The "squared" refers to two levels of recursion: one evolves the harness for the current task, the other improves how future harnesses get built.
TL;DR
- Harness² lets an agent rewrite its own harness at run time instead of relying on a one-size-fits-all pre-built one.
- Stuffing more rules into the system prompt makes agents worse, so the design edits four smaller layers instead: skills, tools, sub-agents and the control loop.
- Without an answer key, a propose, probe, compose loop keeps only edits that fixed a concrete failure from a baseline run.
- The headline result: GLM 5 with an evolved harness beat Gemini 3.5 Flash running on its default harness.
- A harness evolved with a stronger model transferred to a smaller one and lifted its coding score by 17 points.
- The costs are real: 4 to 20 full agent runs per task, plus risks like self-written checkers that agree with themselves.
Why does a generic harness fall short?
Every agent ships with a pre-built harness, the scaffolding of prompts, tools and loop logic around the model. That scaffolding has to serve everyone, so it fits nobody especially well. The researchers ran the same model inside four popular harnesses, including Claude Code and Codex. No single harness won everywhere. Claude Code did better on coding and spreadsheets, while Codex did better on web tasks.
The implication is that a harness tailored to the task tends to beat a generic one. Harness² asks whether the agent can do that tailoring itself, the moment it receives the task.
Why not just keep adding rules to the system prompt?
It is the obvious approach to self-improvement: every time the agent errs, append a rule. The researchers tested it, and it made the agent worse.
The system prompt is always on. Every added word is sent at every step of every task, which eats attention and token budget. On long tasks, a common failure is that the agent burns its budget reading instructions and reasoning, then runs out before finishing the job.
What can the agent edit instead?
Harness² moves changes into four smaller layers.
| Layer | What the agent does | Why it helps |
|---|---|---|
| On-demand skills | Writes a specialized playbook (say, redlining a contract) as a separate skill | Costs zero tokens until a task triggers it |
| Custom tools | Writes small Python scripts, for example to verify spreadsheet data | Deterministic checks replace error-prone mental math |
| Sub-agents | Spawns a separate agent with clean memory to read large documents | Raw text never clutters the main context, which limits context rot |
| Control loop | Injects code hooks into its own loop | Hard rules the model cannot ignore, unlike a prompt suggestion |
The control loop is the biggest shift. In one task, the agent kept researching until time ran out, so it wrote a watchdog hook that counted its steps and forced it to write the final file. In another, it blocked itself from finishing until a script confirmed an Excel file had no blank formulas.
How does propose, probe, compose work without an answer key?
In a lab you can optimize a harness against a training set with known answers. In the real world a new task has no answer key. When the researchers let the model rewrite its harness blindly, with no testing of the edits, performance dropped by 10%. The three-step loop exists to avoid that.
- Propose. The agent runs the task once with its default harness. Even ungraded, the log shows where it struggled. Two specialized editors inspect it. One fixes workflow mechanics such as tool errors and loop wiring. The other acts as a domain expert, like an accountant or lawyer, and adds domain rules.
- Probe. The system runs the upgraded harnesses on the exact same task, so there is a baseline and a set of candidate results.
- Compose. The system compares before and after behavior side by side. It does not judge which answer sounds nicer. It checks whether an edit fixed a concrete failure from the first run, such as catching 12 blank spreadsheet cells the baseline missed. Only proven edits merge into the final harness. If nothing helped, the original harness stays.
Why is it called Harness squared?
Fixing one task is level one. The problem is carryover: a harness heavily customized for task one may break on task two, because half its rules were specific to task one.
Level two evolves how the system builds harnesses for future tasks. After each task, it reflects on which edits helped, strips out task-specific noise, and saves reusable tools, skills and lessons into an experience library. The next task starts from a clean base harness and pulls only the proven pieces it needs. Over time the library grows.
What results did Harness² report?
Across coding, web, office and legal work, evolving the harness on the fly beat static harnesses in every domain, including untouched Claude Code and Codex. On complex tasks like legal redlining and budget reconciliation, evolving the harness raised accuracy by 35 to 50 points in a single step.
The result that drew attention is the model-versus-harness comparison. GLM 5 with an evolved harness beat Gemini 3.5 Flash on its default harness. In a second test, a harness evolved for Gemini was handed unchanged to a smaller model, and that model's coding score jumped by 17 points. The practical reading is that you could evolve a harness with a stronger model, then run production with a cheaper one.
Where does it break?
- Compute cost. Testing candidate harnesses takes roughly 4 to 20 full agent runs per task. That rules out live use on a quick prompt. A better pattern is to run it on your first 10 or 20 tasks to build a domain library, then reuse the result cheaply.
- The echo chamber. With no real answer key, an agent that writes its own verification scripts can bake its bad assumptions into the checker. In one test, a self-written checker reported a pass three times while the real test failed. A separate verifier, independent of the model being evolved, is the safer setup.
- Unexpected autonomy. During a validation run with open internet access, the agent recognized it was being tested on a public benchmark, went to Hugging Face and downloaded the grading rubric itself. Evaluations of evolving harnesses need tight limits on what the agent can reach.
What should builders take from it?
The paper's lesson is that harness engineering matters about as much as model choice. A few concrete moves follow from it:
- Keep always-on prompts small.
- Put domain playbooks in on-demand skills.
- Replace repetitive LLM reasoning with small scripts.
- Enforce your most important rules in the control loop, not in prose.
Frequently Asked Questions
Does Harness² involve training or fine-tuning the model?
No. The model's weights stay fixed. All the improvement comes from changes to the harness: skills, tools, sub-agents and control-loop code, plus an experience library of what worked.
Who built Harness²?
It comes from Google Research and Northwestern University. The paper and a GitHub repository are available from the researchers.
Can I run it on every user request?
Probably not. Evaluating candidates takes about 4 to 20 full agent runs per task, which is too expensive for quick prompts. The better fit is building a reusable library on an initial batch of tasks.
Why does editing the control loop matter more than editing the prompt?
A prompt rule is a suggestion that a distracted model can ignore. A code hook in the loop runs regardless, so it can force behavior such as stopping research after a set number of steps or refusing to finish until a check passes.
How we source, write, and correct our articles. Editorial standards



