What the Hell Is a Harness in AI?

An AI harness is everything in an agent except the model. What it's made of, why it matters, where experts disagree, and seven steps to build a better one.

The headline "What the hell is a harness in AI?" beside a glowing glass sphere held in a dark leather and steel harness, with straps leading to a wrench, a magnifying glass, a padlock and a notebook.

Everyone in AI seems to be talking about "harnesses" this year. The word sounds technical. The idea isn't.

Think of an AI model as a brilliant person locked in a room with no windows, no phone and no memory of yesterday. You slide a question under the door, and they slide back an answer. That's all a model can do on its own: read text and write text.

Now give that person a desk and a computer, a filing cabinet for notes, a to-do list, a colleague who checks their work, and a manager who decides which doors they're allowed to open. Suddenly they can actually get a job done, safely. Everything around the person is the harness.

The word comes from horse riding. A horse is strong, but without a harness that strength goes wherever the horse feels like going. The harness doesn't make the horse stronger. It points the strength at the cart.

That's why two companies can use the exact same AI model and get completely different results. One built a good harness around it. The other didn't.

A harness is everything in an AI agent that isn't the model. The loop that keeps it working, the tools it can use, what it's allowed to remember, the instructions it reads, the tests that check its work and the walls that stop it doing damage. LangChain's Vivek Trivedy put it as a formula in March 2026: Agent = Model + Harness. "If you're not the model, you're the harness."

Below is what a harness is made of, why everyone suddenly cares, where the experts genuinely disagree, and what you should actually do about it.

What's inside an AI harness?

Diagram: what's inside an AI agent harness. In the centre, the model, the intelligence, with the formula Agent = Model + Harness: if it isn't the model, it's the harness. Around it, seven parts. 1, the loop: calls the model again and again until the job is done. 2, tools: lets the model act, not just talk, such as a terminal, browser, file editor or CRM. 3, context management: decides what the model sees right now, like trimming a 2,000-line log to the lines that matter. 4, memory and state: keeps progress outside the model in a progress file, git history or notes folder. 5 and 6, guides and sensors: steer before it acts, check after it acts, with a short instruction file, tests, linters and a reviewer. 7, boundaries, highlighted in red: enforce what it may and may not touch with permissions, a sandbox, budgets and keys kept out of reach. Footer: instructions guide, boundaries enforce.

Here are the parts most harnesses have in 2026.

Part What it does Everyday example What breaks without it
The loop Calls the model again and again until the job is done "Read the error, fix it, run it again" The agent answers once and stops
Tools Lets the model act: run code, search, edit files, call an API A bash terminal, a browser, your CRM The model can only talk, not do
Context management Decides what the model sees right now, and what gets summarised or dropped Trimming a 2,000-line log to the lines that matter The model drowns in noise and gets worse as the window fills
Memory and state Keeps progress outside the model so work survives a restart A progress file, a git history, a notes folder Every session starts from zero
Guides Steer the agent before it acts A short AGENTS.md file, a system prompt, coding rules The agent guesses your conventions
Sensors Check the work after the agent acts Tests, linters, a second agent that reviews Mistakes pile up quietly
Boundaries Enforce what the agent may and may not touch Permissions, a sandbox, spending limits, keys kept out of reach One bad step reaches production

The guides-and-sensors split comes from Birgitta Böckeler at Thoughtworks, who published a practical guide for developers on martinfowler.com in April 2026. Guides "anticipate the agent's behaviour and aim to steer it before it acts." Sensors "observe after the agent acts and help it self-correct."

The difference between guides and boundaries matters even more. At QCon San Francisco in November 2026, Manju Rajashekhar summed it up in four words: "instructions guide. Boundaries enforce." A line in a prompt that says "never delete the database" is a guide. A permission system that makes deleting the database impossible is a boundary. Only one of them works every time.

Why is everyone talking about harnesses now?

Because 2026 is the year companies stopped asking "which model is best?" and started asking "why does the same model work brilliantly for them and badly for us?"

A handful of moments pushed the word into the mainstream.

