Skip to content
Back to Blog

Harness²: Google Research's Recursive Agent Harnessing, Examined

Published Editorial policy & corrections

Editorial note: AI-assisted primary-source research and engineering analysis, checked October 19, 2026. Paper v1 and repository commit 1cfe254 were inspected. The credential-free demo and five upstream workflow tests were run locally; professional benchmark scores remain author-reported and were not reproduced.

Share:XBSMRedditHNEmail

An agent finishes a complex assignment badly. Its model may know enough to do the work, yet its operating procedure lets it skip an input file, use the wrong aggregation rule, or write a deliverable it never opens again. Asking the same model to try harder might help. Changing the machinery that shapes every attempt could help more.

That is the useful question behind Harness², the Google Cloud AI Research and Northwestern University work titled Recursive Agent Harnessing for an Open World. The preprint was submitted October 9, 2026, and its implementation is public. The repository is Apache-2.0 licensed and explicitly says it is not an officially supported Google product.

My assessment: Harness² provides a concrete way to turn execution evidence into reusable changes around a frozen model. Its strongest contribution is an inspectable improvement procedure; its hardest unresolved problem is deciding when a persuasive improvement is actually reliable.

This article examines the algorithm, its implementation, the reported results, and the experiment I would run before adopting it. Paper results, code observations, local checks, and proposed production controls are identified separately. The evidence cutoff is October 19, 2026; source links into the implementation are pinned to the inspected commit.

What changes when the model stays fixed?

A harness determines what a model sees, which tools it can use, how it delegates, and what procedures surround an action. Harness² exposes eight editable components. In its OpenCode adapter, their placement also determines their runtime cost. OpenCode component definitions.

ComponentOpenCode representationEngineering significance
System promptsystemprompt.mdChanges standing procedure and task framing
Guardrailsguardrails.mdAdds persistent behavioral instructions
MemoryLongTermMEMORY.mdCarries domain information in always-on context
Tool guidancetool_descriptions/tool_guidance.mdChanges how the model interprets and uses tools
Skillsskills/<name>/SKILL.mdPackages workflows that load when invoked
Subagentssub_agents/<name>/AGENT.mdDefines delegated work in separate contexts
Scriptsscripts/<name>.pyMoves suitable operations into executable helpers
Pluginsplugin/<name>.tsChanges behavior inside the tool loop

These are materially different interventions. A reminder to reconcile totals can be ignored. A deterministic reconciliation script can calculate them exactly. A plugin can intervene during tool execution. Treating all three as “better prompting” hides the part an engineer needs to evaluate.

Portability also has limits. The Codex adapter uses AGENTS.md, .agents/skills, and hooks rather than reproducing OpenCode’s file layout literally. Its surface definition and installation rules deserve inspection before transferring a candidate between executors. A portable improvement idea is not automatically a portable executable component. Codex adapter.

One important distinction: an editable file called guardrails.md supplies model instructions. Whether a restriction is enforced independently depends on the runtime around that file. The filename alone cannot establish a security boundary.

The two loops, without the mythology

Harness² separates changes made within one task from experience retained between tasks. That distinction explains both its novelty and the limits of the word “recursive.”

Here, open world means the system encounters tasks that were not available when its harness was designed, and adaptation cannot rely on a supplied answer key. It does not mean the experimental tasks are unbounded or that evaluation disappears. The benchmark adapter separates an execution record from grading, and the benchmark guide places judging after selection. Execution interface, benchmark evaluation flow.

The distinction is essential: improvement without ground-truth feedback is not evaluation without ground truth or external judges. A model may improve its procedure using available evidence, while a separate evaluator later measures whether the resulting work meets the task’s requirements.

Loop one: Propose–Probe–Compose

The proposal stage divides attention between an invariant weakness, such as failing to verify output files, and a domain-specific weakness, such as mishandling credits in a ledger. Each proposal changes executable harness files. Both candidates are run on the current task before composition. The composer receives the reference, candidate differences, and execution evidence, then produces a successor harness that is itself executed. Recursion implementation.

Composition matters because two locally sensible edits can interact. One might require more checks while another adds a lengthy specialist workflow; together they could consume the budget before a deliverable exists. An effective composer must reason about that interaction, rather than concatenate instructions.

The reference is also evidence, not an answer key. If an edit makes the agent open every source file, that is observable. If the final recommendation is subtly wrong, both the reference and candidate may miss it. Behavioral comparison makes an improvement hypothesis more concrete without settling every question about correctness.

