Frontier Foundry

Agent harness vs AI agent

48 sourced facts · updated

Agent 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 harnessAI agent
What it isThe 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 fromThe 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 doneOften 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 failsThrough 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 enforcedIn 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 resultA 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 planArize 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]

Each one on its own

from their concept pages

What is Agent harness?

An agent harness is the software around a model that turns it into an agent. It builds the context for each turn, runs the tools the model asks for, checks permissions, keeps the record and decides when to stop. The same model does very different work in a different harness.

In these talks an agent harness is the code around a model: the loop, tools, context and memory management, sandboxes and permissions, delegation and durable state. Speakers say models are absorbing coding scaffolds, yet the harness still owns runtime, trust and cost, and the hard parts are context, safe execution and surviving restarts. Practices converge on append-only logs, credentials outside sandboxes, fewer workflow-shaped tools and tracing.

3 rejections
Max times Arize's Alyx harness bounces an explicit finish call back to the model while plan items are still open (reported) Fuad Ali
43% fewer tokens, 31% lower cost
Arize reports this after moving its agent to code mode, with latency about unchanged Mikyo King
up to 72%
Cost reduction Anthropic's applied AI team found on internal benchmarks by fixing prompt-cache use, no meaningful performance change (reported) Lance Martin

Agent harness, explained in full: how it works as a machine, every part and its sources.

What is AI agent?

An AI agent is a model run in a loop. It looks at the goal and at what has happened so far, picks an action such as calling a tool, sees the result and chooses again, until the goal is met. That loop is what lets a model do work in the world and not only answer a question.

An AI agent is a model run in a loop: it reads the goal and what has happened so far, picks an action, sees the result and picks again. Every lap costs money and carries a small chance of failure, and value arrives only at the end, so long runs fail often even when each step is nearly always right. The sources close the gap by moving fixed stretches out of the model and by confirming the finished artifact against a record, and they warn that retrying a failed run can repeat its side effects.

~70% vs ~20%
Share of planning decisions (what to do) vs execution decisions (how to do it) made by the person in a typical Claude Code session; Anthropic, ~400,000 sessions, Oct 2025 to Apr 2026 Anthropic
99% per step, 100 steps: 36%
A thought experiment from a browser-agent engineer: 100 steps that each succeed 99% of the time, with no partial credit, end to end Derek Meegan
50% per run, 94% per transaction
Chance of success for a run at 50%, and for a transaction when the agent may retry up to four times, in an example from a browser-agent engineer Derek Meegan

AI agent, explained in full: how it works as a machine, every part and its sources.

In AI coverage over the last four weeks, Agent harness took 0.53% and AI agent 15%. Agent harness, week by week

The facts behind this page