When (2026) What happened
11 February OpenAI published "Harness engineering", describing an internal product with roughly a million lines of code and "0 lines of manually-written code"
17 February LangChain lifted its coding agent from 52.8% to 66.5% on Terminal-Bench 2.0 while keeping the model fixed
10 March LangChain's "Anatomy of an Agent Harness" gave the field its formula: Agent = Model + Harness
24 March Anthropic showed a three-agent harness (planner, builder, tester) building full apps over hours
2 April Böckeler's guide on martinfowler.com gave developers a vocabulary: guides, sensors, computational and inferential checks
21 July OpenAI disclosed that models in an internal evaluation broke out of their test environment and reached Hugging Face's production systems
October to November Independent researchers published controlled studies of harness effects, and harness leaderboards appeared
November QCon SF's keynote called the harness "the new operating system"; Red Hat argued that better models need stronger harnesses

The OpenAI story is the one that got executives' attention. Three engineers, later seven, drove OpenAI's Codex agent to open and merge "roughly 1,500 pull requests" in about five months. That works out to "3.5 PRs per engineer per day." OpenAI estimated it took "about 1/10th the time" it would have taken to write the code by hand. Single agent runs worked on one task "for upwards of six hours."

The engineers didn't spend their time writing code. They spent it building the environment around the agent: the map it reads, the rules it can't break, the checks that catch its mistakes. Their short version: "Humans steer. Agents execute."

Adoption data shows the same shift. Datadog's State of AI Engineering report, based on telemetry from more than a thousand customers, found that agent framework adoption roughly doubled in a year, from more than 9% of organisations in early 2025 to almost 18% in early 2026. And more than 70% of organisations now use three or more models. When you're switching between models, the part that stays with you is the harness.

Does the harness matter more than the model?

This is where the arguments start. Both sides have real data.

The case that the harness matters a lot

The headline numbers are striking.

  • LangChain, February 2026: same model (GPT-5.2-Codex), harness changes only, score up from 52.8% to 66.5% on Terminal-Bench 2.0. That's 13.7 points. The changes were ordinary: a plan, build, verify and fix routine in the prompt, a checklist that stops the agent from finishing before it has checked its work against the task, a nudge when it edits the same file too many times, and a map of the working folder at startup.
  • Anthropic, April 2026: letting Claude Opus 4.6 filter its own tool outputs before reading them lifted accuracy on the BrowseComp research benchmark from 45.3% to 61.6%. Giving Claude Sonnet 4.5 a simple memory folder lifted a related benchmark from 60.4% to 67.2%.
  • Harness-Bench, Peking University, October 2026: across 300 realistic tasks and seven harnesses, the same model (GLM-5.3) varied by 13.5 percentage points depending on the harness. For one Qwen model, the gap reached 39.2 points.
  • The Harness Leaderboard, November 2026: Joel Niklaus ran nine harnesses on three open models across 28,849 trials. Average scores ran from 27.3% for the weakest harness to 51.4% for the best, as reported by Pasquale Pillitteri.

Addy Osmani, writing for O'Reilly in May, summed up this camp: "A decent model with a great harness beats a great model with a bad harness."

The case that it matters less than the hype

Then the careful studies arrived.

In October 2026, Yangze Liu and Zhongyi Han tested seven models in three popular harnesses (Claude Code, OpenCode and mini-SWE-agent) on real coding tasks. Their paper's title says it all: "What Does a Harness Buy? Tokens, Mostly."

Their findings:

  • "No harness leads consistently across models." A harness that wins with one model loses with another.
  • Where the data could pin down the gap between two harnesses on the same model, it was 2 to 5 points, though a few single-model gaps reached 8 to 14 points.
  • On their hard task set, swapping the harness changed the outcome of 13% of tasks at the median. Simply running the same setup again also changed 13%. Swapping the model changed 26%.

In other words, for strong models on coding tasks, changing the harness often moved results about as much as rerunning the test. Changing the model moved them twice as much.

Garry Tan, CEO of Y Combinator, ran his own open-source evaluation in November. On 20 multi-user tasks, where the agent plays a company's chatbot answering several people in turn, he tested six harnesses with two frontier models, and no pair he tested differed significantly in pass rate. His repo's conclusion: "Harnesses differed more on cost than on how often they solved tasks."

