Guide · Agent harness

Agent harness vs agent framework: the parts you assemble, and the system that runs them.

A framework gives you building blocks for an agent. A harness is those blocks already assembled, with defaults, policy and a record around every run.

The two words are used loosely, and the difference decides who writes the code that keeps an agent safe: your team, or the software you adopt. This guide sets out the four layers of an agent stack, what each one owns, what a harness adds on top of a framework, and how to choose.

Updated · 9 sources

The four layers of an agent stack
01
Your agentthe job, its instructions, the tools and data it may use
instructionstoolsdata
02
Harnesseverything around the model, assembled with defaults: context, tool policy, approvals, recovery, records
batteries included
03
Runtimekeeps long runs alive: durable execution, streaming, persistence, pauses for a person
durable execution
04
Frameworkabstractions to write an agent with: the loop, model adapters, tool interfaces
abstractions
05
Modelreads the context and proposes the next step; it never runs a tool itself
LLM

What is the difference between an agent harness and an agent framework?

An agent framework is a library of abstractions — an agent loop, model adapters, a tool interface — that developers assemble into an agent. An agent harness is the assembled system around the model: it ships with prompts, tools, context management, approvals, failure handling and run records already in place. In agent harness vs agent framework, the framework hands you parts and the policy decisions; the harness makes those decisions by default and runs every agent under them.

Side by side

Agent harness vs agent framework, compared on nine points.

LangChain’s Harrison Chase drew the line in October 2025: a framework’s main value is its abstractions; a harness comes “with batteries included”. Read each row as the question “who decides this?”.

a library

Agent framework

Abstractions for writing agents. You choose the model, write the loop’s policy, wire the tools and decide what happens when something fails.

  • Examples: CrewAI, OpenAI Agents SDK, Google ADK, LlamaIndex, Vercel AI SDK
  • Value: a shared mental model and fast starts
  • You own: context, tool policy, approvals, recovery, records
  • Fits: prototypes, one-off agents, teams that want full control
a running system

Agent harness

An opinionated, assembled agent system. Prompts, tools, planning, context handling and safety checks are there before you write a line.

  • Examples: Claude Agent SDK, coding command-line agents, enterprise agent platforms
  • Value: the hard parts already decided and tested
  • You own: the job, its tools and its data
  • Fits: many agents, many users, regulated work
Classes and functionsUnit you work withA configured agent
Provided; its stopping rules are yoursThe agent loopProvided, with stopping rules set
You write it from scratchSystem promptA tested default you extend
Whatever your code passes inTool accessGranted per agent, checked on each call
You choose what to keep and dropContext and memoryManaged: trimming, summaries, files
You build the pause and the screenApprovals by peopleBuilt in, on the tools you choose
Your retry codeWhen a model call failsA recovery policy the harness owns
Whatever you logRun recordEvery step, tool call and decision kept
Each team, for each agentUpgradesOnce, for every agent at once
Anatomy

What an agent harness adds on top of a framework.

LangChain’s March 2026 definition is the cleanest: a harness is every piece of code, configuration and execution logic that isn’t the model — hence Agent = Model + Harness. These are the parts it usually contains.

Agent harnesseverything around the model that turns a reply into work
System promptthe standing instructions, tested against the model
Tools and MCP serverswith descriptions written for a model to read
Context managementwhat goes in, what is trimmed, what is summarised
Working environmenta filesystem, sandbox or browser to act in
Orchestrationsub-agents, hand-offs and model routing
Hooks and checksdeterministic steps: compaction, lint, continuation
Approvalsa person confirms the calls that change things
Run recordwhat happened, in order, for audit and replay

Where the word came from. Engineers have long called the code that drives a program under test a “test harness”. When Anthropic renamed its SDK in September 2025, it described it as “the agent harness that powers Claude Code”.

Evidence

Changing only the harness changes how well the same model performs.

Published results point the same way: change what surrounds the model and the same model performs very differently. That is why the layer you adopt or build deserves as much scrutiny as the model you pick.

Top 30 → Top 5
LangChain’s own coding agent on Terminal Bench 2.0 after changing only the harness — LangChain’s claim about its own agent
LangChain, 2026 (vendor’s own result)
40%
less task-completion time for agents given tool descriptions rewritten by Anthropic’s tool-testing agent — Anthropic’s report on its own system
Anthropic, 2025
>40%
of agentic AI projects Gartner predicts will be canceled by the end of 2027, due to escalating costs, unclear business value or inadequate risk controls
Gartner, 2025

Anthropic’s guidance on long-running agents shows the same thing in practice: the fix for agents that lose track across sessions was harness work — an initial session that writes a feature list and a progress file, and later sessions that pick one feature, test it and commit — rather than a different model.

Agent harness vs runtime vs framework

Framework, runtime, harness: how much each layer decides for you.

The layers stack, and products often span two of them. Place a tool on this line by asking how many decisions it has already made before your agent’s first run.

You decide everythingDecided for you
12345
  1. Direct model APIOne call, one answer. You write the loop, the tools, the memory and the logging.
  2. Agent frameworkA loop, tool interface and model adapters. Policy is still yours.
  3. Agent runtimeDurable execution, streaming, persistence and pauses for a person — Temporal and Inngest are examples.
  4. Agent harnessPrompts, tools, planning, context and checks assembled, as in the Claude Agent SDK.
  5. Enterprise harnessA harness plus identity, tool grants, approvals, quotas and audit for many teams.

