All posts

What is a harness in AI? The software that turns a model into an agent

Users of Claude Code, Anthropic’s coding agent, spent several weeks in the spring of 2026 reporting that its work had got worse. Anthropic traced the reports to three changes: a lower default for how long the model thinks, a bug that made it drop its earlier reasoning, and one sentence added to its instructions. The model was not the cause, Anthropic wrote: “The API was not impacted.” All three sat in the software around the model, which the industry has come to call the harness. Which harness runs an agent decides how well it works and what it is allowed to touch.

Patric Slis
Patric Slis27 November 2026 · 14 min read
A different harness lifted the score three times as much as a newer modelTasks solved out of 100 on Terminal-Bench 2.0: Claude Opus 4.5 and 4.6 in Claude Code, and Opus 4.6 in Meta‑Harness.
The short answer

Definition: a harness in AI, also called an agent harness, is the software around an AI model that lets it act. It runs the model in a loop, gives it tools such as files and a command line, decides what the model sees at each step and what it may do without asking. Model and harness together make an agent.

In one line: the model decides the next step, the harness carries it out and reports back.

Is a harness the same as an agent? No. The agent is the whole: a model and a harness working together. Anthropic says so in its guide to testing agents: “When we evaluate ‘an agent,’ we’re evaluating the harness and the model working together.” What an agent is and which kinds exist is covered in What is an AI agent?

What is an agent harness?

An agent harness is everything around a language model that turns its text into work. The model only predicts the next words. The harness hands it a task, offers it tools, runs the commands the model asks for, feeds the results back and repeats until the task is finished or a limit stops it.

Ethan Mollick, who teaches at the Wharton School and writes for a general audience, explains the word with the horse harness, which “takes the raw power of the horse and lets it pull a cart or plow”. A language model on its own writes a command. The harness decides whether it runs, in which folder and with whose permissions.

The shortest definition comes from LangChain, a company that makes software for building agents: “Agent = Model + Harness.” Its author adds a rule of thumb: “If you’re not the model, you’re the harness.” Anthropic’s documentation describes its own product, Claude Code, as “the layer around the model that provides the tools and manages the context the model sees.” OpenAI’s Codex, Google’s Antigravity and the open-source Hermes Agent are harnesses of the same kind.

What does harness mean in LLM work? Two different things, which is why the word causes confusion. An agent harness wraps a model so that it can work. An evaluation harness wraps a model or an agent so that it can be tested. Anthropic defines both on one page, and a 2026 study of harnesses sums up the difference as “Same word, opposite direction of wrapping.”

What is inside an agent harness?

An agent harness is built from seven parts: the loop, the connection to the model, tools, memory and context, permissions, coordination of helper agents, and a way to add extensions. Wavestone’s AI lab read the source code of eleven coding harnesses in July 2026 and found that every one of them takes a position on the same seven.

The seven parts every agent harness has, and the model in the middle
Loop
Gather context, act, check the result, repeat
Model connection
Sends each step to the model and reads the reply
Tools
Files, command line, browser, web search
Memory and context
Project notes, summaries of long sessions
Permissions
What runs without asking, sandbox, blocked actions
Helper agents
Hands parts of a task to agents with their own context
Extensions
Skills, plugins, connections to other systems
The seven parts follow the study by Wavestone’s AI lab, Harness Engineering: Anatomy, Architecture, and Evolution of Coding Agents, July 2026. Drawing and plain-language descriptions are ours.

The loop is the engine. Claude Code describes its own in three phases: “gather context, take action, and verify results.” Tasks take many rounds. The agent company Manus wrote in 2025 that a typical task needed around 50 tool calls, and that the model read about a hundred tokens for every token it wrote. Why that ratio drives the bill is part of our post What is a token in AI?

Tools are what let the model touch anything. Without them, in Anthropic’s words, the model “can only respond with text.” The number varies widely. The Wavestone study found harnesses with a single tool, the command line, and others with more than a hundred built-in tools.

Memory in a harness is often a plain text file the harness loads at the start of every session, such as CLAUDE.md or AGENTS.md. More than 60,000 open-source projects carried an AGENTS.md file by December 2025, according to the Linux Foundation. Anthropic’s documentation adds a caution about such files: “They aren’t enforced configuration.” An instruction written there is advice to the model, and only a separate check in the harness can block an action.

Context management takes over when a long task fills the model’s working memory. The harness then condenses the conversation so far into a summary and carries on. Claude Code’s documentation names the price: “detailed instructions from early in the conversation may be lost.”

Lines of code in four agent harnesses
Mini-SWE-Agent
about 100
Claude Code
more than 512,000
Hermes Agent
about 642,000
Codex
about 1.1 million
Mini-SWE-Agent, Hermes Agent and Codex: Wavestone, July 2026. Claude Code: count by The Register and Ars Technica of the source code that was published by accident on 31 March 2026; Anthropic has published no figure. Counts in different programming languages and by different methods; the study’s authors say they are not directly comparable. Anthropic called the incident “a release packaging issue caused by human error, not a security breach.”