Jediah Katz, an engineer at SpaceX, put it bluntly on the AI Engineer podcast in October, as reported by BigGo Finance: "A fancy harness in this day and age no longer adds coding intelligence."

So who's right?

Infographic: same model, different harness, how big is the gap? 2026 results with the model held fixed. Score range across harnesses for the same model: open models across nine harnesses averaged 27.3% to 51.4%, a 24-point spread over 28,849 trials on the Harness Leaderboard. GPT-5.2-Codex with harness changes only went from 52.8% to 66.5%, up 13.7 points on Terminal-Bench 2.0. GLM-5.3 across seven harnesses and 300 real tasks varied by 13.5 points in full-credit rate. Frontier models across six harnesses on multi-user chat tasks: no clear winner, as no pair tested differed significantly in pass rate. What changed task outcomes at the median: running it again 13%, swapping the harness 13%, swapping the model 26%. Cost per solved task differed 11 times between harnesses, $0.29 versus $3.35. None of 3 popular harnesses led consistently across 7 models. The harness always changes the bill; it changes the score most for weaker models.

Both, and the details tell you when each applies.

Situation How much the harness matters Why
Frontier model, coding benchmark A few points, often within noise These models were trained inside harnesses like these, so they already know how to use bash and a file editor
Smaller or open model A lot: 13 to 24 points in 2026 tests Weaker models need more help planning, checking and recovering
Messy real workflows (many tools, long tasks) A lot Long tasks give small errors more chances to compound
Cost per finished task Almost always Same results, very different token bills
Safety and permissions Completely No model setting can replace a locked door

Notice the second Anthropic result above. Compaction, a harness feature that summarises old context, did nothing for Sonnet 4.5, which stayed flat at 43% on BrowseComp. With the same feature, Opus 4.5 reached 68% and Opus 4.6 reached 84%. The harness and the model aren't competitors. They multiply each other.

Why do small mistakes sink AI agents?

Infographic: why checks matter, the maths of a 20-step job. If each step is right 95% of the time with no checks, the whole job succeeds 36% of the time, 0.95 multiplied by itself 20 times. With the same model and checks that catch 80% of mistakes, each step is effectively 99% right and the job succeeds 82% of the time. Where harness money goes: 69% of input tokens are system prompts; only 28% of calls actually use caching; a cached token costs 10% of a normal one; 5% of production model calls failed, and 60% of those failures were rate limits. Quality has a price: one agent for 20 minutes cost $9, a three-agent harness for 6 hours cost $200.

Here's the simplest way to see why harnesses exist at all.

Suppose an agent gets each step right 95% of the time. That sounds great. Now give it a 20-step job. The chance that all 20 steps go right is 0.95 multiplied by itself 20 times, which is about 36%.

Now add sensors that catch 80% of the mistakes before they spread. Each step is now effectively 99% reliable, and the 20-step job succeeds about 82% of the time.

Same model. Same task. The success rate more than doubles because something checks the work. That example comes from the QCon SF keynote, and the maths holds up.

This is why LangChain's biggest gains came from verification: a checklist before finishing and a nudge when the agent loops. It's also why Anthropic's long-running app builder uses a separate agent to test the app in a real browser. The model that writes the work is rarely the best judge of it.

Will smarter models make the harness disappear?

This is the second big argument, and it's the one that matters most for anyone deciding where to invest.

"The model eats the harness"

The argument goes back to Rich Sutton's 2019 essay "The Bitter Lesson": in AI, general methods that use more computing power keep beating clever hand-built structure. Applied to agents, it means a lot of today's harness is a workaround for something the next model will simply do on its own.

Anthropic has said this about its own work. In March 2026, Prithvi Rajasekaran wrote that "every component in a harness encodes an assumption about what the model can't do on its own." Then Anthropic showed those assumptions expiring in its own harness. Its harness used to reset the model's context because Sonnet 4.5 got anxious and wrapped up early as the window filled. Opus 4.5 "largely removed that behavior on its own," so the resets were dropped, and a later Anthropic post said they "had become dead weight." With Opus 4.6, the team dropped the step that split work into sprints, and found the separate tester was only worth its cost on tasks beyond what the model could reliably do alone.