Consider an illustrative financial task. The baseline reads transactions but totals only positive amounts. One proposal adds a general reconciliation rule; another replaces the summation helper. A probe that includes negative amounts can expose the defect. Composition can retain the helper and a targeted check without carrying every sentence of both proposals forward. This is a useful intervention because the changed behavior can be traced to a specific operation.

Loop two: retain the improvement experience

After adoption, reflection produces a reusable lesson and stores it alongside the full harness tree. The library requires a cue, a lesson, and supporting evidence before accepting an entry. It builds an index that later sessions can inspect. Library implementation.

The next task starts from the common base harness. Prior components are available for selective reuse during improvement; the system does not simply overwrite the global base with yesterday’s winner. Libraries are scoped by domain and experiment configuration, and tasks within a domain run in order. Experiment protocol.

This design reduces one obvious failure mode: blindly accumulating every prior task’s assumptions in a universal system prompt. It introduces another responsibility: deciding which old experience is relevant now, and when a once-useful component should expire.

The meta-level change is specific. The retained library evolves; this is not evidence of unrestricted rewriting of the entire optimizer or changes to model weights. The stage prompts remain a defined procedure. Improvement prompts.

Parallel recursion and sequential recursion spend the budget differently

The parameter k controls exploration, but it has different operational meanings in the two modes.

QuestionParallel modeSequential mode
What gets expanded?Candidate diversity around the same starting harnessA chain of successive refinements
Candidate proposalsk invariant and k domain-specificTwo proposals at each of k steps
Compositionk independent compositions using the shared poolEach composition sees the evolving harness and accumulated history
Main opportunityExplore alternatives concurrentlyCorrect or extend an earlier intervention
Main risk to investigateSimilar proposals create expensive redundancyAn early mistaken premise shapes later edits

The scheduling details are explicit in the parallel and sequential drivers. Parallel mode performs a population update whose width grows with k; it does not mean k nested generations. Sequential mode carries evidence through successive updates.

At k > 1, the released selector chooses among composed outputs. In sequential mode, that includes intermediate composed checkpoints. The pool excludes reference executions; at k = 1, the single composed output bypasses a selector session. Selection pool and single-output path.

This creates an important asymmetry. The composer can preserve the current harness, but final selection does not provide a general option to return an earlier reference output. A higher average score therefore does not imply that every task improves or that the system always falls back to the best baseline deliverable.

For a service with strict latency limits, wider parallel search may be feasible only when concurrency and rate limits allow it. Sequential refinement has a dependent path that cannot be removed by adding workers. The right mode is a scheduling and economics decision as well as a quality decision.

What the paper reports

The main experiments combine two frozen executors, Gemini 3.5 Flash and GLM-5, with OpenCode and Codex harnesses. The default editor and selector are Claude Opus 4.8. Means and standard deviations come from three task streams. WorkBuddy reports a domain macro-average; LAB reports criterion-level Partial, rather than whole-task success. Paper, Tables 1–2 and Appendices B–D.

BenchmarkExecutor / harnessBase mean ± SDHarness² k=1 mean ± SDParallel k=5 mean*
WorkBuddyGemini / OpenCode72.4 ± 0.977.5 ± 2.580.8
WorkBuddyGemini / Codex74.5 ± 1.677.5 ± 2.080.4
WorkBuddyGLM-5 / OpenCode64.2 ± 1.475.7 ± 2.279.6
WorkBuddyGLM-5 / Codex64.4 ± 1.275.3 ± 1.378.3
JobBenchGemini / OpenCode31.5 ± 1.136.0 ± 2.339.0
JobBenchGemini / Codex33.9 ± 2.635.3 ± 3.539.5
JobBenchGLM-5 / OpenCode20.6 ± 2.024.2 ± 0.928.4
JobBenchGLM-5 / Codex23.6 ± 2.324.8 ± 0.227.9
LAB PartialGemini / OpenCode79.9 ± 0.681.9 ± 0.684.5
LAB PartialGemini / Codex71.6 ± 1.375.6 ± 4.578.5
LAB PartialGLM-5 / OpenCode59.6 ± 2.771.4 ± 2.978.1
LAB PartialGLM-5 / Codex58.1 ± 2.365.9 ± 2.770.7

The k=5 column adds the paper’s reported “+ Recursion” mean changes to its k=1 means. It is a calculation from the published tables, not an independent measurement. Benchmark units differ; their rows should not be averaged together.

The largest one-step changes are 11.5 score points, 4.5 score points, and 11.8 percentage points respectively. These are absolute changes, not interchangeable relative percentages. Meta-Harness remains ahead in the Gemini/Codex LAB comparison at k=1. Reported comparisons.

My interpretation is that the four configurations make the result harder to dismiss as a single model’s formatting preference. They also expose the risk of summarizing the work as a universal ranking. The advantage varies substantially by benchmark, executor, and starting harness.

