Two weeks, 16,000 stars, no reliance on pre-trained models: Google releases open-source Harness²

Two weeks, 16,000 stars, no reliance on pre-trained models: Google releases open-source Harness²

3 weeks ago
duguying
25 views
Source: GitHub

Google Research's open-source project, Harness², uses a two-level recursive rewriting process to manage the agent's components (prompts, tools, memory, skills, and orchestration), with fixed model weights. This resulted in improvements of up to 11.5 points on WorkBuddy-Bench, 4.5 points on JobBench, and 11.8 percentage points on LAB.

Related tags

#Harness2#Google#Agent#Agent框架#开源

Project Overview

Google Research’s “Harness²” (repository name: harness2, paper title: “Harness²: Recursive Agent Harnessing for an Open World”) presents a straightforward approach: to improve an agent’s performance on unseen tasks, it doesn’t necessarily require retraining the model. Instead, “optimize the ‘outer shell’ of the model first.”

It divides an agent’s system into two parts: harness encompasses everything outside the model – prompts, tools, memory, skills, and orchestration; harnessing is the continuous optimization process for this outer shell. Harness² automates this optimization process, even when the model weights are fixed, using a two-level recursive iteration on the shell.

The project uses Apache 2.0 license, primarily in Python. It was created on October 6th and has already accumulated over 16,000 stars and more than 1,500 forks, indicating significant interest.

What Problems Does it Solve?

Existing agent frameworks typically assume that the “harness” is designed by humans, and then used to run tasks. However, in an “open world,” the types of tasks users provide are often unseen during design. This means a generic harness designed for one task might miss crucial prompts, narrow the appropriate tool range, or lack necessary memory for another.

Harness² addresses this by allowing the agent to modify its own shell during execution, using evidence generated from the current task. It then consolidates these learned improvements for use in subsequent tasks.

Core Mechanism: Two-Level Recursion

The core mechanism is “two-level recursion”:

  • Task-level recursion: A “Propose–Probe–Compose” process:
    • Propose: The harness editor suggests modifications to the current harness, categorized as “invariant modifications” and “domain-specific modifications.”
    • Probe: The candidate harness is run on the same task to observe behavioral differences.
    • Compose: Improvements are synthesized from the multiple executions’ behavior comparison, creating a refined harness.

The key advantage here is that it doesn’t rely on ground truth feedback; instead, it infers which changes are effective by comparing the behavior of different harnesses. This makes it suitable for open tasks where definitive answers may not be available.

  • Harnessing-level recursion: Responsible for memory: After each task, the “experience reflector” reviews and writes down the accepted harness and supporting evidence into a persistent “improvement harness,” which guides subsequent rewrites.

Eight Editable Components

The harness is broken down into eight editable components, covering context construction, tool interfaces, delegation behavior, and middleware within the tool loop:

  • Context Construction: system prompt, guardrails, memory, skills
  • Tool Interface Definition: tool guidance, scripts
  • Delegation Orchestration: subagents
  • Middleware: plugins

The README includes a diagram showing the components and their grouping based on runtime responsibilities, which defines the boundaries for modifications in the “Propose” stage.

Two-Level Recursion Budget: Parallel vs. Serial

--k represents the task-level recursion budget, with two ways to use it (as described in the README): “parallel exploration is broader, while serial refinement is deeper”.

Parameter Behavior
--k 1 One Propose–Probe–Compose step
--k K --mode parallel Probe K generic candidates + K domain-specific candidates, producing K synthesized results
--k K --mode sequential Refine the same harness iteratively with K steps
--substrate cx Replace the default OpenCode executor with Codex

Measured Results

On three professional benchmarks and four “model × harness” configurations, running Harness² once resulted in GLM-5 and Gemini 3.5 Flash exceeding their native harness performance by:

  • WorkBuddy-Bench: Up to +11.5 points
  • JobBench: Up to +4.5 points
  • LAB (legal work): Up to +11.8 percentage point increase in pass rate

Increasing the task-level recursion budget further increases performance. The three benchmarks are JobBench (professional work), LAB (legal work), and WorkBuddy-Bench (office, web, and code – with --subset office|web|code option).

A Neglected Safety Boundary

The README includes a section specifically addressing: “The executor’s network access is unrestricted, and the Codex runtime sandbox is also disabled.” This means that if you don’t configure network restrictions beforehand, the agent can potentially read answers and scoring criteria directly from the internet. Therefore, achieving such performance gains would be meaningless. The project provides ways to restrict web access in docs/EXPERIMENTS.md#web-access and must be implemented before running formal experiments.

Quick Start

First, run a local demo (Linux, Python 3.12, uv) without any model credentials:

uv venv --python 3.12 .venv
source .venv/bin/activate
uv pip install -e '.[render]'
harness2-demo --output runs/demo --k 2

This demo uses both deterministic and real Python execution for two recursion modes. When using a real model, you also need Node.js 20+, Google Cloud CLI, and dependencies specific to each benchmark (LAB requires Pandoc and Poppler, WorkBuddy-Bench requires Docker):

cp .env.example .env
gcloud auth application-default login

Common Commands

Install data, check the environment, run a task, evaluate results, generate reports:

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

Note that evaluation and reporting must use the same benchmark, executor, subset, --k, --mode, and seed as the refinement run. To preview task selection and generate results without model calls, use harness2 with the --dry-run option. The results are stored in the runs/ directory, including task summaries, deliverables, accepted harnesses, review notes, and evaluation scores. When switching models or task sets, modify HARNESS2_RUNS_DIR to ensure that subsequent executions continue from where they left off.

Project Status & License

  • Code: Apache 2.0; third-party code and benchmarks/datasets follow their respective upstream licenses
  • Language: Python; paper arXiv:2610.14224, project page harness2.github.io
  • Popularity: ~16,277 stars, 1,506 forks, 117 open issues
  • Disclaimer: Not an official Google product and not part of the Google Open Source Vulnerability Reward Program

Get Started & Learn More

More News

Want to see more quality content?

Browse all news