Short answer
An agent harness is the runtime layer built around a model that turns it into a working agent: the execution loop, context management, tools and skills, permissions, sandboxing, and failure recovery that carry a task from request to finished result. The model reasons; the harness is everything that lets that reasoning complete real work.
- Agent = Model + Harness. The model is not part of the harness; the harness is everything around it.
- A complete harness does six jobs: runs the loop, manages context, exposes tools and skills, enforces permissions, sandboxes execution, and recovers from failure.
- What runs in production is a configured agent: a base harness, a model, and your product's settings. In HarnessRouter's same-task benchmark, cost across such configurations varied by about 475x, so the combination is worth measuring, not assuming.
Two formulas that keep the terms straight
The industry converged on one structure in 2026: the harness wraps the model, and together they make an agent. Vendors word it differently, scaffolding, wrapper, runtime layer, but every mainstream definition puts the model outside the harness. Two formulas cover the vocabulary:
- Agent = Model + Harness
- The identity formula. A model alone produces text; an agent completes work. The harness is the difference.
- Harness = loop + context + tools and skills + permissions + sandbox + recovery
- The anatomy formula. Six jobs, no model inside. Each job is detailed below.
The six jobs of a complete harness
A demo harness runs a loop. A complete harness does six jobs, and the last four are where most of the engineering lives:
- Runs the execution loop: plan, act, check the result, repeat until the task is done.
- Manages context: decides what to store, retrieve, and show the model at each step, so a long task stays on track.
- Exposes tools and skills: the functions, commands, and packaged abilities the model can call. Mechanically, a skill is packaged instructions and scripts delivered through the context and tool machinery; to the model it is one callable surface.
- Enforces permissions: what the agent may read, write, and execute, and nothing else.
- Sandboxes execution: code the agent writes and runs is isolated, so the blast radius of a wrong command is a sandbox, not your infrastructure.
- Recovers from failure and decides completion: retries, fallbacks, and the judgment call of when the work is actually finished.
Where the term comes from
The term entered mainstream usage in 2026 and its history is short enough to state precisely:
- Mitchell Hashimoto, co-founder of HashiCorp, is widely credited with popularizing the term in a February 2026 essay on agent infrastructure.
- LangChain and other framework authors used harness language in the same period for the code that operates a model in a loop.
- The shorthand Agent = Model + Harness spread across engineering blogs and talks during 2026 and is now the standard way to separate the reasoning component from the execution machinery.
- By mid-2026, definitions from Microsoft, Databricks, Salesforce, and independent practitioners had converged on the same structure: the harness wraps the model and turns it into an agent.
Complete harnesses you already know
The clearest examples are the terminal agents developers already know. Claude Code, Codex, and Hermes are complete agent harnesses: each ships all six jobs as one continuously engineered product. The Pragmatic Engineer's March 2026 tooling survey found Claude Code the most-used AI tool among surveyed engineers, which puts a complete harness at the top of engineers' AI tool adoption, even if few users call it a harness.
- Claude Code: Anthropic's harness, driving Claude models through terminal-native tasks with tools, permissions, and sandboxing.
- Codex: OpenAI's harness for autonomous coding tasks across a repository.
- Hermes: a harness for general agent work whose search interest broke out during 2026.
- A framework like LangGraph or CrewAI is not a harness but a kit for building one: it becomes a harness only after you assemble and operate the six jobs yourself.
What an agent harness is not
Four neighboring terms get confused with the harness, and each sits at a different layer:
- Model API
- Returns inference for a single call. No loop, no tools, no state. The harness is the machinery that calls it many times toward a goal.
- Agent framework (LangGraph, CrewAI)
- A library for building your own execution logic. A framework is parts; a harness is the running whole.
- Model router or AI gateway
- Selects and fronts model calls. It optimizes the inference layer; it does not run tasks.
- Sandbox
- An isolation environment. Sandboxing is one of the harness's six jobs, not a separate layer above it.
Why the harness choice is worth measuring
What actually executes a task is a configured agent: a base harness, the model it drives, and the instructions, tools, and skills your product enables. The harness side is not neutral plumbing; it decides how many steps, tool calls, and tokens a task consumes on the way to a result. In HarnessRouter's same-task benchmark, eight harness and model configurations ran identical work five times each: measured cost varied by about 475x across configurations, and the lowest-cost successful run used 99.8% fewer credits than the costliest configuration. Results vary by task. What generalizes is that cost and success are properties of the configuration, the harness and model pair, not of the model alone.
- Hold the model constant and swapping only the harness moved cost by up to about 2.1x and latency by up to about 1.9x in the recorded runs.
- Success rates differed by setup, and the costliest configuration was not the best one.
- The practical conclusion: treat harness choice like model choice, as something you evaluate on your own tasks.
Where the harness sits in an AI product
In a production AI product, the harness layer sits above the model and context layers and below your application. Using complete harnesses as product infrastructure normally means one integration per harness, because each exposes tasks, sessions, files, and streaming differently. HarnessRouter is the world's first unified interface for agent harnesses: through one API, a product runs complete agent tasks on Codex, Claude Code, or Hermes, with sessions, streaming, files, and results behaving the same way across every harness, and each task executing in an isolated sandbox the platform manages.
- One contract across harnesses turns switching or comparing configurations into a parameter change.
- Execution tracing records every run, so configuration choices rest on evidence rather than defaults.
- The harness layer stays the vendors' continuously engineered software; the unified interface is how your product consumes it.
FAQ
- Does an agent harness include the model?
- No. Every mainstream definition, from Microsoft, Databricks, Salesforce, and independent practitioners, puts the model outside the harness: the harness wraps the model and turns it into an agent. What runs in production is a configured agent: a base harness, a model, and the instructions, tools, and skills your product enables; that configured agent is what actually executes tasks.
- Is Claude Code an agent harness?
- Yes. Claude Code is a complete agent harness: it runs the execution loop, manages context, exposes tools, enforces permissions, sandboxes execution, and recovers from failure, driving Claude models through real tasks. Codex and Hermes are complete harnesses in the same sense.
- What is the difference between an agent harness and an agent framework?
- A framework such as LangGraph or CrewAI is a library of parts for building your own agent logic. A harness is the complete running machinery. If you assemble and operate the loop, context, tools, permissions, sandboxing, and recovery yourself with a framework, you have built a harness.
- Who coined the term agent harness?
- The term spread through several sources rather than one. Mitchell Hashimoto's February 2026 essay is widely credited with popularizing it, framework authors used harness language in the same period, and by mid-2026 major vendor definitions had converged on the same structure.
- How do I choose an agent harness?
- Evaluate configurations, not brands: run your own task across candidate harness and model pairs, apply a success threshold, then compare cost and latency among the ones that pass. HarnessRouter runs each configuration through the same API, and its published same-task benchmark shows the recorded format for this comparison.
Pick the best harness × model for every task
Run the same task across configurations through one API, compare recorded runs, and ship the winner.
Start building free