How big is an agent harness? Anywhere from about 100 lines of code to more than a million. The 100-line harness, a research baseline from Princeton and Stanford, reports results on a well-known coding benchmark “in the same range as systems three orders of magnitude larger”, according to Wavestone. The large products carry what a benchmark does not test: permissions, plugins, interfaces and company settings. None of the eleven harnesses in the study is built on a general-purpose agent framework.

Harness vs model: how much does the harness change the result?

The harness can change the result as much as a new model generation, or more. On Terminal-Bench 2.0, a test of 89 tasks at the command line, Claude Opus 4.6 solved between 58.0% and 76.4% of the tasks depending on which of ten harnesses ran it. The previous model, in the same harness, scored 5.9 points less.

Claude Opus 4.6 in ten harnesses
Meta-Harness
76.4
Capy
75.3
Terminus-KIRA
74.7
MAYA-V2
72.1
TongAgents
71.9
Droid
69.9
Crux
66.9
Mux
66.5
Terminus 2
62.9
Claude Codethe maker’s own
58.0
GPT-5.5 in four harnesses
NexAU-AHE
84.7
Capy
83.1
Codex CLIthe maker’s own
82.2
clnkr
66.1
Chinese models in two or three harnesses
MiniMax M2.1
Crux
36.6
Terminus 2
29.2
GLM 4.7
Terminus 2
33.4
Crux
33.3
Kimi K2 Instruct
Terminus 2
27.8
OpenHands
26.7
Qwen 3 Coder 480B
Dakou Agent
27.2
OpenHands
25.4
Terminus 2
23.9
Terminal-Bench 2.0, share of tasks solved in per cent, as listed on tbench.ai; models released between July 2025 and April 2026. Each result has a margin of about 2 to 3 points. We did not check who submitted each entry.

The spread is not a verdict on any one product. The Claude and GPT rows date from the first half of 2026 and measure the Claude Code of that time. The top entry, Meta-Harness, was found by a research program that rewrites harnesses automatically. With Gemini 3.1 Pro, Google’s own Gemini CLI is also last of three, and with GPT-5.5, OpenAI’s Codex CLI sits within 2.5 points of the best harness. A harness tuned for one benchmark is not automatically better at your work. Anthropic showed in February 2026 that the hardware settings of the test alone moved this benchmark by up to six points. Its rule of thumb: gaps below three points “deserve skepticism until the eval configuration is documented and matched”.

Chinese models were rarely run in more than one harness, and only in older versions: MiniMax M2.1 scored 7.4 points more in Crux than in Terminus 2, while GLM 4.7, Kimi K2 and Qwen 3 Coder moved by 3.3 points at most, about the size of the margin. On the site’s newer version, Terminal-Bench 4.1, most models appear only in their maker’s harness, and Claude Code ranks second. The newer models from Moonshot, Zhipu, DeepSeek and Alibaba appear there only in Claude Code, Anthropic’s harness.

LangChain ran the experiment on purpose. In February 2026 it changed only the instructions, tools and checks of its own coding agent, “kept the model fixed”, and climbed from 52.8% to 66.5% on the same benchmark. The changes were unglamorous: make the agent test its own work, tell it what kind of machine it runs on, and stop it from repeating an edit that keeps failing.

The effect also works the other way. Anthropic’s account of 23 April 2026 describes the three harness changes behind its users’ complaints. The added sentence told the model to keep text between tool calls to 25 words or fewer, and on one of Anthropic’s evaluations it cost 3% for two Opus models. Anthropic reverted the two settings, fixed the bug by 20 April and reset its subscribers’ usage limits. Google makes a related point about its own older tool: the Gemini CLI README says its harness “isn’t tuned for Gemini 4+ and produces unrepresentative scores” with newer models.

Harness vs framework, SDK and agent: what is the difference?

A framework is a kit for building an agent. A harness is a finished system that a model already runs in. In the words of the Wavestone study, a framework “is a library the developer imports to build an agent; a harness is a runtime the developer works inside of”. In 2026 the two keep moving closer.

TermWhat it isExamples
ModelThe trained AI that reads text and predicts what comes next. On its own it can only answer.Claude Opus, GPT-5.5, Gemini, Mistral Large
HarnessThe finished system around a model that lets it work: loop, tools, memory, permissions.Claude Code, Codex, Hermes Agent, OpenCode
FrameworkA programming kit that developers use to build their own agent.LangChain, OpenAI Agents SDK, Google ADK
SDK of a harnessAn existing harness offered as a library, so it can run inside other products.Claude Agent SDK
RuntimeThe layer that keeps an agent running reliably in production. The word has no agreed place.LangGraph
ScaffoldThe older word for a harness, still common in research.Used by METR since 2023
Evaluation harnessA test rig that runs a model or an agent through a benchmark.lm-evaluation-harness, Inspect

