Run Claude Fable 5 inside Claude Code and it solves 83.8% of Terminal-Bench 2.1. Run the identical weights inside Terminus 2 and it solves 80.4%. Gemini 3 Pro goes the other way: 73.9% in Terminus 2, 65.8% in Gemini CLI, its own vendor's tool.1 Nobody retrained anything between those runs. The model file is the same. What changed is the software around it, and that software is the subject of this book.
Same weights, different scores
The gap is real, it repeats across benchmarks, and in controlled studies it is larger than the gap between models.
Leaderboard rows are the weakest evidence, so start there. The Terminal-Bench differences are 3 to 8 points with error bars around 1.2 points: real, but modest.1 Older numbers point the same way. Anthropic reported Claude 3.7 Sonnet at 63.7% on a 489-task subset of SWE-bench Verified in a plain setup and 70.3% on the same subset once it added parallel attempts, regression-test filtering and a ranking model.2 An aggregator tracking SWE-bench Pro shows Claude Opus 4.5 at 45.89% in Scale AI's independent run under a SWE-agent scaffold and 51.80% under Auggie CLI. The three higher rows come from one comparison published by Augment Code, which makes Auggie, so treat them as a vendor's numbers.3
| Model (held constant) | Benchmark | Harness | Run by | Score |
|---|---|---|---|---|
| Claude 3.7 Sonnet | SWE-bench Verified (489 tasks) | Plain | Anthropic | 63.7% |
| Claude 3.7 Sonnet | SWE-bench Verified (489 tasks) | Custom scaffold + parallel compute | Anthropic | 70.3% |
| Claude Opus 4.5 | SWE-bench Pro | SWE-agent | Scale AI (SEAL) | 45.89% |
| Claude Opus 4.5 | SWE-bench Pro | Claude Code | Augment Code | 49.75% |
| Claude Opus 4.5 | SWE-bench Pro | Cursor | Augment Code | 50.21% |
| Claude Opus 4.5 | SWE-bench Pro | Auggie CLI | Augment Code (vendor) | 51.80% |
The controlled studies are the best evidence so far. All of them are 2026 arXiv preprints, so weigh them as such. Sydney Lewis froze a model and changed how the harness manages its working view of the record. Once the estimated prompt reaches half the window, the newest four tool results stay whole; older ones keep their beginning and end around an omission marker, and the character cap halves each time a result's age doubles. The full result stays in memory; only the model's view shrinks. The treatment also points out repeated failing commands and steers the model toward a different action. On 169 SWE-bench Verified tasks with a 20,480-token window, the fail-to-pass rate went from 28% to 49% and complete solutions from 43 to 72.4 An audit of 254 SWE-bench submissions found a within-model scaffold effect of 29.8 points against a model effect of only 8.8 points across the top 30, where no adjacent pair could be separated at α=0.05.5 On GAIA, scaffold choice alone moved one model's accuracy by up to 28 points.6 Zhang and colleagues call this the Binding Constraint Thesis: harness variance can exceed model variance, sometimes enough to reverse model rankings.7
01 · Pick a model. Swap its harness. The weights never move.
Gemini 3 Pro: its own vendor's CLI is its worst harness.
02 · Freeze the model. Flip one harness knob.
03 · Which lever is bigger? (254 SWE-bench submissions)
Naming the thing
Vivek Trivedy of LangChain wrote it as an equation in March 2026: “Agent = Model + Harness.” His gloss is short: “If you're not the model, you're the harness.”8 Three weeks later Birgitta Böckeler of Thoughtworks took up the equation, linking to his post, and split the harness into concentric layers.9 The inner harness is what the vendor ships, such as the system prompt and the code retrieval mechanism. The outer harness is what you add: instruction files, MCP servers, scripts.
The practice had been described a month before the equation. In February 2026 Mitchell Hashimoto wrote about it as a habit rather than a formula, fixed either in an AGENTS.md file or in a real tool like a screenshot script or a filtered test runner. He did not claim the term. He wrote that he did not know of an industry-accepted name and had “grown to calling this ‘harness engineering.’”10
“Anytime you find an agent makes a mistake, you take the time to engineer a solution such that the agent never makes that mistake again.”— Mitchell Hashimoto (2026)
Credit is messier than any one post suggests. Hashimoto never writes the equation. The encyclopedia entry calls the attribution of “harness engineering” contested, with some accounts tracing it to Hashimoto and others to Trivedy. It notes that the UK AI Security Institute described an agent as the model plus its scaffold in 2023, and lists “agent scaffolding” as a synonym.11 The components it names are the ones this book covers: tool dispatch, memory and state, a sandbox, context management, guardrails.
Vendors and researchers now define it the same way. OpenAI calls the harness "the layer between your application and the model," responsible for conversation state, tool use, approval policy, failure handling and progress reporting.12 A source-code study of 11 production coding harnesses found seven subsystems and 29 recurring patterns.13 OpenAI also ran the extreme version: a product of roughly a million lines, built in about five months with no hand-written source, where engineers steered through pull requests and CI.14 Reporting on it, Martin Fowler summed up the scope: "Harness includes context engineering, architectural constraints, and garbage collection."14
A short history of the loop
Every harness still runs the same loop from 2022. What changed was everything around it.
ReAct gave the loop its shape: reason, act, observe the result, repeat. Interleaving thought with tool calls beat prior methods by 34 points on ALFWorld and 10 on WebShop.15 In 2023 AutoGPT took that loop and let it run unattended. It showed the appetite was enormous; the repository sits at 187.7k stars.16 It also showed that a loop with no verification and no environment design is a demo, not a worker.
The next step moved the effort from the prompt to the interface. In March 2024 Devin shipped a shell, an editor and a browser inside a sandbox and posted 13.86% on a random 25% subset of SWE-bench, against a prior best of 1.96% measured on the full set, so the two are not like-for-like. Cognition noted that even when handed the exact files to edit, the best earlier models resolved only 4.80%.17 Two months later SWE-agent named the lever. Its authors coined "agent-computer interface" and reached 12.5% pass@1 by redesigning the commands and feedback the model sees, not the model.18
Anthropic's late-2024 guidance turned that into design rules: separate workflows (predefined code paths) from agents (models directing their own process), shape tools so mistakes are hard to make, and start with direct API calls before reaching for a framework.19 Production systems took the advice. None of the 11 harnesses in the source-code study imports a general-purpose agent framework.13 Then the harness became the product. Claude Code ships with instruction files, hooks and verification loops as first-class features,20 and OpenAI now pitches Codex as an open harness that others build on.12
Prompt, context, harness
Each discipline in this lineage widened what the engineer controls, and the last step crossed from advice to enforcement.
Prompt engineering tuned words. Context engineering, in Anthropic's framing, is its "natural progression": the question becomes what configuration of context is most likely to produce the behavior you want, given that a model has a finite attention budget to spend across every token in the window.23
Harness engineering is about what sits outside the window: tools, hooks, evaluators, resets, sandboxes. The Claude Code documentation draws the line that matters most. It calls the context window "the most important resource to manage," treats instruction files like CLAUDE.md as advisory, and describes hooks as "deterministic and guarantee the action happens."20 An instruction asks the model to behave. A hook makes the behavior happen whether the model complies or not. That gap between advisory and deterministic is the hinge between context engineering and harness engineering.
Böckeler's test for a good outer harness follows from it: raise the odds the agent gets it right the first time, and give it feedback loops to correct itself before a human ever reviews the work.9
Why the money cares
Most agent and generative AI projects fail to pay off, and the reasons named are about integration, not intelligence.
Gartner predicted in June 2025 that more than 40% of agentic AI projects will be cancelled by the end of 2027, citing cost, unclear value and weak risk controls.24 Gartner analyst Verma described most current projects as early experiments "mostly driven by hype." In a poll of 3,412 respondents, 19% had made significant agent investments, 42% conservative ones and 31% were waiting. Gartner counted only about 130 genuine agent vendors among thousands claiming the label, and called the rest "agent washing."24
A separate study measures a different population. MIT NANDA's July 2025 report, as Fortune headlined it, found about 95% of enterprise generative AI pilots delivered little to no measurable P&L impact.25 The report rests on 52 organization interviews, 153 surveyed leaders and a review of 300+ public initiatives.n1 That figure covers generative AI pilots broadly, not agents, so it should not be quoted as an agent failure rate. Its diagnosis is the useful part: the cause was a "learning gap" and poor integration into workflows, not model quality. Purchased tools and external partnerships reached deployment about 67% of the time, internally built tools about 33%: “twice the success rate.” The authors call the rates self-reported and say the correlation “does not necessarily prove causation.”n1
For a budget owner that last figure reads like an argument against building anything, and so against this book. The report does not split the harness, but the split resolves it: buy the inner harness, own the outer one. The vendor's loop, sandbox and tracing are products, and rebuilding them is a poor use of a team. Your context, tools, permission policy and eval suite encode your own workflows, and no vendor can ship those. Part 06 covers where to draw that line and how to staff and govern it.
Read together, both reports point at the layer this book is about. The harness is the integration: what the system remembers, what it is allowed to touch, how it checks its own work. It is also where the cost goes. Anthropic's planner, generator and evaluator setup cost about $200 and six hours against $9 and twenty minutes for a solo agent, for output it called dramatically better.22 That spend buys the harness, not a better model.
The people who build the outer harness
If integration is where projects die, someone has to do the integrating. The industry's answer is a job title Palantir pioneered in the early 2010s, the forward deployed engineer, and reported FDE job postings grew more than 800% between January and September 2025.27 The model labs now hire for the seat. OpenAI's FDEs “lead complex end-to-end deployments of frontier models in production” and are measured on “eval-driven feedback that changes product and model roadmaps.”28 Anthropic's embed with customers to deliver “MCP servers, sub-agents, and agent skills.”29 In this book's terms, that is building the outer harness by hand.
The vendor gets back what no benchmark provides: field failures, which become evals and patterns that flow into the inner harness everyone else uses.29 Critics, including Palantir veterans, warn that the role degrades into consulting with a new title when customer fixes never reach the product.30 Part 06 covers who owns this work inside your own organization.
Built to be deleted
Every piece of a harness is a bet against a specific model weakness, which is why good harnesses are designed to shrink.
“Every component in a harness encodes an assumption about what the model can't do on its own, and those assumptions are worth stress testing…”— Prithvi Rajasekaran, Anthropic (2026)
The examples are concrete. Agents asked to grade their own output tend to praise it even when it is mediocre, so Anthropic split the evaluator from the generator.22 Long-running agents lose state across context resets, declare victory early and leave broken environments behind, so the fix was an initializer agent, a feature list, a progress file and a fixed startup routine.21 Each of those is scaffolding around a known gap. When the gap closes, the scaffolding should go. The catch, in Rajasekaran's words, is that the space of interesting harness combinations "doesn't shrink as models improve. Instead, it moves."22
That is the frame for the rest of this book, which has seven parts: this prologue, five chapters for the harness's five subsystems, each built around a different model limitation, and Part 06 on operating them:
- The Loop: how the agent decides, acts and knows when to stop.
- Context: what the model sees, and what you leave out.
- Tools & Environment: the interface the model acts through.
- Guardrails & Trust: what it is allowed to do, enforced rather than requested.
- Evals & Evolution: how you know the harness helps, and when to remove a piece.
- Operating the Harness (Part 06): who owns, funds, governs and measures it, for program owners.
Start with the loop. Everything else hangs off it.
References
- Snorkel AI, “Terminal-Bench 2.1 leaderboard,” Snorkel AI, accessed Oct 2026. snorkel.ai/leaderboard/terminal-bench-2-1
- Anthropic, “Claude 3.7 Sonnet and Claude Code,” Anthropic, Feb 2025. anthropic.com/news/claude-3-7-sonnet
- Future AGI, “Coding Agent Harness Benchmarks” (secondary aggregator), Future AGI, checked Oct 2026. futureagi.com/blog/coding-agent-harness-benchmark
- Sydney Lewis, “Same Model, Different Harness: Different Coding-Agent Results,” arXiv, Aug 2026. arxiv.org/abs/2608.26218
- Liu, Liu, Sun, Luo, Guo, “Coding Agents Have Converged,” arXiv, Sep 2026. arxiv.org/abs/2609.17394
- Jason Starace, “Scaffold Effects on GAIA: A Controlled Comparison,” arXiv, Jun 2026. arxiv.org/abs/2606.08529
- Zhang, Wang, Ge, Xu, Hamm, Reddy, “Stop Comparing LLM Agents Without Disclosing the Harness,” arXiv, May 2026. arxiv.org/abs/2605.23950
- Vivek Trivedy, “The Anatomy of an Agent Harness,” LangChain, Mar 2026. langchain.com/blog/the-anatomy-of-an-agent-harness
- Birgitta Böckeler, “Harness Engineering for Coding Agent Users,” martinfowler.com / Thoughtworks, Apr 2026. martinfowler.com/articles/exploring-gen-ai/harness-engineering
- Mitchell Hashimoto, “My AI Adoption Journey,” mitchellh.com, Feb 2026. mitchellh.com/writing/my-ai-adoption-journey
- Wikipedia, “Agent harness,” Wikipedia, accessed Oct 2026. en.wikipedia.org/wiki/Agent_harness
- OpenAI, “Codex as a platform: build on the open agent harness,” OpenAI Developers, Aug 2026. developers.openai.com/blog/codex-as-a-platform
- Barbaste, Darrigol, Vu, Wiltberger, “Harness Engineering: Anatomy, Architecture, and Evolution of Coding Agents,” arXiv, Jul 2026. arxiv.org/abs/2609.00006
- InfoQ, “OpenAI Introduces Harness Engineering” (secondary; primary at openai.com/index/harness-engineering), InfoQ, Feb 2026. infoq.com/news/2026/02/openai-harness-engineering-codex
- Yao et al., “ReAct: Synergizing Reasoning and Acting in Language Models,” arXiv, Oct 2022. arxiv.org/abs/2210.03629
- Significant-Gravitas, “AutoGPT,” GitHub, accessed Oct 2026. github.com/Significant-Gravitas/AutoGPT
- Cognition, “Introducing Devin,” Cognition, Mar 2024. cognition.com/blog/introducing-devin
- Yang, Jimenez, Wettig, Lieret, Yao, Narasimhan, Press, “SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering,” arXiv, May 2024. arxiv.org/abs/2405.15793
- Anthropic, “Building effective agents,” Anthropic Engineering, Dec 2024. anthropic.com/engineering/building-effective-agents
- Anthropic, “Best practices for Claude Code,” Claude Code docs, accessed Oct 2026. code.claude.com/docs/en/best-practices
- Anthropic, “Effective harnesses for long-running agents,” Anthropic Engineering, Nov 2025. anthropic.com/engineering/effective-harnesses-for-long-running-agents
- Prithvi Rajasekaran, “Harness design for long-running apps,” Anthropic Engineering, Mar 2026. anthropic.com/engineering/harness-design-long-running-apps
- Anthropic, “Effective context engineering for AI agents,” Anthropic Engineering, Sep 2025. anthropic.com/engineering/effective-context-engineering-for-ai-agents
- RCR Wireless, “Gartner: more than 40% of agentic AI projects will fail by 2027” (secondary; Gartner press release, Jun 2025), RCR Wireless, Jun 2025. rcrwireless.com/20250627/business/agentic-ai-gartner
- Fortune, “MIT report: 95% of generative AI pilots at companies are failing” (secondary; MIT NANDA, The GenAI Divide), Fortune, Aug 2025. fortune.com/2025/08/18/mit-report-95-percent-generative-ai-pilots
- Challapally, Pease, Raskar (MIT NANDA), “The GenAI Divide: State of AI in Business 2025,” MIT NANDA, July 2025. mlq.ai/media/quarterly_decks/…State_of_AI_in_Business_2025…
- Fast Company, “Postings for this AI job are up 800%” (secondary; reports Financial Times / Indeed data), November 2025. fastcompany.com/91435680
- OpenAI, “Forward Deployed Engineer (FDE),” OpenAI Careers, accessed October 2026. openai.com/careers/forward-deployed-engineer
- Anthropic, “Forward Deployed Engineer, Applied AI,” job posting (Greenhouse), accessed October 2026. job-boards.greenhouse.io/anthropic/jobs/5391021008
- Ted Mabrey, “Sorry, that isn’t an FDE,” Substack, September 2024. tedmabrey.substack.com/p/sorry-that-isnt-an-fde