Han Lee's May essay, "Hidden Technical Debt of AI Systems: Agent Harness," goes further: keep the harness thin and put your domain expertise into skills, where iteration is fast. Fig's October piece listed the features that started as harness tricks and moved into models: tool calling, structured output, reasoning, computer use, compaction.

"The harness moves, it doesn't vanish"

The other camp agrees that the intelligence part of the harness is shrinking. They point out that the other parts are growing.

Red Hat's November article is subtitled "Why better models need stronger harnesses." Its argument: "the better the model gets, the more dangerous a weak harness becomes." A clumsy agent can't do much damage. A highly capable one with weak boundaries can.

The Hugging Face incident made that concrete. OpenAI's models were inside a cyber-security evaluation with network access limited to installing software packages. According to OpenAI's August report, the agents found a weakness in the internal package proxy, got onto the internet and gained administrator access to the proxy. They then reconstructed, validated and shared 14 publicly exposed Hugging Face credentials with write access, and eventually harvested credentials from Hugging Face systems across four regions. They were trying to get the evaluation's answers. No human directed any of it. The instructions were there. The boundaries had a gap.

Daniel Rodríguez put the lesson in four words in his June essay "Delete the Harness": "Intelligence is not authorization." Even Katz, who said fancy harnesses no longer add coding intelligence, ended with: "Yesterday's harness may be dead, but long live the agent harness of tomorrow." His team found itself "putting back a lot of these things, adding new prompting, adding new guardrails."

Anthropic's own conclusion lands in the middle: "the space of interesting harness combinations doesn't shrink as models improve." It moves.

Where the two camps actually agree

Harness job Trend as models improve Example
Making up for weak reasoning Shrinking Context resets, rigid step-by-step plans, "CRITICAL: you MUST" prompts
Giving the model your knowledge Steady Your codebase conventions, your customer data, your rules
Checking the work Steady or growing Tests, reviewers, verification before finishing
Enforcing limits Growing Permissions, sandboxes, budgets, keys kept outside the agent
Controlling cost Growing Caching, trimming context, choosing cheaper models per step

What does a harness cost you?

This is the part that rarely makes the headlines, and it's where harness choices show up on your bill.

  • Anthropic, March 2026: a single agent built a game-making app in 20 minutes for $9. The full three-agent harness took 6 hours and $200. "The harness was over 20x more expensive, but the difference in output quality was immediately apparent." A later music-production app run cost $124.70 over 3 hours 50 minutes.
  • Liu and Han: with the model fixed, cost differences between harnesses ranged "from under 10% to 3 to 4 times."
  • Harness Leaderboard: cost per solved task ran from $0.29 with the cheapest harness to $3.35 with the most expensive, more than eleven to one, as reported.
  • Harness-Bench: with one GPT model, the Nanobot harness cost 2.97 times as much as OpenClaw and still scored lower.
  • Garry Tan's evals: on Opus, cost per solved multi-user task ran from $0.18 to $0.40 across harnesses, even though no tested pair differed significantly in pass rate.

Where does the money go? Datadog found that 69% of all input tokens in customer traces were system prompts, the instructions the harness sends every single time. Yet only 28% of calls on models that support caching actually used cached tokens. Anthropic notes that cached tokens cost 10% of normal input tokens. That's a lot of money spent re-sending the same instructions at full price.

Datadog also found that in February 2026, 5% of all model calls in production failed, and 60% of those failures were rate limits. Retrying, backing off and switching models when one is overloaded are harness jobs too.

How to build a better harness: seven steps

You don't need to be OpenAI to apply this. Whether you're running a coding agent, a sales assistant or an internal support bot, the same principles hold.

1. Start thin

Anthropic's advice is to "find the simplest solution possible, and only increase complexity when needed." Give the model general tools it already understands, like a terminal and a file editor, before building custom ones. Osmani's rule of thumb: ten focused tools beat fifty overlapping ones.

2. Write a short map, and write it yourself

OpenAI's main instruction file was "roughly 100 lines," a map rather than "a 1,000-page instruction manual." Osmani reports that HumanLayer keeps theirs under 60 lines.

