Agent harness vs AI agent
48 sourced facts · updatedAgent harness vs AI agent: what is the difference?
An AI agent is a model run in a loop. The agent harness is the code around the model that runs that loop, runs the tool calls, manages context and decides when to stop. One speaker's working rule is to take an agent, remove the model, and everything left is the harness; another defines the agent as the model plus the harness. So the sources use the two words for overlapping things. Work on the harness when the code around the model is the problem, and work on the agent when the goal, its definition of done or the model's steps are the problem. [1][2][3][4][5]
In the knowledge graph: The loop, tools, memory and limits around a model are what make it an agent.
The difference between Agent harness and AI agent
| Agent harness | AI agent | |
|---|---|---|
| What it is | The code around the model: it wraps the model, runs the calls, manages context and encodes what the model cannot do on its own. Chambers' working definition: take an agent, remove the model, and everything left is the harness. [1][2] | A model plus everything around it that lets it act, not only respond: it takes in information, decides what to do and acts on the results. In reinforcement learning terms, an agent is a function from an observation to an action, and the loop repeats. [4][6] |
| Where the loop comes from | The harness runs it. In the baseline loop a request comes in, the LLM generates, and if the generation includes a tool call the harness invokes it and passes the observation back to the LLM. [7] | On its own a language model has no memory between calls and no loop: it answers one prompt and stops. The code that calls the model, handles its tool calls and decides when to stop is the harness. [8][5] |
| Who decides the work is done | Often the harness, in code. Arize made finishing an explicit tool call: the harness bounces it back up to three times while plan items are open, warns one step before the iteration limit, then forces finish. Checkout.com's hooks run deterministic checks when Claude finishes and keep telling it to try again until they pass. [9][10] | An agent that acts and checks its own output in the same loop has no second opinion. One fix is a check tool that compares the downloaded document with a system of record. OpenAI's guide lists common exits for a run: a tool call, a structured output, an error or a maximum number of turns. [11][12][13] |
| How it fails | Through the context and boundaries the code sets up. Curn calls MCP tool bloat a harness problem, and estimates that registering about 100 tools up front eats about a third of context. In one failure a tool call with no matching result left a run waiting forever, with new messages queued behind it. [14][15][16] | Through the loop's arithmetic: each step adds a little cost and a little risk, and value arrives only when every step is done. A browser-agent engineer's example: 100 steps that each succeed 99% of the time give 36% end to end. [17][18] |
| How a rule is enforced | In code the loop runs. A hook is code inside the agent loop, so unlike a prompt it is deterministic. In one demo a hook blocks any tool call past three per request, but it only blocked the call: the model kept looping unless the hook was written to end the turn. [19][20][21] | An instruction in the prompt is not a control. TechCrunch reports that a Meta safety director's OpenClaw agent deleted her whole inbox after she told it to confirm before acting. The advice is to enforce the confirmation in the tool layer. [22] |
| How much the setup changes the result | A lot. In HarnessBench as Bhargava describes it, the model and evaluation stayed the same, only the harness changed, and scores ranged from 52.4% to 76.2% on 106 tasks; weaker models gained most. [23] | A loop amplifies the capability a model has. Below some threshold it amplifies errors instead of reliability (Dan McAteer, Latent Space). [24] |
| Who holds the plan | Arize moved the plan out of a model-run to-do tool and into harness state rendered into every model call, because the to-do tool spent most of its time on LLM calls that only checked items off. [25][26] | It varies. Anthropic found that when the user keeps over 80% of execution decisions Claude takes about eight actions per turn, and when Claude makes over 80% of planning decisions it takes about 16. One builder reports 65% of workflow nodes run as plain code and only 14% of 14 production workflows stayed fully agentic. [27][28] |
When to use Agent harness
- Work on the harness when the model's own "done" cannot be trusted: Checkout.com's hook runs deterministic checks when Claude finishes a session and keeps telling it to try again until they pass. [10][29]
- Work on the harness when tool definitions fill the window: Arize reports 43% fewer tokens and 31% lower cost after moving its agent to code mode, with latency about unchanged. [30][31]
- Work on the harness when a long run has to survive a crash: Anthropic's rule is to boot a new harness and resume from the session event log, and a dead sandbox is replaced and the call retried. [32][33]
When to use AI agent
- Work on the agent when nobody has said what success is: one team agreed with the customer what a win looks like (the job, the human sign-off, time, cost, accuracy, who judges and what it must never do alone) before building. [34][35]
- Work on the agent when the model spends steps it does not need: an agent told to read the page text before images and to stop past a set zoom level read a third as many images, and the run cost fell by over half. [36][37][38]
- Work on the agent when a retried run could repeat a side effect: one agent re-sent a ticket request after a timeout without checking and two tickets existed. Give calls idempotency keys. [39][40]
Using Agent harness and AI agent together
Bhargava defines the agent as the model plus the harness: in Claude Code, Opus is the model and everything else is the harness. He argues a good harness lets a weaker local open model approach frontier performance. Before Managed Agents, every Anthropic customer hand-built the same loop, which Anthropic called painstaking and surprisingly complex to maintain, so it packaged the loop into the Agent SDK and then a hosted service. [3][41][4]
What is an agent: a loop around a model, or a graph of steps someone wrote?
The sources disagree. Hugging Face describes an agent as a function from an observation to an action, with the loop repeating. Ivanda describes a traversable graph whose workflows and trajectories the builder spells out in advance. LangChain says to encode the paths you know and let the model reason only where it adds value, but to use a loop when the task cannot be pinned down, as in generic deep research. [42][43][44][45]
If models keep improving, does the harness shrink?
The sources split. Google's Kilpatrick says the scramble to build harnesses has a roughly 12-month shelf life because models will digest the scaffolding. Dan McAteer says it shrinks but does not vanish: it becomes the layer for permissions, identity and human attention. Bhargava says to grow it, because harness quality changed scores by more than twenty points and matters most for weaker models. [46][47][48]