The reported standard deviations also matter. Three streams show run-to-run variation; they do not by themselves establish statistical significance for every comparison. For a deployment decision, I would want paired task outcomes, uncertainty on the differences, and failure categories rather than treating every positive change in a mean as equally convincing.

A stronger editor is a potential confound in the default setup. The paper separately tests the same model in both roles and reports gains, which addresses that narrow concern. It does not make all deployment economics equivalent: editorial work still consumes inference, whether its model is stronger or identical. Same-model analysis, Figure 8.

Ablations help identify what earns the improvement

The authors remove three mechanisms under Gemini/OpenCode at k=1:

ConfigurationWorkBuddyJobBench
Full Harness²77.536.0
Without the library74.434.2
Without scoped editor roles74.632.3
Without composition75.934.1

These are author-reported ablations, not local measurements. The scope ablation retains two candidates and their probing budget, which helps distinguish the role split from merely generating another proposal. Table 3 and ablation definitions.

My reading is that the full design deserves testing as a combination. The ablations support contributions from retention, specialization, and composition in these settings. They do not establish independent additive effects or show that the same allocation is optimal for a different workload.

What is new relative to earlier harness work?

Harness² sits within an active line of research. Its contribution is easier to assess when the comparison is about the object being changed and the feedback available, rather than the broad label “self-improvement.”

WorkCentral mechanism in its primary sourceUseful distinction
ReasoningBankDistills reusable reasoning memories from self-judged experience; scales experience generation with MaTTSMemory-guided behavior need not rewrite an executable harness tree
Meta-HarnessAn agentic proposer searches harness code with access to previous code, scores, and tracesRich offline feedback differs from answer-free adaptation on a new task
Agentic Harness EngineeringMakes components, experience, and edit decisions observable; checks predicted effects against outcomesInspectable file edits and explicit hypotheses are established foundations
Rethinking the Evaluation of Harness EvolutionCompares evolution with simpler search under comparable feedback and inference budgetsExtra attempts and reusable improvement must be distinguished experimentally

Harness² combines a current-task intervention loop with a persistent library of executable experience. The combination is more specific than either “agents remember lessons” or “agents edit their prompts.” Its scope split and composition stage also make the mechanism more structured than unrestricted self-revision.

The comparison should remain fair to the baselines. This paper evaluates particular ports, settings, and budgets. A weak result for its ReasoningBank configuration does not establish that reasoning memory is generally ineffective. An offline search method also answers a different deployment question: whether an up-front investment can serve enough later tasks to amortize its cost.

The compute accounting changes the business interpretation

The released ledger encodes a precise nominal budget per task and mode:

executor rollouts = k references + 2k probes + k composed executions = 4k
improvement stages = 2k proposals + k compositions = 3k

Selection, reflection, and extra attempts are outside those nominal stage counts. At k=1, four executor rollouts accompany three improvement stages. At k=5, there are twenty rollouts and fifteen improvement stages before accounting for the other work. References can be shared when both modes are run together. Budget ledger.

Consequently, fewer model turns in the submitted execution cannot establish a lower end-to-end bill. The right denominator is the accepted outcome after all probes, editing, selection, reflection, infrastructure, and review.

An illustrative cost model is:

cost per accepted outcome =
  (all executor costs + all improvement costs + environment costs + review costs)
  / independently accepted outcomes

This is my proposed operating metric, not a quantity reproduced from the paper. It makes two otherwise hidden effects visible. A cheap final run can be preceded by expensive discovery. A more expensive current task can still be worthwhile if its reusable component reduces enough future work.

The relevant frontier is therefore specific to a workload and a time horizon. A report generated once may not repay a substantial search budget. A reconciliation workflow repeated thousands of times might. Measure the marginal return from the library separately from the gain produced by retrying the current task.

The paper’s token-based Pareto comparison is useful evidence within its tested settings. It does not supply a universal dollar advantage under current provider prices, nor does token count alone express latency, failed runs, or human verification effort. Compute analysis, Figure 6.

What source inspection reveals beyond the headline

The evidence boundary is deliberately implemented

The context builder checks known leakage paths and grader-verdict markers before passing files to improvement sessions. The prompts tell editors and selectors to treat evidence as data and to avoid executing commands embedded in candidate material. These are useful, concrete precautions. Context construction, evidence-handling prompts.

Their practical scope needs to remain clear. Recognizing known verdict markers is different from proving that arbitrary text cannot encode an answer. An instruction to disregard hostile content is different from an enforced inability to execute it. Evaluate these defenses against the threat model that actually matters to the deployment.