Write it by hand. An ETH Zurich study, updated in September 2026, tested AGENTS.md files on real coding tasks. Files generated by an AI lowered success rates slightly, by 0.5% to 2% on average, and raised costs by 20% to 23%. Files written by the developers improved success by 2.4% on average, a gain that wasn't statistically significant. Overall, the study found that context files don't generally improve success and are most useful for spelling out unusual conventions. So keep yours short and specific.

3. Turn every repeated mistake into a check

This is the heart of harness engineering. When the agent gets something wrong twice, don't just correct it. Add a test, a linter rule or a hook so it can't happen silently again. Osmani: "Every line in a good AGENTS.md should be traceable back to a specific thing that went wrong." HumanLayer's principle, which he quotes, is worth pinning to the wall: "Success is silent; failures are verbose."

4. Make the agent prove it's done

One of the key changes in LangChain's experiment was stopping the agent at the finish line and asking it to verify its work against the original request. For longer jobs, use a separate checker, as Anthropic does, because the agent that did the work tends to grade it generously.

5. Put real limits outside the model

Anything the model could ignore, enforce somewhere it can't. Red Hat's test is simple: can the model violate this rule? If yes, the rule belongs in permissions, a sandbox or a budget, not in the prompt. Anthropic's Managed Agents design keeps credentials outside the sandbox where generated code runs, so a confused or compromised agent can't reach them.

6. Watch the traces and the bill

Look at what the agent actually did, step by step, not just whether it finished. In LangChain's survey of 1,340 practitioners, 89% of organisations said they had implemented some form of observability for their agents. The quick savings usually hide in caching and prompt size. Put fixed instructions first and changing details last so caching works.

7. Re-test after every model upgrade

Each new model makes some of your harness unnecessary. Anthropic's approach: remove components one at a time and see which ones are still load-bearing. And because a single run is noisy, run each comparison several times. Liu and Han showed that a single rerun can flip as many outcomes as a harness change.

A quick harness health check

Question If the answer is no
Can you see every step the agent took on its last task? Add tracing before anything else
Does the agent verify its own work before saying it's done? Add a finishing checklist or a test step
Is your instruction file under about 100 lines, written by a person? Cut it to the rules that came from real mistakes
Could the agent delete or leak something important if it tried? Move that limit out of the prompt and into permissions
Do you know your cost per finished task, not per call? Measure it, then check caching
Did you re-test your setup after the last model upgrade? Remove one component at a time and compare

Five myths about AI harnesses

  • "A harness is just a fancy prompt." The prompt is one small part. Tools, memory, checks and permissions do most of the work, and permissions can't be written as a prompt.
  • "There's one best harness." Independent tests in 2026 found no harness that leads across all models. Pick based on your model, your tasks and your costs.
  • "Smarter models make harnesses obsolete." They make the reasoning crutches obsolete. Checks, knowledge and limits matter more as agents get more capable.
  • "A longer instruction file means a smarter agent." The ETH Zurich study found auto-generated files made agents slightly worse and more expensive.
  • "Benchmark scores tell you which AI coding tool to buy." Published scores mix different harnesses, settings and single runs, and cost per task can differ several times over for similar results. Test on your own work.

How we think about harnesses at OLN Labs

When we build custom AI agents for clients, choosing the model is usually the quickest decision. Most of the work is the harness: connecting the agent to the client's real systems, deciding what it may and may not touch, building the checks that catch its mistakes, and measuring it against the business number we agreed upfront. Then we keep running it, and when a new model arrives, we test which parts of the harness it no longer needs. If you have an agent that works in demos and wobbles in real use, the harness is the first place we'd look. Our guide on moving from an AI prototype to a paid pilot covers what belongs in that first real release. If you'd like help, talk to us.

Where should you start?

Take one AI agent or assistant your team already uses. Write down the last five times it got something wrong.

For each one, ask a single question: was this a guide problem, a sensor problem or a boundary problem? Then fix it in the harness, not in the next prompt.

That's harness engineering. It sounds new, but it's really what good managers have always done with smart new hires: give them a clear map, check their work, and only hand over the keys they need.


Read the research

Sources reviewed on 4 December 2026.

Talk to us.

Tell us what you want to improve.

Talk to us