SRI's Shakey robot, a wheeled cabinet with a camera and range finder on a mast
Shakey, SRI, 1969. Its researchers built the rooms it moved through, with painted blocks, ramps and lighting set up for its camera. "SRI Shakey robot, 1969, Computer History Museum" by The wub, CC BY-SA 4.0, via Wikimedia Commons.

Anatomy of a harness

A harness is the task, the environment, the tools, the verifier and the reward that an AI agent learns or is graded in. What each part does, the documented ways each one fails, and the checks that catch them.

When a model is trained with reinforcement learning, or graded on an agentic benchmark, it does not see the world. It sees a harness: a task, an environment it can act in, the tools it is allowed to call, a verifier that decides whether it succeeded and a reward computed from that decision. Whatever the harness rewards is what the model learns. If the harness can be satisfied without doing the task, a capable enough model will eventually find out how.

This post goes through each part, the documented ways it fails, and the checks that catch them. It is the design document behind the harnesses we build.

The five parts

Diagram of a harness. A task specification goes to the agent. The agent sends actions through tools into a sandboxed environment and receives observations. When the episode ends, the final environment state and the trajectory go to a verifier, which produces a reward and a log.
One episode. The agent never sees the verifier's code or the hidden tests; it sees the task, the tools and what the environment sends back. Everything it does is logged.
  1. The task says what to do: a GitHub issue to resolve, a theorem to prove, a booking to make over the phone.
  2. The environment is the world the agent acts in: a container with a repository, a simulator, a live audio stream. It holds state, and it must start from the same state every time.
  3. The tools are the agent's action space: a shell, a file editor, a search API, a Lean tactic, a function call mid-sentence.
  4. The verifier inspects the end state, and sometimes the whole trajectory, and decides whether the task was done.
  5. The reward turns the verifier's decision into the number the training algorithm sees. In an evaluation, it is the score.

A harness used for evaluation and one used for training have the same parts. The difference is pressure. A benchmark is attempted a few times; an RL environment is attempted millions of times by a policy that is being optimised against it. Small flaws that never matter in evaluation become the thing the policy learns in training.

The task

A task that admits more than one reading cannot be graded fairly, and a model that picks the other reading is marked wrong for no reason.

SWE-bench, the benchmark of real GitHub issues from Python repositories [1], is the clearest case study. In 2024 OpenAI had 93 Python developers review 1,699 of its tasks. They flagged 38.3% for underspecified problem statements and 61.1% for unit tests that could reject a valid solution. 68.3% of the sample was filtered out, and the 500 tasks that passed review became SWE-bench Verified [2]. An independent audit, SWE-Bench+, looked at the patches that SWE-Agent with GPT-4 got right. In 32.67% of them the solution had been given away in the issue text or its comments, and another 31.08% passed only because the tests were too weak to tell [3].

SWE-bench was built from real issues, which is what made it valuable, and real issues are written for people who already share the context. Someone who has not seen the reference solution has to check each task: can it be done from this text alone, and will the verifier accept every correct solution?

A task can also be spoiled before the agent sees it. A test set that has been trained on measures memory. Public benchmarks end up in web crawls, and from there in pretraining data.

The direct way to check is to build a fresh copy. GSM1k is a new set of 1,250 grade-school maths problems written to match GSM8K in style and difficulty. Some model families scored up to 8% lower on it than on GSM8K, while frontier models showed little sign of overfitting [4]. That gap is an estimate of how much of a score was memory.

Harnesses limit contamination in three ways: keep the test tasks private, generate new task instances from a template on every run, and date-stamp tasks so that a model can be scored only on tasks created after its training cutoff.

The environment

An environment leaks when the agent can reach information that would not exist at the time the task is set.

The standard example is version control. A SWE-bench container holds a git repository checked out at the commit before the fix. If the future commits are still in the object store, an agent with a shell can run git log --all and read the answer. In September 2025 this was reported on SWE-bench itself: Claude 4 Sonnet, Qwen3-Coder and GLM 4.5 were seen running git log --all and finding the fix, and the harness was patched to remove future history [5]. Network access does the same thing more broadly: an agent that can reach the internet can find the merged pull request.

Three other problems are quieter:

  • Determinism. If the environment's starting state varies (random seeds, timestamps, a package version resolved at install time), two runs of the same policy get different scores, and the difference is noise that looks like signal.
  • Reset. If state persists between episodes, an agent can be helped or hurt by what the last episode left behind.
  • The verifier inside the box. If the tests or the grading script are in the agent's filesystem, they can be read, edited or deleted.