Is Claude Code a harness? Yes, in Anthropic’s own words: “Claude Code is a flexible agent harness.” The model inside is Claude. Claude Code is everything around it. Not everyone draws the line there: a Red Hat engineer argues that the word should cover only the layer a user builds on top of such a product, and calls the product itself a runtime.

Is ChatGPT a harness? ChatGPT is an app with a harness inside. Mollick puts it in four words: “Apps come with a harness.” OpenAI uses the term for Codex, and we found no OpenAI page that calls ChatGPT itself a harness.

Is the Microsoft Agent Framework a harness? It is a framework, and since 22 July 2026 it ships a harness as one of its parts. Microsoft describes it as “an opinionated, batteries-included Harness for research, coding, data analysis, and other long-running work.”

Agent harness vs MCP? MCP, the Model Context Protocol, is a plug standard for connecting tools and data to an AI application. The harness is the system that uses the plugs. Most harnesses now speak the same open formats: MCP for tools, AGENTS.md for project notes and Agent Skills for packaged know-how. All three are now run by the same neutral body, the Agentic AI Foundation, which counted 305 member organisations in October 2026.

What is harness engineering?

Harness engineering is the work of improving an agent by changing what surrounds the model: its instructions, tools, checks and permissions. Mitchell Hashimoto, co-founder of the software company HashiCorp, described it in February 2026: whenever an agent makes a mistake, “you take the time to engineer a solution such that the agent never makes that mistake again”.

Hashimoto did not claim the phrase as his own. Within two weeks it appeared in posts by OpenAI, by LangChain and on Martin Fowler’s site, where Birgitta Böckeler of Thoughtworks splits the work into guides that steer the agent before it acts and sensors that check its work afterwards. Her summary of the human’s role: “to steer the agent by iterating on the harness.”

OpenAI’s post makes the boldest claim. A team reports building an internal product of about a million lines of code in five months with “0 lines of manually-written code”. Three engineers, later seven, merged about 1,500 pull requests and spent their time designing the environment the agents worked in. The figures are OpenAI’s own and the product is not named. Before the team automated its clean-up, it spent every Friday removing what it called “AI slop”.

Harness engineering vs context engineering: what is the difference? Context engineering decides what the model sees at each step. Shopify’s Tobi Lütke and the researcher Andrej Karpathy both backed the term in June 2025. Harness engineering covers the whole system around the model, including what it may do and how its work is checked. Prompt engineering, the oldest of the three, is about the wording of a single instruction. The sources do not agree on which of the newer two contains the other.

Will harnesses shrink as models get better? Some builders expect so. Boris Cherny, who leads Claude Code at Anthropic, told The Pragmatic Engineer in 2025: “Every time there’s a new model release, we delete a bunch of code.” The web company Vercel removed 80% of its data agent’s tools in December 2025 and went from four correct answers out of five to five out of five. The test had five questions. Anthropic re-tested an older harness of its own in March 2026: two parts were no longer needed with the newer model, while a radical cut lost quality. Its conclusion: “the space of interesting harness combinations doesn’t shrink as models improve. Instead, it moves”.

Why is it called a harness?

Nobody has documented where the AI sense of harness comes from, and the credit is disputed. The common explanation is the horse harness, which turns an animal’s strength into useful work. Engineers also had the word already: a test harness runs other software in order to test it, and evaluation harnesses for AI models date back to at least 2020.

How “harness” entered the vocabulary of AI
  1. Aug 2023Researchers call the software around a model “scaffolding”
  2. Feb 2025Anthropic writes of “agentic harnesses” in a model report
  3. Sep 2025“Agent harness” appears in Anthropic’s Agent SDK announcement
  4. Feb 2026“Harness engineering” turns up at OpenAI, LangChain and others within two weeks
  5. Jul 2026Wikipedia gets an article, Microsoft ships a product called Harness
Monthly views of the Wikipedia article “Agent harness”, 2026
Dated uses from the sources listed at the end of this post. Views: English Wikipedia, Wikimedia’s public statistics. July counts from 7 July, when the article was created; the striped bar counts 1 to 27 November 2026.

Who coined agent harness? Google Cloud’s blog named Ryan Lopopolo in September 2026, the OpenAI engineer behind the harness engineering post of February 2026. Anthropic had written of “agentic harnesses” a year before that post. LangChain’s chief executive Harrison Chase wrote in October 2025 that “agent harness” was a term he was “just starting to see be used more”, adding “I didn’t come up with it.” By July 2026 Wikipedia had an article and Microsoft had shipped a component called Harness. In Google searches in the United States, “ai harness” and “agent harness” together drew more than half the search interest of “prompt engineering” from January to October 2026, two years after both barely registered. Merriam-Webster, Oxford and Cambridge had not added an AI sense to their entries by late November.