A valid tree is not a validated business outcome

The tree layer restricts editable paths and checks component structure. The recursion driver retries an invalid proposal once; a second failure inherits the prior tree and records the fallback. Tree validation, stage failure handling.

Those checks prevent a useful class of broken experiments. They cannot establish that a syntactically accepted script calculates the right business quantity, that a skill encodes current policy, or that a plugin is appropriate for a privileged workflow. Structural acceptance and semantic acceptance need separate records.

Adoption and completion are different events

The selector anonymizes candidates and returns an existing output. Separately, completion markers bind saved runs to a harness fingerprint, and resume handling checks previously adopted artifacts. Selection, completion markers, scheduler.

This is an engineering strength: the implementation preserves enough identity to investigate which configuration produced an artifact. A completed rollout still needs an independent acceptance rule. Successful execution of the workflow is evidence about workflow integrity, not proof that its selected answer is correct.

The score denominator needs to travel with the score

The report code excludes ungraded rows and tasks that never completed from its score denominator. It records ungraded counts for rows it receives. Reporting implementation.

That reporting convention requires an accompanying completion ledger. Suppose two methods each score 80 among graded tasks, but one completes every assignment and another completes half. Their operational reliability is different even though the reported means match. This hypothetical illustrates why an adoption report should include requested, completed, delivered, graded, and independently accepted counts, plus costs for failures.

The evaluation leakage issue deserves explicit attention

The release’s experiment guide documents a concrete event: during a validation run, a Codex rollout downloaded its JobBench rubric without being instructed to do so. It also states that network access is unrestricted and recommends external network restrictions because the Codex executor runs with its sandbox disabled. Release disclosure and network guidance.

This matters because “the pipeline does not hand the editor a rubric” and “the executor cannot obtain a rubric” are different experimental properties. The first can hold while the second fails. The paper’s intended answer-free protocol and the release’s disclosed exposure should both be reported.

The disclosure does not by itself establish that the paper’s reported measurements were contaminated. It establishes a real reproduction hazard and a reason to request the exact egress configuration and access evidence for each evaluation.

My proposed reproduction protocol would install public dependencies first, then enforce benchmark-answer restrictions outside the candidate’s control. It would also inspect trajectories and access logs, retain contaminated runs as protocol failures, and rerun affected comparisons. Simple hostname blocking may be insufficient for mirrors or copied answer material, so document its coverage rather than treating a blocklist as proof of isolation.

There is a second reproducibility trap: the release’s default task discovery and the paper’s frozen evaluation splits are distinct configurations. The benchmark guide describes the installed task stream, while the paper specifies held-out subsets. Pin task identifiers, dataset revisions, and split files; do not assume the default command reconstructs a published table. Benchmark guide, paper benchmark protocol.

What I ran locally, and what that establishes

I inspected repository commit 1cfe254e8d25b15f37048c3730134686abe60335 and ran its credential-free demo at k=2 in both modes. It completed two accounting tasks with zero failed tasks, recording 28 local Python executions and 32 scripted editor calls. Before the second task, each mode had one library entry available. The repository’s five upstream workflow tests also passed.

The demo is intentionally deterministic. Its baseline summation omits negative transactions, and its scripted editor repairs that specific defect. This exercises real recursion, selection, persistence, and reuse plumbing. It does not test whether an LLM discovers the repair independently, and it does not reproduce WorkBuddy, JobBench, or LAB quality. Demo adapter, workflow regressions.

For a first examination, the repository documents this credential-free path:

git clone https://github.com/google-research/harness2.git
cd harness2
git checkout 1cfe254e8d25b15f37048c3730134686abe60335
uv venv --python 3.12 .venv
source .venv/bin/activate
uv pip install -e '.[render]'
harness2-demo --output runs/demo --k 2
python -m unittest discover -s tests -q

Model-backed benchmarks require additional infrastructure and credentials; the documented benchmark environment is Linux. Use the setup guide for that path. The research ledger records the exact local checks and the boundaries of this assessment.

Why contrastive improvement is useful without being causal proof

The method’s appeal is easy to understand: propose a change, execute it, and inspect the difference. That is a much stronger basis for engineering discussion than a model merely explaining why its new prompt should work.

However, a single before-and-after trajectory changes more than the harness. The model samples another execution, may encounter different web state, and may take a different path even under identical instructions. An observed improvement therefore supports a hypothesis without isolating its cause.

For causal attribution, I would add paired baseline and candidate runs on resettable environments, repeated sampling, and held-out checks. I would preserve regressions and separate artifact quality from process compliance. If an editor both proposes and judges its intervention, I would also measure its agreement with an evaluator outside that improvement loop.

