An AI agent harness, sometimes loosely called an AI harness, is the software that turns a model into a working agent. It runs the loop in which the model plans, calls tools and checks results, decides what context the model sees, and enforces which tools it may use and when a person must approve.
It is tempting to judge an AI agent by the model inside it. Yet three well-known coding agents, Claude Code, Codex and GitHub Copilot, each run on what their makers call a harness. And the harness, not the model, is where an organisation’s decisions about an agent take effect: what it sees, what it may touch and when it must ask a person. This guide, for the AI, IT and platform leads who choose and govern agents, separates the model from the harness and ends with what to test before rollout. It expands one of the trends in our Agentic AI 2027 report.
Key takeaways
- An agent harness is everything in an agent except the model: the loop, context, tools, permissions, approvals and checks.
- Anthropic, OpenAI and GitHub each name and describe the harness under their agents: Claude Code, Codex and GitHub Copilot.
- Agent benchmarks such as Terminal-Bench 2.0 score a model and a harness as a pair, so one model can appear several times; the gaps can be smaller than they look.
- Harness engineering is the practice of building and tuning that layer, and Forrester predicts that harnesses, not models, will drive three-quarters of AI platform decisions (October 2026).
- Test the model and harness together on your own tasks, and treat the harness settings for tools, context and approvals as governance decisions.
What is an agent harness?
An agent harness is everything in a working agent except the model. The model supplies the reasoning; the harness supplies the rest, from the loop that keeps the work moving to the rules about what the agent may do.
LangChain put it as a formula in March 2026, “Agent = Model + Harness”, and defined the harness as “every piece of code, configuration, and execution logic that isn’t the model itself”. Forrester’s Predictions 2027 (October 2026) describes the same layer by its jobs: “The harness is the runtime that routes work, pulls context together, manages tool access, and checks the output.” You will also see it called the agent runtime or scaffolding; the layer is the same.
Model vs harness: the model proposes, the harness decides
The model reads what it is given and proposes the next step, such as an answer or a tool call. The harness decides what the model is given, whether the proposed step runs, what happens to the result and when the work stops.
| The model | The harness | |
|---|---|---|
| Its part in the agent | The reasoning: what to answer, or which tool to call next | Everything else: the loop, context, tools, rules and checks |
| Who changes it | The model provider, in new versions | The harness maker in new releases, and your team through its settings |
| What your organisation controls | Which model to use, where a choice is offered | Which tools and data the agent gets, what needs approval and what is recorded |
| How to judge it | Model benchmarks show part of the picture | Only together with a model, on your own tasks |
Because the two are separate, they can be recombined: one model can run in several harnesses, and some harnesses run models from several providers.
What an agent harness does: five jobs outside the model
An agent harness does five jobs the model cannot do for itself: it runs the loop, manages context, connects tools, applies permissions and approvals, and checks and records the work. Each one shapes what the same model can achieve.
The agent loop
Anthropic describes the feedback loop agents often run as gather context, take action, verify work, repeat (September 2025). The harness runs that loop and decides when it ends. For what happens inside each round, see how AI agents plan, remember and act.
Context and memory
At every step the harness decides what the model sees: instructions, files or records, earlier results and anything kept from previous sessions. Long tasks outgrow what a model can hold at once, so the harness also decides what to summarise, drop or reload.
Tools and connections
The harness decides which tools the agent has, such as a code runner, a search, an API or a file system, and turns the model’s request into a call that actually runs. A tool the harness does not offer is a tool the agent does not have.
Permissions and approvals
The harness enforces what the agent may do alone: which actions run automatically, which wait for a person and which are switched off. These are settings, not properties of the model, so the same model can be held back in one harness and free to act in another.
Checks, recovery and records
When a step fails, the harness decides whether to retry, try another route or stop and hand back to a person. It can also verify the work, for example by running tests, and record each step, tool call and approval so that a failure can be traced.
Agent harness examples: Claude Code, Codex and GitHub Copilot, in their makers’ words
In their makers’ own words, Claude Code, Codex and GitHub Copilot are each built on a harness. In each case the harness is a separate, reusable piece of software.
Claude Code and the Claude Agent SDK
When Anthropic renamed the Claude Code SDK the Claude Agent SDK in September 2025, it described that SDK as “the agent harness that powers Claude Code” and said the same harness can power many other types of agents. So Claude Code is Anthropic’s models running inside Anthropic’s harness: the product is the agent, the SDK is the harness and Claude models do the reasoning.
The Codex harness
OpenAI uses the same word. In February 2026 it described the Codex harness as “the agent loop and logic that underlies all Codex experiences”: the web app, the CLI, the IDE extension and the macOS app. Whichever of these a developer opens, the same harness sits between the model and the work.
GitHub Copilot’s agentic harness
GitHub calls its version the GitHub Copilot agentic harness: “a single shared component of the GitHub Copilot SDK” that powers the Copilot CLI, the Copilot app and Copilot code review. In June 2026 GitHub said the harness supports “20+ frontier models across the GPT, Claude, Gemini, and MAI families”, so here one harness runs models from several providers.
Same model, different harness: benchmarks score the pair
Agent benchmarks such as Terminal-Bench 2.0 score a model and a harness together, so the same model can appear several times. A different harness can move an agent up a leaderboard, but the gaps between leading entries can be smaller than they look.
The Terminal-Bench 2.0 leaderboard on Snorkel AI’s site, now marked as archived, shows how. Submissions pair a backbone model with an agent scaffold, Claude Code and Codex CLI among them, and “Each Agent + Model combination is its own leaderboard row”. The page also cautions that the confidence intervals of the leading entries overlap heavily: “the gaps are smaller than they look”.
The vendors’ own reports show both sides of that. LangChain says it moved its coding agent from the top 30 to the top 5 on Terminal-Bench 2.0 “by only changing the harness” (March 2026), without giving scores. GitHub compared its harness with Claude Code on Claude models and with Codex CLI on GPT models (June 2026). It reported task completion on par with both, within the models’ run-to-run variance, and lower token use in most configurations. Both are vendors reporting on their own products.
So a score belongs to a pair, not to a model. And if the harness can move a result, building it well is a skill in its own right.
What is harness engineering? A practice with a name and a forecast
In AI, harness engineering is the practice of designing, building and tuning the harness: its loop, context, tools, rules and checks. The phrase opens the title of an OpenAI post from February 2026 about building software with Codex: “Harness engineering: leveraging Codex in an agent-first world”.
Gartner has since taken up both the harness and the practice. In October 2026 it placed the agent coding harness among its top strategic technology trends for 2027, describing it as a closed-loop control system that governs autonomous developer behaviour across the software development lifecycle. In its software engineering trends of 18 November 2026, it described harness engineering as configuring AI coding agents with context, standards and guardrails, and forecast that by 2028 organisations with AI coding harness infrastructure will have 60% fewer post-deployment defects than those without.
All three sources are about coding, like the examples above. The questions they raise are not: what an agent sees, what it may do and how its work is checked matter for any agent that acts on an organisation’s systems.
What agent harnesses mean for enterprises: test the pair, govern the settings
For an enterprise, the harness changes two things: what you evaluate and where many of your controls sit. The model still matters, but an agent is judged as a pair, and the settings that decide what it may do live in the harness.
Two analyst forecasts go further. Forrester predicts that harnesses, not models, will drive three-quarters of AI platform decisions, and that “Enterprises will buy the harness around the model and care much less about which model sits inside it” (Predictions 2027, October 2026). Gartner, in its software engineering trends, expects harness engineering to become a more important factor in output quality than the choice of model as the performance gaps between frontier AI models narrow (November 2026). Neither is a measurement, and the evidence above supports a narrower point: a result belongs to the pair, so the pair is what to test.
What to test and govern before rollout
In practice that comes down to five steps.
- Test the pair on your own tasks. Run the model and harness you plan to deploy on real work, not only on public benchmarks; our practical guide to evaluating AI agents before production sets out how.
- Change one side at a time. Try a new model in the same harness, or the same model in a new harness, so you know which change moved the result.
- Treat harness settings as governance decisions. Decide who may change the tools, context and approval rules, where changes are recorded and how often they are reviewed, and fold this into your AI agent governance.
- Keep a record of every run. Each run should leave its steps, tool calls, approvals and results behind, so a failure can be traced to the model, the harness or the data.
- Re-test when either side changes. A new model version or a new harness release makes a new pair, and the old results may no longer describe it.
Frequently asked questions about agent harnesses
Is Claude Code a harness or an agent?
Both words apply. Claude Code is an agent, and Anthropic describes the software under it, now the Claude Agent SDK, as “the agent harness that powers Claude Code” (September 2025). Claude models do the reasoning inside it.
Is an agent harness the same as an agent framework?
Not quite. A framework is a set of libraries for writing agent code, and a harness can be built with one. Google Cloud contrasts the two (page updated October 2026): an orchestration framework is about the developer experience of writing code, a harness about the runtime environment.
Is an agent harness the same as MCP?
No. The Model Context Protocol (MCP) is a protocol agents use to reach tools and data. The harness is the software that runs the agent’s loop and decides which MCP servers and tools the agent may call.
Is an AI harness the same as an evaluation harness?
It depends on who is speaking. “AI harness” is sometimes a loose name for the agent harness, which runs an agent, and sometimes means an evaluation harness: a test set-up that runs tasks against a model or agent and scores the results.
Can one harness run models from different providers?
Some can. GitHub says its Copilot harness supports “20+ frontier models” (June 2026), and Cursor said in April 2026 that its harness abstractions are model agnostic. Check what the harness you are evaluating supports, then test each model in it.
How do you test a model and a harness together?
Run your own tasks through the pair you plan to deploy, change one side at a time, and inspect the steps, tool calls and approvals as well as the answer. Re-test whenever either side changes; our practical guide to evaluating AI agents before production covers the method.
Test the agent, not only the model.
In cognipeer Studio, cognipeer’s AI agent builder and orchestration workspace, teams run reusable evaluation suites on the agents they build, called Peers, before they scale them.