Other meanings of harness. Searches for the word also turn up a software company, a car part and a piece of climbing gear. The six senses side by side:

WordWhat it means
Agent harnessThe software around an AI model that lets it act. The subject of this post.
Evaluation harnessSoftware that tests AI models. EleutherAI’s lm-evaluation-harness has used the word since August 2020.
Test harnessIn software testing, “a collection of drivers and test doubles needed to execute a test suite”, in the words of the ISTQB glossary.
Harness, the companyA software delivery platform founded in 2017, unrelated to the AI term. It bought parts of Augment Code in October 2026 and now also sells a coding agent.
Wiring harnessThe bundle of cables, terminals and connectors that runs through a car or a machine.
HarnessStraps for a horse, a climber or a parachutist. As a verb, to control a force and put it to use.

Agent harness permissions: what can an agent do without asking?

The harness decides what an agent may do without asking: which files it can change, which commands it can run, whether it can reach the internet and what gets logged. These are settings. Their defaults differ from one harness to the next and change with updates, so the answer for one product in spring may be wrong by autumn.

Asking the user before every action sounds safe, and Anthropic’s own figures show its limits. People approve nearly everything. Anthropic calls the effect approval fatigue, “where people stop paying close attention to what they’re approving”. A sandbox, which limits where the agent can write and which internet addresses it can reach, cut the number of prompts by 84%. Since September 2026, interactive sessions of Claude Code start in a mode where a second model approves actions in the user’s place, and Anthropic writes that it “is not a drop-in replacement for careful human review on high-stakes infrastructure.”

What approval prompts are worth, in Anthropic’s own numbers
93%
of permission prompts are approved by users anyway, by Anthropic’s telemetry
84%
fewer prompts once a sandbox limits where the agent can write and what it can reach
17%
of overeager actions get past the automatic reviewer that now approves in the user’s place
Anthropic: How we built Claude Code auto mode, 25 March 2026; Beyond permission prompts, 20 October 2025; How we contain Claude across products, 25 May 2026. OpenAI reports for its own reviewer that it correctly turned down about nine in ten overeager actions in its tests.

What a missing limit can cost is described in the founder’s account of an incident at the start-up PocketOS in April 2026, as reported by The Register. According to the founder, a coding agent found an access key in an unrelated file and deleted the production database and its backups with one call to the hosting provider. “It took 9 seconds,” the founder wrote, and called the exposed key the company’s own responsibility. The provider restored the data within an hour and changed the endpoint so that deletions are delayed.

Company versions let an administrator fix these settings centrally. OpenAI’s documentation for Codex calls them “admin-enforced constraints that users can’t override”, and Claude Code reads managed settings that rank above every user and project setting. The UK’s National Cyber Security Centre summed up joint guidance from several national security agencies in May 2026: “If you cannot understand, monitor or contain an agent’s actions, it is not ready for deployment”.

Choosing an agent harness: what to ask

Choosing an agent harness is a purchase like any other piece of software. Announcements name the model. The harness decides what the agent does with your files and how much of the model’s ability reaches your work, and eight questions settle most of it.

QuestionWhy it matters
Which harness runs the model, and who maintains it?The same model can score 18 points apart in two harnesses, and an update to the harness can change results overnight.
What can the agent do without asking?Defaults differ by product and change over time. Since September 2026, Claude Code starts in auto mode, where a second model approves actions.
Is there a sandbox, and is it on by default?A sandbox limits which files and which internet addresses the agent can reach. In Claude Code it is off unless switched on.
Can an administrator lock the settings?Company versions offer central settings that users cannot override. Without them, every user decides alone.
What is logged, where, and for how long?You need a record of what the agent read and did, kept where your rules allow it.
Where do prompts and files go?The harness sends them to a model. Where that model runs decides who else can see them.
Which harness produced the benchmark score you were shown?A score measured in a research harness says little about the product you are buying.
What happens when the harness changes?Ask how updates are announced and whether you can stay on a tested version.

At Zedar, the agents run in a harness we developed ourselves. Agents and harness sit on our own servers in the EU or on a server in your office, and you can ask us each of the questions above. Nothing your agents read or write is stored on the servers’ disks, each answer links to the document it comes from, and the package includes more than 140 ready-made tools and agents.

Go through the eight questions with us, using one of your own tasks as the example.

Request a call
Sources

Figures as published by 27 November 2026.

Decide what your agents may touch before they start.

Name one task an agent should take over. On a call we show you which files it would read, which actions it would take and where it would run.

Request a call