Google Research Published Harness², an Open Source Framework That Improves an AI Agent by Rewriting Its Harness (Prompts, Tools, Memory, Skills, and Orchestration) Without Touching the Model Weights. The Paper Was Uploaded to arXiv on October 9, 2026, and the Code Is Available Under Apache 2.0 License.
The premise is familiar to those who read yoDEV: an agent’s capability depends as much on the system surrounding the model as on the model itself. Harness² goes one step further. Instead of a person manually tweaking that system, the agent proposes changes to its own harness, tests them, and keeps what works.
What Parts of an AI Agent Can Be Optimized Without Touching the Model?
The harness is everything that surrounds the model and allows it to act as an agent, and Harness² exposes eight editable components. The authors call the process of optimizing that system harnessing. We covered the discipline itself in Harness Engineering: The New Job for Engineers; Harness² is an attempt to automate it.
The eight components are:
- system prompt
- guardrails
- memory
- tool guidance
- subagents
- skills
- scripts
- plugins
Together they control how context is built, how the tool interface looks, how work is delegated, and how the agent behaves within the tool loop.
If you work with Claude Code, Codex, or OpenCode, that list will look familiar. It corresponds almost one-to-one with your CLAUDE.md or AGENTS.md, your skills folder, your subagent definitions, and your hooks. Harness² treats those files as something to be optimized, not as something you write once and forget.
How Does an AI Agent Improve Its Own Harness?
Harness² improves the harness with two levels of recursion, and in both the model remains fixed.
Task-level recursion refines the harness for the task at hand. It does this with a three-step process that the authors call Propose–Probe–Compose:
- Propose. An editor suggests changes to the harness. Some are general (invariant) and others are domain-specific.
- Probe. Candidate harnesses run on the same task.
- Compose. A composer assembles a refined harness from the contrasts in behavior between those executions.
The key detail is that this works without ground truth feedback. The agent doesn’t need to know the correct answer. It learns from how different versions of the harness behave differently on the same problem.
Harnessing-level recursion operates across tasks. After each task, an “experience reflector” saves the adopted harness and lessons backed by evidence. All of that goes into a persistent improvement harness, which guides refinement on the next task, even if it’s never been seen before. That’s the “open world” part of the title: the scenario where tasks appear that nobody anticipated when designing the harness.
Parallel or Sequential Recursion: Which Is Better?
It depends on whether you want to explore more options or refine more deeply. Harness² scales task-level recursion in two ways, both controlled by --k, the recursion budget:
--mode paralleltestsKgeneral candidate harnesses andKdomain-specific ones, then producesKcompositions from the shared evidence. Explores wider.--mode sequentialcarries the refined harness and its accumulated evidence throughKsuccessive Propose–Probe–Compose steps. Refines deeper.
--k 1 is a single step. According to the authors, a single step already helps, and a larger budget helps even more.
How Much Does the Agent Improve According to Benchmarks?
According to the authors themselves, a single step of Harness² improved two models versus their base harnesses:
- GLM-5 and Gemini 3.5 Flash were tested on four model–harness configurations.
- Improvements reached 11.5 points on WorkBuddy-Bench.
- Reached 4.5 points on JobBench.
- Reached 11.8 percentage points on LAB partial pass rate.
There are two important caveats.
First, these are figures from the authors themselves in a preprint. They haven’t been independently reproduced yet.
Second, the benchmarks measure professional work, not programming. JobBench covers general professional tasks and LAB covers legal work. WorkBuddy-Bench covers office, web, and code, and only its code subset resembles what most of us do all day. The results show the method works on open-ended knowledge work. They don’t yet say how much it improves a coding agent on your repository.
How to Install Harness² and Test the Demo Without API Keys?
You can run the demo locally in minutes without credentials for any model. The README asks for Linux, Python 3.12, and uv. From the repository root:
uv venv --python 3.12 .venv
source .venv/bin/activate
uv pip install -e '.[render]'
harness2-demo --output runs/demo --k 2
The demo runs both recursion modes with deterministic editors and real Python executions. It’s the fastest way to see the Propose–Probe–Compose cycle and inspect what an adopted harness looks like on disk.
What Do You Need to Use It With Vertex AI?
Runs with real models require more setup. You need:
- Node.js 20 or higher
- Google Cloud CLI
- the dependencies of the benchmark you choose: LAB needs Pandoc and Poppler, and WorkBuddy-Bench needs Docker
Models are configured with a .env file pointing to a Vertex AI project:
cp .env.example .env
# Edit .env with your Vertex AI project and model IDs.
gcloud auth application-default login
The installation guide documents four variables:
HARNESS2_SOLVER_MODEL, the executor modelHARNESS2_IMPROVER_MODEL, which defaults to the same as the executorHARNESS2_JUDGE_MODELHARNESS2_RUNS_DIR
The included configuration uses Gemini on Vertex as executor and judge. As improver it accepts Claude on Vertex or Gemini.
The README example runs a single LAB task end to end:
harness2-setup lab
harness2-check --bench lab
harness2 --bench lab --k 1 --mode parallel \
--only-domains antitrust-competition --max-tasks 1
harness2-judge --bench lab --k 1 --mode parallel
harness2-report --bench lab --k 1 --mode parallel
These runs incur API costs, and the authors recommend starting with a small selection of tasks. If you add --dry-run to harness2, you see the task selection without calling any model. Results go to runs/, including adopted harnesses and reflection notes. If you run the same command again, execution resumes.
Does It Work With OpenCode and Codex CLI?
Yes. OpenCode is the default executor, and Codex is activated with --substrate cx. To use Codex with Gemini, the repo includes harness2-bridge, a local LiteLLM server that exposes Vertex AI through a Responses API-compatible interface. To use another Responses API endpoint, the guide documents HARNESS2_CODEX_BASE_URL, HARNESS2_CODEX_API_KEY, and HARNESS2_CODEX_MODEL.
At the time of publishing this note, the version supports these two executors and these three benchmarks. It’s an early-stage repository, so that list is likely to change.
What Security Risks Does It Have?
The README says it explicitly: the executor’s network access is unrestricted and Codex runs with its sandbox disabled. When the bridge runs for WorkBuddy, it listens on 0.0.0.0, that is, all network interfaces, and the guide warns you should restrict who can reach it.
The authors also point out an integrity problem: public rubrics for benchmarks may be available on the internet. They recommend setting up network restrictions before any evaluation. Don’t run it on a machine with access to anything you care about. The advice goes double because the project clarifies it’s not an officially supported Google product and falls outside Google’s open source vulnerability rewards program.
Why Does It Matter If You Don’t Run Benchmarks?
Because the underlying idea applies to any agent you use, even if Harness² is a research artifact and not a tool you’ll add to your workflow next week. Your harness is a set of files, and those files can be measured and improved systematically: run variants on the same task, compare behavior, keep what wins, and record why.
It’s the same direction as Microsoft’s work with SkillOpt, but applied to the entire harness instead of just one skill. Now Google Research has a public and reproducible version of that cycle. If your team maintains a growing stack of instructions for agents, it’s a good reference for stopping tweaking them by eye.
And you? What part of your harness do you change most often: the system prompt, skills, or memory?
- I adjust them by hand when something fails
- I test variants and compare results
- I barely touch them after I write them
- I prefer another approach (tell us which)
Comment below or, if this article reached you by email, reply directly to the email: your reply gets published here.
Related: Composer 2.5: Why Harness Matters More Than the Model