Harness Squared (the repository google-research/harness2) is an open-source research framework from Google Research that improves an AI agent by automatically rewriting the harness around a frozen language model instead of retraining the model. The harness means everything that surrounds the model and decides how it behaves: the system prompt, guardrails, memory, tool guidance, subagents, skills, scripts and plugins. The project writes its name with a superscript two and reads it "Harness squared." It is aimed at people who build and evaluate agents: researchers, and developers who already run a coding agent and suspect the scaffolding, not the model, is what is holding it back. The code is Apache 2.0 and the accompanying paper is dated October 2026.
What it does
The framework takes an agent that performs badly on unfamiliar tasks and edits its surrounding configuration until it performs better, leaving the model weights untouched. The pieces it rewrites are the ones a human would otherwise tweak by hand: the prompt, the guardrails, the memory, the notes that tell the model which tool to reach for, and the subagents, skills, scripts and plugins attached to it.
The paper reports gains on three professional benchmarks: up to 11.5 points on WorkBuddy-Bench, 4.5 points on JobBench, and 11.8 points on a legal benchmark. Those are the authors' own numbers from their own evaluation, published in "Recursive Agent Harnessing for an Open World" (arXiv 2610.14224). The material carries no independent measurement of them, and this channel does not run the tools it covers.
How it works
The core is a loop the authors call Propose, Probe, Compose. It proposes two candidate changes to the harness, probes them by running both on the same task so the comparison is fair, then composes the better behavior into a revised harness. On top of that sits a persistent "improvement library" that stores what was learned on one task so the next task starts from it rather than from scratch.
The comparison the project draws is with AutoML, except the search runs over the agent's surrounding tooling rather than over a model architecture. It does not replace the thing that actually executes tasks: it runs on top of existing agent executors, with OpenCode and Codex named in the README.
That design has a price in compute. The video notes up to twenty rollouts per task, because every proposal has to be run before it can be judged.
Getting started
Clone it from github.com/google-research/harness2. The repository does not list operating system, GPU, memory or VRAM requirements anywhere in the material here, so treat hardware as unspecified rather than assuming it runs on a laptop. What it does require is a language model to drive the agent and one of the supported executors (OpenCode or Codex) underneath.
On money: the framework itself is free and Apache-licensed, but the intelligence is not. Every propose-and-probe cycle spends model calls, and at up to twenty rollouts per task a single improvement run costs substantially more than one plain agent attempt. You pay either in API fees for a hosted model or in your own hardware for a local one. The material names no packaged installer, binary or release build, so expect to work from the repository and the paper.
Two disclaimers from the repository itself are worth reading before you depend on it: GitHub states it is "not an officially supported Google product," and it is ineligible for Google's vulnerability rewards program.
When to use it / when not
The main catch is the default security posture, and the project is candid about it in its own documentation: the executor's network access is not restricted, and the Codex sandbox is switched off by default. That means an agent improving itself on your machine can reach the network and the filesystem with no fence around it. Run it in a disposable container or virtual machine, on credentials you are willing to lose.
Use it instead of fine-tuning when the model you have is good enough and the failures look like bad instructions, missing tool guidance or forgotten context rather than missing knowledge. Don't use it if you need a hardened, supported product, if the compute budget cannot absorb twenty rollouts per task, or if you cannot isolate the machine it runs on.
Alternatives
The two levers most readers already reach for are the alternatives here. One is fine-tuning: more expensive, requires training infrastructure, and changes the model itself. The other is hand-writing a better prompt once, which is cheap but stops improving the moment you stop editing. Harness Squared sits between them by automating the second one and repeating it. For the smallest cases, just asking Claude or another assistant to rewrite your system prompt gets a comparable result for a fraction of the compute; this framework earns its cost when you have a benchmark to score against and many tasks to generalize over.
Take this repository seriously if you build agents for a living and have an evaluation harness already: it turns prompt and scaffolding engineering into something you can run as a search instead of doing by hand, and the authors publish numbers and a method rather than a demo. Treat it as research code, not infrastructure. It is unsupported by Google, it is expensive to run, and its defaults will give a self-editing agent an open network unless you close it yourself.