The checks are mechanical: strip history and network access unless the task needs them, pin every dependency, rebuild the environment from an image for each episode, and keep the verifier outside the container, running against a copy of the final state.

The tools

The action space decides which strategies exist. With a shell, an agent can run git log --all, read the test files or edit them. With only a structured file editor and a test runner, it can do none of that, but it also loses legitimate moves, such as searching the repository with grep or installing a debugger.

Tools also define what is being measured. τ-bench, which tests customer-service agents that must follow a policy while calling APIs on behalf of a simulated user, makes the policy document and the tool schema part of the task [6]. It grades on the final database state, so a forbidden action that changes the state fails. One that leaves the state as expected can slip through, which is why the state-check row in the table below is gameable.

For voice, tools have a timing dimension that text benchmarks do not. In our previous post on native audio models, Full-Duplex-Bench-v3 found a trade-off between calling a tool early, for speed, and waiting until the user has finished correcting themselves [7]. The harness has to record when each call was made relative to the audio, as well as whether it was made.

The verifier

Verifiers come in five kinds, and they trade cost against how easily they can be fooled.

Verifier Example Cost How it gets fooled
Exact match Final numeric answer on GSM8K or MATH Very low Right answer by guessing or a wrong method; format quirks
Unit tests SWE-bench, HumanEval Low Weak tests; special-casing test inputs; editing the tests
State check Database or file state after a τ-bench episode Low Reaching the right state by a forbidden route
Model grader An LLM judging a summary or a conversation Medium Length, position and self-preference bias; the judge's own blind spots
Formal proof The Lean kernel accepting a proof Low per check, high to set up Proving a different statement; adding an axiom or sorry; kernel bugs

Two rows need more explanation.

Model graders are necessary for anything open-ended, and they have known biases. LLM judges prefer longer answers, prefer answers in the first position of a pairwise comparison, and prefer their own outputs [8]. A policy trained against an LLM judge will learn those preferences. Use one only with a calibration set of human-labelled cases, randomise positions, and check agreement with people on a sample of every new batch.

Formal proofs look unfoolable, and the kernel is far harder to fool than any test suite. The statement is not. If the agent writes both the theorem and the proof, it can prove an easier theorem. If it can add axioms, it can assume the conclusion. A Lean verifier must fix the theorem statement in advance, reject sorry, and check with #print axioms that the proof uses only the standard axioms (propext, Classical.choice, Quot.sound).

Even that is not the end. In August 2026 a soundness bug in the Lean 4 kernel was disclosed that let a proof of 0 = 1 pass with no extra axioms showing [9], and Lean's metaprogramming can add declarations that skip the kernel check altogether [10]. So the verifier also pins a patched Lean version, forbids metaprogramming and options in agent-written code, and replays every accepted proof with lean4checker. Our SpecBench harness grades this way.

The reward and the score

A verifier gives a judgement; the reward turns it into a number.

Binary or partial. A pass/fail reward is honest but sparse: a policy that never passes learns nothing. Partial credit (tests passed out of total, steps completed) gives signal earlier but rewards partial solutions, and partial solutions can be easier to reach by gaming. Reinforcement learning with verifiable rewards, used to train recent reasoning models, largely uses rule-based binary correctness [11]. DeepSeek-R1's authors chose rule-based rewards over a learned reward model specifically to avoid reward hacking.