The persistent library creates a related challenge. A lesson may be useful because it captures a general procedure, or because it accidentally preserves a task-specific fact. Testing it only on a near-duplicate cannot distinguish the two. Change document formats, terminology, currencies, and task order; include cases where applying the lesson should be harmful. A transferable component needs an applicability boundary as well as a success story.

For online learning claims, also preserve chronology. Reusing experience from earlier tasks is an online result. Building a library from the whole stream and excluding the current task’s own entry is a useful retrospective transfer experiment, but later-task information still changes what the system could have known at the time. These should be labeled as different protocols.

How I would adapt the idea for a production agent

The central adoption decision is the editable surface. A candidate can improve an accounting helper without receiving permission to redefine who may approve a payment. An effective improvement system needs a boundary between the behavior it can optimize and the authority that decides whether an effect is allowed.

The following is a proposed deployment pattern, not a claim that the research release implements enterprise release governance.

Three constraints make this practical.

First, isolate speculative execution. Probing a report generator in a disposable workspace is different from probing a payment action against a live account. Candidate runs need resettable state, scoped credentials, and controlled effects. Repeated execution must not create repeated business actions.

Second, keep authority outside the candidate. Approval requirements, tenant boundaries, credential scope, production egress, and release criteria should be independently enforced. An optimizer must not be able to improve its measured score by weakening the conditions under which it is judged or allowed to act.

Third, govern retained experience. Store its source, observed effect, applicability conditions, owner, and version. Support rejection, correction, expiration, and removal of derived copies. A useful library entry should say when to use a component and when to distrust it.

In ContextOS terms, the library belongs to intelligence and improvement, context compilation decides which experience is relevant, the decision loop schedules bounded work, the action boundary controls effects, and trust governs evaluation and promotion. This is an architectural mapping, not a statement that Harness² implements the ContextOS contract. The existing improvement-loop specification already distinguishes candidate generation from promotion; this research is a concrete pattern to evaluate within that separation.

The experiment that would change my adoption decision

I would start with a recurring workflow that has expensive but inspectable failures: document reconciliation, offline data transformation, or artifact generation. The first study should answer whether the method buys accepted outcomes under a realistic budget.

ComparisonQuestion it answers
Frozen base vs repeated base executionHow much comes from additional attempts alone?
Repeated base execution vs a simple revise-and-retry loopHow much comes from targeted feedback without a library?
Harness² with and without retentionDoes prior experience help later tasks?
Full Harness² vs the same budget of simpler searchDoes the mechanism earn its additional complexity?
Adopted components on future, changed tasksDoes the improvement transfer beyond the discovery case?

Keep executor versions, input snapshots, task identifiers, evaluator access, and environment reset behavior fixed across arms. Account for editor and selector tokens as well as executor tokens. Randomize task order across repeated streams and keep future tasks unavailable during improvement.

Report accepted outcome rate, completion rate, critical-error rate, total cost, elapsed latency, review effort, and component reuse. Include confidence intervals appropriate to the design and disclose missing grades. Compare dollar budgets and latency budgets separately: parallelism can change one without proportionally changing the other.

For the persistent library, I would require a test of correction: deliberately retire a bad lesson and verify that future candidates stop reconstructing it. I would also test an empty or irrelevant library, since an improvement system that always finds something to reuse may be manufacturing relevance.

My adoption criterion would be an improvement in independently accepted outcomes at an acceptable total cost, with failures and authority boundaries preserved. A benchmark gain can motivate that study; it cannot substitute for it.

Where the next research opportunity lies

The most valuable next result would explain when to spend another probe. A fixed recursion budget treats a trivial formatting defect and a complicated planning failure alike. An adaptive policy could estimate the expected value of another execution from disagreement, unresolved checks, task stakes, and available experience. It would need evaluation against a fixed-budget baseline rather than assuming a sophisticated stopping rule helps.

A second opportunity is library maintenance as an experiment. Measure retrieval precision, negative transfer, growth in always-on context, correction latency, and performance after old experience is removed. A library that grows forever can become an unreviewed software supply chain.

A third is independent evidence for improvement. The system can retain a component and a persuasive explanation of why it helped. The next step is to preserve executable tests and observed boundaries that another evaluator can rerun. That would make the claim easier to challenge, transfer, or revoke.

Harness² makes these questions tangible because its improvement objects are files, its proposals are executed, and its retained lessons have an observable place in the system. I would take that mechanism seriously. I would judge its deployment value by the evidence that survives outside the model’s own account of its success.

Found this useful? Share it.

Share:XBSMRedditHNEmail

Continue through the same topic without returning to the index.

View the series