Three neighbouring terms

  • OrchestrationDecides which step or agent runs next. A harness governs what happens inside each agent’s run.
  • ScaffoldingResearch shorthand for the code wrapped around a model on a benchmark — a harness built for one test.
  • MCPA protocol for reaching tools. The harness decides whether this agent may call that tool, and when a person must confirm.
One agent, two ways

The same invoice agent on a framework and on a harness.

Take one agent: it reads supplier invoices, matches them to purchase orders and proposes payment holds. The model and the prompt are the same either way. What differs is the list of things someone must build and keep working.

On a framework, in outline (pseudocode)
agent = Agent(
  model = "your-model",
  instructions = INVOICE_PROMPT,
  tools = [read_invoice, find_po, hold_payment],
)

# still yours to write and run:
#  - which users may call hold_payment
#  - pause hold_payment for a person
#  - trim context on 80-page invoices
#  - retry or switch model on failure
#  - keep a record of every step
#  - cap spend per team
result = run(agent, invoice)
On a harness, configured instead of coded
  • Tool granthold_payment granted to this agent only; every call checked.
  • Approvalhold_payment set to wait; the reviewer approves, rejects or edits.
  • Contextlong invoices trimmed by budget; the prompt can be previewed.
  • Recoverya failed model call moves to the next model in the pool.
  • Recordevery step, tool call and approval kept with the run.
  • Spendquotas checked before the run starts.

Neither path is wrong. The framework path is quicker to a demo and gives full control; the harness path is quicker to a second, third and fiftieth agent, because every one of them inherits the same answers.

Decision guide

Agent harness vs agent framework: choosing by who keeps the policy working.

Anthropic’s advice for builders is to start with model APIs directly and, if you use a framework, to understand the code underneath. The question that settles the rest is who will keep the policy working once the first agent is live.

Who must the agent answer to once it is live?

Only its buildersA framework, or the model API directly. Keep the loop simple and readable; add parts as real failures show up.
A team, on its own dataA harness such as an agent SDK, so prompts, context handling and tool checks are not rewritten for every agent.
Many teams, auditors and regulatorsAn enterprise harness: identity, per-agent tool grants, approvals, quotas and a record of every run, shared by every agent.
Production
Hand-built harnessPossible for one agent, if you staff it: every safety part is yours to write, test and keep current.framework + your code
Shared harnessTool policy, approvals, recovery and records solved once and inherited by every agent.adopt a harness
Experiment
Framework or raw APIFastest way to learn what the agent needs. Expect to rewrite the edges later.framework
Harness for explorationTeams try many agents quickly because the hard parts are already there.harness
One agentMany agents
On Botminds

How the Botminds agent harness runs every agent under one policy.

Every Botminds agent runs inside one enterprise harness. The parts a framework leaves to you ship with their rule already in place, and the rule holds whichever model is underneath.

Agent frameworkBotminds agent harness
What it isA library to build agents withThe running system every agent lives in
Tool accessWhatever the code passes inGranted by name and checked on every call; read-only basics by default
People in the loopBuild it yourselfApprove, reject or edit, on the tools you choose
Context and memoryBuild it yourselfBudgeted tiers, two kinds of memory, a preview of the exact prompt
When a model failsBuild it yourselfOn document and background runs, the next model in a pool across providers and regions
SpendOutside its scopeToken quotas checked at the one door every run passes
Ways to runOne loopFast, thinking, auto and autonomous on one harness
Who maintains itYour engineersThe platform, for every agent at once

Read the full design in the agent harness. To build one yourself, start with agent anatomy and tools and functions in the Academy.

Questions people ask

Agent harness vs agent framework: common questions.

The technology behind itAgent harnessThe runtime around every agent
What is the difference between an agent harness and an agent framework?

In agent harness vs agent framework, a framework is a library of abstractions you assemble into an agent, and you decide tool access, approvals, context handling, recovery and logging yourself. A harness is the assembled system around the model, with those decisions made by default for every agent it runs.

What is an agent harness in AI?

An agent harness is every piece of code, configuration and execution logic around a language model that lets it work as an agent: the loop, the system prompt, the tools, context management, approvals, recovery and the record of each run. LangChain summarises it as Agent = Model + Harness.

Is LangChain an agent framework or an agent harness?

LangChain describes its core library as an agent framework, its durable-execution layer as an agent runtime, and a separate batteries-included package as its agent harness. The company itself notes that the boundaries are still fuzzy.

What is the difference between an agent harness and an agent runtime?

A runtime keeps agent runs alive in production: durable execution, streaming, persistence and pauses for a person. A harness decides what happens inside each run: the prompt, the tools, the context and the checks. Many products combine both.

Is the Claude Agent SDK a framework or a harness?

Anthropic calls it a harness. When the Claude Code SDK was renamed in September 2025, Anthropic described it as the agent harness that powers Claude Code, usable for many other kinds of agent.

Is an agent harness the same as orchestration?

No. Orchestration decides which step or agent runs next. A harness governs what happens inside one agent’s run — what it sees, which tools it may call, when a person must approve, and what is recorded.

What is harness engineering?

Harness engineering is improving an agent by changing what surrounds the model — its prompt, tools, tool descriptions, context handling and checks — rather than the model itself. Published results show harness changes alone can move an agent a long way on benchmarks.

Should I build my own agent harness?

Build one if you have a single agent and the engineers to own its safety parts for its whole life. Adopt one when many teams will run many agents, because tool policy, approvals, recovery and audit then need to be solved once and inherited by all of them.

See it on
your own work.

Bring one process and its documents. We’ll show you the agents, the controls and the record, running on your data.