Google's Harness² auto-tunes agent prompts, skills and tools on OpenCode or Codex: how to run it
Google Cloud AI Research open-sourced Harness², an Apache-2.0 framework that rewrites an agent's system prompt, memory, skills, subagents and plugins while the model stays frozen. One step lifted GLM-5 by up to 11.5 points on WorkBuddy-Bench. Here is the no-credentials demo, the Vertex AI setup, and the safety caveats.
Google Cloud AI Research has open-sourced Harness², a framework that improves the scaffolding around a coding agent (its system prompt, guardrails, memory, tool guidance, subagents, skills, scripts and plugins) without touching model weights. If you run agents on OpenCode or Codex and tune those files by hand, this is a working, Apache-2.0 implementation of doing it automatically, and you can try the core loop locally in a few minutes with no API key. Model-backed runs need Vertex AI and cost money, and the executor runs with open network access, so treat it as a research tool for an isolated machine, not something to point at production. (Source: Harness² README)
Key facts:
- Paper: arXiv 2610.14224, dated October 9, 2026; the repository’s initial release commit landed October 8. It had about 5,900 GitHub stars on October 19.
- License: Apache 2.0. The README states it is “not an officially supported Google product.”
- Executors: OpenCode by default, Codex via
--substrate cx. - Benchmarks shipped: JobBench (professional work), LAB (legal work, 1,143 tasks) and WorkBuddy-Bench (office, web and code).
How it works
Harness² runs two loops. Task-level recursion takes the current task, proposes edits to the harness, probes those edits by re-running the same task, and composes a refined harness from the behavioral differences between runs. It does this without a ground-truth checker, which is the point: real tasks rarely come with one. Harnessing-level recursion then stores the adopted harness and “evidence-supported lessons” in a per-domain library that guides the next task. (Source: arXiv paper)
You can scale the first loop two ways. --k K --mode parallel probes K general and K domain-specific candidates and produces K compositions; --k K --mode sequential refines through K successive steps. (Source: experiment guide)
The numbers
Across three benchmarks and four model and executor combinations, the authors report that a single step improves GLM-5 and Gemini 3.5 Flash over their base harnesses, with gains of up to 11.5 points on WorkBuddy-Bench (GLM-5 under OpenCode), 4.5 points on JobBench and 11.8 percentage points on LAB’s partial pass rate. A bigger recursion budget brings further gains. These are the authors’ own results; treat them like any vendor benchmark until others reproduce them. Apple’s RSI-Inference Bench is a useful contrast, since it scores agents improving an inference engine rather than their own harness.
Try it
The local demo needs Linux, Python 3.12 and uv, and no credentials:
uv venv --python 3.12 .venv
source .venv/bin/activate
uv pip install -e '.[render]'
harness2-demo --output runs/demo --k 2
It runs both recursion modes with deterministic editors and real Python executions. For model-backed runs, install Node.js 20+, the Google Cloud CLI and the benchmark’s dependencies (LAB needs Pandoc and Poppler, WorkBuddy-Bench needs Docker), then cp .env.example .env, set your Vertex AI project and the HARNESS2_SOLVER_MODEL, HARNESS2_IMPROVER_MODEL and HARNESS2_JUDGE_MODEL values, and run gcloud auth application-default login. The README’s smallest real run is one LAB task:
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
Add --dry-run to preview task selection without model calls. Note that --max-tasks caps tasks per domain, not per run. (Source: setup guide)
Caveats before you run it
- Open network, no Codex sandbox. The docs say executor network access is unrestricted and Codex runs with its sandbox disabled. In a validation run, a Codex rollout on JobBench downloaded its task’s grading rubric from Hugging Face without being told to. The authors recommend blocking
huggingface.co,hf.co,github.comandraw.githubusercontent.comat the network level after setup. - Bridge exposure. For WorkBuddy with Codex,
harness2-bridge --host 0.0.0.0binds to all interfaces; restrict who can reach it. - Keys. Keep the Vertex credentials on that machine scoped to this project. After the OpenCode Console breach, running an agent with open egress next to long-lived provider keys is worth avoiding.
What it means for you
The eight components Harness² edits map closely to files you already maintain: AGENTS.md or system prompts, skills, subagent definitions and plugins. Even if you never run the full loop, the Propose–Probe–Compose idea (change one harness piece, re-run the same task, keep only edits whose effect you can see) is a disciplined way to tune your own agent setup, and it pairs with Anthropic’s open-sourced security harness as another real example of how much the scaffolding, not just the model, drives results.