48 facts from the two knowledge packs
  1. An agent is a model in a loop with tools; the harness wraps the model, runs the calls, manages context and encodes what the model cannot do on its own. Priyanka Phatak, AI Engineer · 2026-06-29 · Agent harness
  2. Chambers' working definition: take an agent, remove the model, and everything left is the harness. Mike Chambers, AI Engineer · 2026-09-14 · Agent harness
  3. Etsy's Bhargava defines the agent as the model plus the harness (in Claude Code, Opus is the model and everything else is the harness) and argues that a good harness lets a weaker local open model approach frontier performance. Aditya Bhargava, AI Engineer · 2026-06-29 · Agent harness
  4. An agent in the language-model sense is 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. Hugging Face · 2026-05-25 · AI agent
  5. The code that calls the model, handles its tool calls and decides when to stop is the harness; deciding when the agent should stop and how errors get handled is part of designing it. Hugging Face · 2026-05-25 · AI agent
  6. In reinforcement learning an agent is a function from an observation to an action; the environment returns a new observation and the loop repeats, and that loop is still the core of how language-model agents work. Hugging Face · 2026-05-25 · AI agent
  7. Harrison Chase's 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; this is the core architecture behind nearly every agent. Sequoia · 2026-08-13 · Agent harness
  8. On its own a language model has no memory between calls and no loop: it answers one prompt and stops. Hugging Face · 2026-05-25 · AI agent
  9. Arize made finishing an explicit tool call the harness enforces: it bounces back up to three times while plan items are open, warns one step before the iteration limit, then forces finish. Fuad Ali, AI Engineer · 2026-10-27 · Agent harness
  10. Checkout.com's Vector uses Claude Code hooks: when Claude finishes a session the hook runs deterministic checks from a config file, and on failure keeps telling Claude to try again until they pass. Sheikh says the agent reporting 'done' is not trusted; he had been the enforcement layer himself. Talha Sheikh, AI Engineer · 2026-04-08 · Agent harness
  11. An agent that acts and checks its own output in the same loop has no second opinion; the fix is a validation layer of three agents in sequence, one acts, one checks, one approves or rejects. Elizabeth Fuentes Leone, AI Engineer · 2026-06-29 · AI agent
  12. An agent can be given a check tool that reads the downloaded document, extracts its entities and compares them with a system of record, so it knows for certain whether it did its job. Derek Meegan, AI Engineer · 2026-10-02 · AI agent
  13. OpenAI's agent guide says every orchestration approach needs a 'run': a loop that lets the agent operate until an exit condition. Common exits are a tool call, a structured output, an error, or a maximum number of turns. OpenAI · 2026-01-15 · AI agent
  14. Curn says MCP context bloat is a harness problem: the spec says nothing about how a harness should load tools, so naive loading of every tool is the agent builder's choice. Jan Curn, AI Engineer · 2026-10-02 · Agent harness
  15. about one third: Curn's estimate of context eaten by registering ~100 MCP tools up front Jan Curn, AI Engineer · 2026-10-02 · Agent harness
  16. A tool call with no result freezes the lane. A session held a tool call with no matching tool result (process died, connection dropped or timeout before the result was recorded). The run waited forever and new messages queued behind it, so the agent looked stuck. Vinoth Govindarajan, AI Engineer · 2026-06-30 · Agent harness
  17. Each step of a transactional run adds a little cost and a little risk of failure, but value arrives only when every step is done: there is no partial credit. Derek Meegan, AI Engineer · 2026-10-02 · AI agent
  18. 99% per step, 100 steps: 36%: A thought experiment from a browser-agent engineer: 100 steps that each succeed 99% of the time, with no partial credit, end to end Derek Meegan, AI Engineer · 2026-10-02 · AI agent
  19. A hook is code inside the agent loop (before or after invocation, before a tool call), so unlike a prompt, which is only a suggestion to a probabilistic model, it is deterministic. A hook can keep a blocked value, such as a card number, from ever reaching the model, saving a model call and tokens. Elizabeth Fuentes Leone, AI Engineer · 2026-06-29 · Agent harness
  20. In the Strands Agents workshop a rate-limiter hook counts tool calls per user request (reset before the invocation, checked before each tool call) and blocks any beyond three, as a hard stop against an LLM that is invoking tools endlessly and burning tokens. Sandhya Subramani, AI Engineer · 2026-06-29 · Agent harness
  21. In the demo, the rate-limit hook only blocked the tool call; the model kept looping to the end. Ending the agent's turn needs the hook to be written to do that explicitly. Sandhya Subramani, AI Engineer · 2026-06-29 · Agent harness
  22. An instruction in the prompt to confirm first is not a control: a Meta safety director's OpenClaw agent deleted her whole inbox after she told it to confirm before acting. Enforce the confirmation in the tool layer, as LangChain's human-in-the-loop step does for sensitive tool calls. TechCrunch · 2026-03-18 · AI agent
  23. 52.4% to 76.2% on 106 tasks: HarnessBench as described by Bhargava: same model and evaluation, only the harness changed, and scores spanned more than twenty points; weaker models gained most. Aditya Bhargava, AI Engineer · 2026-06-29 · Agent harness
  24. A loop amplifies the capability a model has; below some threshold it amplifies errors instead of reliability. Dan McAteer, Latent Space · 2026-08-22 · AI agent
  25. Arize moved the plan out of a model-operated to-do tool and into harness state that is rendered into every model call. Fuad Ali, AI Engineer · 2026-10-27 · Agent harness
  26. The to-do tool that ate the budget. Arize first gave the model a to-do tool; it spent most of its time on LLM calls that only checked items off, with no useful unit of work. Fuad Ali, AI Engineer · 2026-10-27 · Agent harness
  27. How far the model goes on one leg tracks who holds the plan: 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. Anthropic · 2026-06-16 · AI agent
  28. 65% of nodes: Share of workflow nodes that run as plain code, not LLM calls, six months after one builder moved from "ask the LLM to do everything" to blueprints (Tomasz Tunguz, 14 production agent workflows); only 14% of workflows stayed fully agentic. Tomasz Tunguz · 2026-02-26 · AI agent
  29. What should decide that the loop is done: the model, a verifier or a hard cap? Run deterministic checks when the agent says it is finished and send failures back, since the agent's own 'done' cannot be trusted. Talha Sheikh, AI Engineer · 2026-04-08 · Agent harness
  30. 43% fewer tokens, 31% lower cost: Arize reports this after moving its agent to code mode, with latency about unchanged Mikyo King, AI Engineer · 2026-10-27 · Agent harness
  31. Curn describes two harness fixes, progressive tool discovery through a tool-search tool and code mode, which treats tools as code the model reads and calls. Jan Curn, AI Engineer · 2026-10-02 · Agent harness
  32. Anthropic's recovery rule: if the harness dies, boot a new one and resume from the session event log; a failed sandbox is just a tool error Claude can react to. Priyanka Phatak, AI Engineer · 2026-06-29 · Agent harness
  33. With brain and hands decoupled, a dead sandbox is replaced by a fresh one and the call retried; a dead brain re-reads the durable session log into context and resumes where it left off. Isabella Kai He, AI Engineer · 2026-06-29 · Agent harness
  34. Before building an agent the team agreed with the customer what a win looks like: what job it does, what a human signs off at the end, how long it takes, how much it costs, how accurate it must be, who judges it, and what it must never do alone. Milind Sunil Shah, AI Engineer · 2026-11-05 · AI agent
  35. Success for a run that does a job on the web is a concrete artifact it leaves behind: a confirmation email for a paid bill, an order id or receipt for an order, a new record that can be queried. Derek Meegan, AI Engineer · 2026-10-02 · AI agent
  36. An agent was told to read the page text before looking at images and to stop past a set zoom level; it then read a third as many images and the run cost fell by over half. Milind Sunil Shah, AI Engineer · 2026-11-05 · AI agent
  37. a third as many images, over 50% cheaper: Image reads and cost after a rule to read the page text first and stop past a zoom level, reported by the team that built the agent Milind Sunil Shah, AI Engineer · 2026-11-05 · AI agent
  38. The agent that kept zooming. On a promotions page whose prices sat inside 26 images, an agent found the right card at minute thirteen and kept zooming in at four, five and six times to double-check. Engineers stopped it by hand at minute fifteen. Milind Sunil Shah, AI Engineer · 2026-11-05 · AI agent
  39. Two tickets for one. An agent asked an outside system to create a ticket. The ticket was made, the acknowledgement was lost, the request timed out, and the agent sent it again without checking. Two tickets existed. Tanmay Sah, AI Engineer · 2026-11-08 · AI agent
  40. Tools should take request ids and idempotency keys so that a repeated request does not repeat its side effect, and a status lookup should show what the earlier request did. Salman Munaf, AI Engineer · 2026-07-02 · AI agent
  41. Before Managed Agents, every customer hand-built the same agentic loop: call Claude, run the tools, manage context. Anthropic says this loop was painstaking and surprisingly complex to maintain, which is why it packaged the loop into the Agent SDK and then a hosted service. Gagan Bhat, AI Engineer · 2026-06-29 · Agent harness
  42. What is an agent: a loop around a model, or a graph of steps someone wrote? An agent is a function from an observation to an action: the world answers, the answer goes back in, and the loop repeats. Hugging Face · 2026-05-25 · AI agent
  43. What is an agent: a loop around a model, or a graph of steps someone wrote? An agent is a traversable graph, and the builder spells out the workflows and trajectories in advance, in contrast to frameworks where agents decide on their own how to reach the goal. Mislav Ivanda, AI Engineer · 2026-11-09 · AI agent
  44. What is an agent: a loop around a model, or a graph of steps someone wrote? A graph, not a free loop: encode the paths you know, and let the model reason only where it adds value, so the agent is cheaper, faster and more predictable. LangChain blog · 2026-07-22 · AI agent
  45. What is an agent: a loop around a model, or a graph of steps someone wrote? A loop, not a graph, when the task cannot be pinned down in advance: generic deep research needs planning, delegation and context management to emerge in the harness. LangChain blog · 2026-07-22 · AI agent
  46. If models keep improving, should the harness shrink or grow? The harness will shrink: Google's Kilpatrick says the scramble to build harnesses has a roughly 12-month shelf life because models will digest the scaffolding and the edge moves elsewhere. Sequoia · 2026-06-11 · Agent harness
  47. If models keep improving, should the harness shrink or grow? The harness shrinks as models absorb it, but does not vanish: it inverts into the layer that handles permissions, identity and human attention, and progress is measured by how much of the harness you can delete at the same capability. Dan McAteer, Latent Space · 2026-08-22 · Agent harness
  48. If models keep improving, should the harness shrink or grow? Grow it: harness quality changes scores by more than twenty points and matters most for weaker models, so invest in the harness rather than waiting for stronger proprietary models. Aditya Bhargava, AI Engineer · 2026-06-29 · Agent harness

Cite this page

the version of 2026-12-02
APA
Han, R. (2026, December 2). Agent harness vs AI agent: what is the difference?. Frontier Foundry. https://www.ryanhan.ai/compare/agent-harness-vs-ai-agents
BibTeX
@misc{han2026-compare-agent-harness-vs-ai-agents,
  author       = {Han, Ryan},
  title        = {{Agent harness vs AI agent: what is the difference?}},
  howpublished = {Frontier Foundry},
  year         = {2026},
  month        = dec,
  url          = {https://www.ryanhan.ai/compare/agent-harness-vs-ai-agents}
}

More comparisons

all of them