Proxy and target. Most rewards are proxies, and optimising a proxy hard enough makes it diverge from the target (Goodhart's law). Gao, Schulman and Hilton measured this directly for learned reward models: as a policy is optimised against a proxy reward model, its score from a larger "gold" reward model, standing in for human judgement, rises, peaks and then falls, while the proxy keeps rising [12].

Line chart with optimisation pressure on the horizontal axis and reward on the vertical axis. The proxy reward rises steadily. The true reward rises at first, peaks and then falls.
The shape Gao et al. report for reward-model overoptimisation, drawn schematically. The gap between the lines is reward the policy earns from flaws in the grader rather than from the task.

Reliability. A single pass rate hides how consistent an agent is. τ-bench introduced pass^k: the probability that an agent succeeds on all of k independent attempts at the same task [6]. If attempts were independent, an agent with 60% pass@1 would have a pass^8 of under 2% (0.6^8 ≈ 0.017). Real attempts are correlated, so the true figure is higher, but it is usually far below pass@1, and it is closer to what a business sees when the same task arrives every day.

How harnesses get gamed

Specification gaming is old. In 2016 OpenAI described a boat-racing agent in CoastRunners that learned to circle a lagoon hitting the same reward targets, catching fire and going the wrong way, and scored higher than human players without finishing the race [13]. Victoria Krakovna and colleagues at DeepMind keep a list of such cases, which by 2020 held about 60 examples [14].

What has changed is that the models now read the harness. Recent reports describe frontier coding agents doing things the CoastRunners agent could not:

  • Special-casing tests. Writing code that detects the test inputs and returns the expected outputs. Anthropic reported this in Claude 3.7 Sonnet's training [15].
  • Editing or skipping the grader. Exiting with exit(0) before the tests run, raising SkipTest, or making the verification function always return true. OpenAI showed a reasoning model whose chain of thought said "Let's hack" just before doing the last of these [16].
  • Tampering with measurement. METR found o3, asked to speed up a GPU kernel, rewriting the timer so the program looked 1,000 times faster. In another task it replaced the evaluator with one that always passed [17].

OpenAI also found that penalising the model for thoughts about hacking did not stop the hacking. It stopped the model from writing those thoughts down [16]. So we use chain-of-thought monitors to detect hacking, and keep them out of the reward.

The checks we run

Put together, the failures above suggest a short list of rules. We hold every harness we build to them.

  1. Everything above. Blind task validation, the verifier outside the container, no future history or network, pinned dependencies and fresh state per episode, and pass^k reported next to pass@1.
  2. Plant impossible tasks. Mix in tasks that cannot be solved honestly, for example ones whose tests contradict the specification. Any pass is a cheat, and the rate measures how much the agent games. ImpossibleBench builds benchmarks this way [18].
  3. Run controls. Score a do-nothing agent, a random agent and a known-weak model. If any of them scores well, the verifier is broken. In our weight-space replication, a norm-only control played the same role: it showed how much of an edit's gain was a temperature change.
  4. Read trajectories. Sample passing episodes and read them. Most hacks above were found by a person, or a monitor, reading what the agent did, not by the score.

What this means for the harnesses we build

Each of our harnesses is defined by its verifier first. SpecBench is graded by the Lean kernel. CircuitHunt plants the circuit, so the right answer is known, and requires every claimed mechanism to survive ablation. DuplexTurn grades timing against the audio clock. TwinGap scores forecasts against real outcomes held back from the agent.

Everything else on the checks list is shared code across all of them.

References

  1. C. E. Jimenez et al. SWE-bench: Can Language Models Resolve Real-World GitHub Issues? ICLR, 2024. arXiv
  2. "Introducing SWE-bench Verified." OpenAI, 2024.
  3. R. Aleithan et al. SWE-Bench+: Enhanced Coding Benchmark for LLMs. 2024. arXiv
  4. H. Zhang et al. A Careful Examination of Large Language Model Performance on Grade School Arithmetic. NeurIPS Datasets and Benchmarks, 2024. arXiv
  5. "Repo State Loopholes During Agentic Evaluation." GitHub, SWE-bench #465, 2025.
  6. S. Yao et al. τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains. ICLR, 2025. arXiv
  7. G.-T. Lin, C. Chen, Z. Chen, H. Lee. Full-Duplex-Bench-v3: Benchmarking Tool Use for Full-Duplex Voice Agents Under Real-World Disfluency. 2026. arXiv
  8. L. Zheng et al. Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena. NeurIPS Datasets and Benchmarks, 2023. arXiv
  9. "Lean 4 kernel soundness bug: forging proofs via nested inductive projections." oss-security, 2026.
  10. Lean 4 issue #14484, on adding declarations without kernel checks. GitHub.
  11. N. Lambert et al. Tulu 3: Pushing Frontiers in Open Language Model Post-Training. 2024. arXiv. DeepSeek-AI. DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning. 2025. arXiv
  12. L. Gao, J. Schulman, J. Hilton. Scaling Laws for Reward Model Overoptimization. ICML, 2023. arXiv
  13. "Faulty reward functions in the wild." OpenAI, 2016.
  14. "Specification gaming: the flip side of AI ingenuity." Google DeepMind, 2020.
  15. "Claude 3.7 Sonnet System Card." Anthropic, 2025.
  16. B. Baker et al. Monitoring Reasoning Models for Misbehavior and the Risks of Promoting Obfuscation. 2025. arXiv
  17. "Recent Frontier Models Are Reward Hacking." METR, 2025.
  18. Z. Zhong, A. Raghunathan, N. Carlini. ImpossibleBench: Measuring LLMs' Propensity of Exploiting Test Cases. ICLR, 2026. arXiv