AI AgentsInfo

guide

What is an AI agent harness?

A plain-language guide to the software around a language model — the loop, tools, memory, permissions, and checks — and what harness engineering means.

Byline:
AI Agents Info Editorial
Published:
Last updated:

Companies mentioned

Updated November 3, 2026.

What does an agent harness mean in plain language?

A language model is a program that answers in words. An agent is that program when it can also take steps: look something up, change a file, run a check, and try again. The harness is the workshop around the program. It holds the tools, the notebook, the lock on the door, and the rule for when to stop.

Two workshops can hand the same program a job and get different results. One workshop may allow a command to run. Another may stop and ask a person first. The program did not change. The workshop did.

If you have used a chat box, you have used a model. When a product can click, edit, or buy, the software around the chat is doing extra work: it offers the tools, carries out the chosen step, and brings the result back. That extra software is the harness.

The rest of this guide is for anyone who wants the details, including people who build these systems. Short definitions live in the glossary: harness engineering, orchestration, and guardrail. A larger-text door is on the Everyone page. The Curious Kids page is the same idea with a shorter path in.

What is an AI agent harness?

On this site, a harness is the runtime around a model: the loop, the tools, the memory, the permissions, and the stop conditions. The weights stay the model. The harness is the code that puts a goal in front of those weights and does something with the reply.

Public write-ups in 2026 use the same split. LangChain’s March 10, 2026 anatomy post says a harness is every piece of code, configuration, and execution logic that is the model’s surroundings, and it writes the shorthand as agent equals model plus harness. The parts it lists are system prompts, tools and their descriptions, bundled infrastructure such as a filesystem, a sandbox, and a browser, orchestration, and hooks that run fixed code for jobs such as compaction, continuation, and lint checks.

Databricks’ explainer, published June 17, 2026, defines an agent harness as the software infrastructure wrapped around a large language model so the model can act on tasks. It names tools, memory, a workspace, and guardrails. OpenAI’s developer post on Codex as a platform, live when this page was checked, calls the harness the surrounding execution system: the part that keeps context, calls tools, handles failures, asks for approval, and returns a result.

A research definition is narrower and still useful. The Meta-Harness paper, arXiv:2603.28052, first posted March 30, 2026, describes a harness as the code that determines what information to store, retrieve, and present to the model.

Those sentences agree on the boundary. They leave room for argument about whether a particular file is “prompt” or “harness.” On this site the practical test is simple. If it is code or configuration around the weights, it belongs to the harness.

How do a model, a harness, and an agent differ?

Databricks’ June 17 explainer separates the three words. The model reasons and generates the next output. The harness executes actions, manages memory, runs tools, and enforces rules. The agent is the working system that combines the two.

A prompt sits inside that picture. It is the text the model sees on one call: standing instructions, the user goal, tool schemas, and recent observations. In an agent, the harness rebuilds that text on every turn. Prompt wording matters. It is one file in the workshop, which is why harness engineering is a wider job than prompt writing. Databricks’ table in the same post puts prompt engineering, context engineering, and harness engineering in that order. The last one’s artifact is the harness.

The language model glossary entry is the right place for what a model is. This page stays on the workshop.

What happens in one loop?

Many agents repeat a small cycle. The model reads the current context and chooses a next step. The harness carries out that step. The harness puts the result back into the context. The model chooses again. The cycle ends when a stop rule fires.

Shunyu Yao and coauthors named a version of this pattern in 2022: interleave a written reasoning trace with an action, then read the observation. The paper is ReAct. Databricks’ 2026 explainer and LangChain’s March post both describe production agents in those terms. The 2022 scores belong to that paper’s models and tasks. The research note says so. The pattern is what traveled.

A current product loop is more specific than the paper. Anthropic’s agent-loop page for the Claude Agent SDK, checked November 3, 2026, describes five beats. The SDK delivers the prompt, the system prompt, the tool definitions, and the history. Claude answers with text, tool calls, or both. The SDK runs the requested tools. The cycle repeats until Claude produces a response with no tool calls. The SDK then yields that text and a result message with token usage, cost, and a session id. Hooks can intercept, change, or block a tool call before it runs.

Stop rules differ by product. The loop page says the cycle continues until the model produces a response with no tool calls. The quickstart says the loop also ends when the run hits an error. OpenAI’s running-agents guide treats a max-turn limit, a guardrail exception, and a tool error as failures, and treats a human approval as a pause. A pause is meant to resume from the same saved state. A new user turn is a different event.

Which parts does a harness usually contain?

Vendors group the parts differently. The rows below are the pieces that show up, under those names, in the sources linked from this guide.

Part What it is for A public description
Tools Let the model ask for a search, a file edit, a command, or an API call. The harness runs the call and returns the result. Anthropic’s Agent SDK overview lists built-in tools for reading, writing, editing, commands, and web search. See tool use.
Sandbox Give those commands a bounded machine so a bad step stays inside it. OpenAI’s sandbox guide separates the harness, which it calls the control plane, from the sandbox, which it calls the execution plane.
Files and memory Keep notes, plans, and progress that outlast one context window. Anthropic’s November 26, 2025 note uses a progress file, a feature list, and git. Pydantic documents a memory notebook.
Orchestration Choose the next step, tool, or specialist, and who owns the reply. OpenAI’s orchestration guide. Glossary: orchestration.
Guardrails Allow, block, replace, or pause an action. OpenAI’s guardrails page and Pydantic’s guardrail docs. Glossary: guardrail.
Checks before “done” Require evidence, such as a test or a click-through, before a feature counts as finished. Anthropic’s long-running notes, linked below, use a feature list and browser checks.
Traces Record the calls, the cost, and the failures so a person can reconstruct the run. Microsoft’s Agent Framework overview includes observability on its Harness Agent. OpenAI’s SDK overview points tracing at its observability guide.

Context windows fill up. Harnesses then summarize, drop, or retrieve. LangChain’s March post calls the quality drop “context rot” and describes compaction, offloading large tool output to files, and loading skills only when needed. Anthropic’s March 24, 2026 note, cited below, separates compaction (a summary inside the same session) from a full context reset plus a handoff file.

Retrieval is one way to fill the window. It is a memory tactic. Tool use is the step outside the text box. A harness can use both.

What is harness engineering?

Harness engineering is the discipline of designing that workshop on purpose.

OpenAI’s February 11, 2026 post by Ryan Lopopolo describes one internal experiment under that name. The team’s line is that humans steer and agents execute. The post says humans never directly contributed code on that project, and that Codex wrote the application, tests, CI configuration, documentation, observability, and internal tooling. The first commit to an empty repository landed in late August 2025. The post says the initial scaffold was generated by the Codex CLI using GPT-5. Five months later, the post says, the repository held on the order of a million lines, about 1,500 pull requests had been opened and merged, and a team of three engineers had driven the agents, later growing to seven. It reports an average of 3.5 pull requests per engineer per day for that earlier team of three, and says throughput rose as the team grew. It says the product had hundreds of internal users, including daily power users, and that the authors estimate the build took about one tenth of the time a hand-written version would have taken. Those figures are the company’s account of its own beta. This page does not have a separate audit.

The engineering claim in that post is about the human job. Early progress was slow because the environment was underspecified. The fix the authors describe is a missing capability made legible and enforceable, rather than a request to try harder. They made the app, its logs, and its metrics readable to the agent, including a per-worktree copy of the app and a local observability stack. They say they regularly see a single Codex run work on one task for upwards of six hours. They also say a single giant instruction file failed: context is scarce, a file that marks everything as important guides nothing, and the file rots. Their replacement was a short AGENTS.md, about 100 lines, used as a map, with a docs/ tree as the system of record.

GPT-5 in that story is the model the post names for the August 2025 scaffold. It is a historical detail of the experiment. It is a poor label for “the model in Codex” on a later date.

Databricks’ June 17 table is the clean teaching version of the same shift. Prompt engineering writes a better input. Context engineering chooses what the model sees, and when. Harness engineering designs the tools, sandboxes, loops, and guardrails. The first two live inside the third.

LangChain’s March 10 post adds a research-shaped caution. It says products such as Claude Code and Codex are post-trained with the harness in the loop, so a model can get worse when the tool format changes, even if a person would find the new format easy. That is the company’s argument, tied to a Codex prompting guide it cites. Treat it as a reason to test a harness change, which the next sections take up.

How is a framework different from a harness?

A framework is a library. A harness is a configured run: which prompts, tools, sandbox, approvals, and stop rules are actually in force.

This site’s agent frameworks category is the library shelf. The LangChain listing says the framework is the open-source library, and the harness is the runtime around the model. CrewAI and smolagents are on that shelf too. The harness comparison tracker stays empty until every cell in a matrix has its own source. The table in the next section is a narrower substitute: what each vendor’s own docs call the harness, checked on November 3, 2026. Prices and plan limits live on the directory listings, where this site records a last-checked date, and on the vendor pages.

How do current products divide the work?

Product What the vendor’s docs say Where the loop runs
Claude Agent SDK Anthropic’s overview says the SDK gives you the same tools, agent loop, and context management that power Claude Code, including permissions, sessions, hooks, subagents, and MCP. A Python or TypeScript process you operate. The SDK runs the Claude Code binary.
Anthropic Managed Agents The same overview calls Managed Agents a hosted agent harness. Sessions sit in an Anthropic-managed cloud sandbox or a self-hosted sandbox. Anthropic’s service, or a sandbox you host. This is a different product from the Agent SDK.
OpenAI Agents SDK The sandbox guide says the harness owns the agent loop, model calls, tool routing, handoffs, approvals, tracing, recovery, and run state. The sandbox is the machine that reads files and runs commands. Your application, in the TypeScript or Python SDK. The SDK overview says the Agents API is the managed harness in OpenAI’s service.
Codex The Codex platform post says one open-source harness powers the app, the CLI, and the IDE extension. It gathers context, uses tools, applies sandbox and approval rules, and carries work forward. Model access stays separate from that open-source layer. The Codex app, CLI, or IDE, or your own app through the Codex SDK, codex exec, or app-server.
Microsoft Agent Framework The overview describes a Harness Agent for long, multi-step tasks: planning and todo tracking, context compaction, file access and memory, don’t-ask-again tool approval, and observability. Graph and function workflows are the path when the steps are fixed. Microsoft calls the framework the successor to Semantic Kernel and AutoGen, and says that if you can write a function for the task, do that instead of using an agent. Your app. The overview shows Python and .NET, and says the Go SDK is in public preview and requires Go 1.26 or later.
Google ADK 2.0 The ADK 2.0 page says the release moves from a hierarchical executor to a workflow runtime. Agents, tools, and functions are nodes in a graph. It also describes dynamic workflows and collaborative workflows with a coordinator and subagents. Your process. The page says ADK 2.0 is available for Python, TypeScript, and Go. It dates general availability to May 19, 2026 for Python, June 30, 2026 for Go, and August 21, 2026 for TypeScript.
Pydantic AI Harness The harness docs say every Pydantic AI agent already has a light harness: a typed loop, a model, tools, and structured output. The harness package adds a workspace, a plan, memory, sub-agents, context management, and durable execution for long jobs. Guardrails can allow, block, replace, retry, or defer a tool call for approval. Your process. The quick start says LocalWorkspace runs on your machine and is a sandbox only if you swap in one. The page names Modal, E2B, Sprites, Daytona, and boxd. Its example model string, on the page checked November 3, 2026, is anthropic:claude-opus-5-5.

Read a row as a pointer, then open the vendor page before you depend on a detail. Model names in sample code move. The Claude and Codex listings are the product doors on this site.

Why do long tasks need a stronger harness?

A single loop works while the job fits in one context window and the model stops at the right time. Long jobs break that assumption. Each new session starts without the previous session’s memory, and a model can declare victory early or try to build the whole thing at once.

Anthropic’s November 26, 2025 engineering note calls the Claude Agent SDK a general-purpose agent harness and says compaction, by itself, was not enough. In the team’s experiments, a high-level prompt such as “build a clone of claude.ai” produced two failure patterns. The agent tried to do too much at once and left the next session with a half-built feature. Or a later session saw some progress and declared the job done. The note’s response has two prompts on one harness. A footnote says the system prompt, tools, and harness stayed the same. Only the initial user prompt changed.

The initializer prompt asks for an init.sh script, a claude-progress.txt log, an initial git commit, and a feature list. In the claude.ai-clone example the list held over 200 features, each stored as JSON with "passes": false. The note says the model was less likely to overwrite JSON than Markdown, and the coding prompt told the agent to change only the passes field. Later sessions work on one feature, commit, and update the progress file. The note also says the agent marked features done after unit tests or curl checks that missed end-to-end bugs, until the prompt required browser testing through the Puppeteer MCP, used the way a person would click.

Anthropic’s March 24, 2026 note keeps the one-chunk handoff and adds a split between the agent that builds and the agent that judges. A planner turns a short prompt into a product spec. A generator implements one sprint at a time. An evaluator clicks through the running app with the Playwright MCP and grades the sprint against thresholds. Before the sprint, the two sides agree on a sprint contract. The note also names “context anxiety”: some models start wrapping up as they approach what they believe is the context limit. Compaction keeps a shortened history in the same session. A reset clears the window and depends on the handoff file. The note says the reset costs extra orchestration, tokens, and latency.

OpenAI’s February post describes a related habit from the other direction. Humans may review pull requests. The post says that over time almost all review effort moved to agent-to-agent checks, while people still set intent and looked for missing capabilities. Autonomy on this site is that permission question: how far the loop may run before a person confirms the next step. A coding agent that opens a pull request, and a system that would design the next frontier model alone, are different permission levels. The November 3, 2026 news note stays on the second one, using Anthropic’s own SEC filing.

How can the same model score differently?

A benchmark measures a bundle. The bundle includes the model, the prompt, the tools, and the harness settings. OpenAI said this directly on July 29, 2026.

On the ARC-AGI-3 public set, OpenAI reports that GPT-5.6 Sol scored 13.3 percent with the official harness and 38.3 percent after two changes: retained reasoning and compaction. The score is Relative Human Action Efficiency. From official gameplay logs, OpenAI estimates the average human tester at 48 percent. The post says the official harness threw away private reasoning after each action and used rolling truncation once the conversation passed 175,000 characters, so older actions disappeared. OpenAI’s reimplementation kept reasoning by passing the previous response id on the Responses API, and it replaced truncation with compaction. The post says that for GPT-5.6 Sol at the max setting, the two changes together yielded roughly three times the score and about six times fewer output tokens. The model page for gpt-5.6-sol was still online on November 3, 2026. The 13.3 and 38.3 figures are that July measurement on that public set. They are not a leaderboard of every model available three months later.

The mechanism is the part to keep. The official harness, OpenAI writes, was generic on purpose, so model gaps would be easier to see. A production harness is tuned to the model’s settings, including whether earlier reasoning stays in the transcript. Comparing two models on different harnesses mixes those choices together.

Two other dated reports point the same way, with their own limits.

LangChain wrote on March 10, 2026 that changing only the harness moved one of its coding agents from the top 30 to the top 5 on Terminal-Bench 2.0. That is the company’s account of a leaderboard on that date.

The Meta-Harness authors, in the March 30, 2026 abstract, report three of their own results. On an online text-classification task, their search beat a context-management system they call state of the art by 7.7 points while using four times fewer context tokens. On retrieval-augmented math, one discovered harness improved accuracy by 4.7 points on average across five held-out models, on 200 IMO-level problems. On agentic coding, they say the discovered harnesses surpassed the best hand-engineered baselines they report on TerminalBench-2. Those are the authors’ measurements. The weight-space programming note on this site cites the paper for a different reason: a harness still wraps a model whose weights someone is trying to edit. The Builders and Research doors are the places those threads continue.

What should a beginner check first?

Start with the job, then the workshop.

  1. Write down the stop rule. “The model stopped talking” and “the test passed” are different finishes. Anthropic’s feature list is one way to make the second kind explicit.
  2. List the tools the run may call. Pydantic’s harness quick start says LocalWorkspace runs file tools and commands on your machine and is a sandbox only after you swap in a sandbox capability. Commands there can reach anything you can reach.
  3. Decide which steps wait for a person. OpenAI’s approval flow pauses the same run and resumes it from saved state. That is a guardrail plus a human gate.
  4. Keep a record outside the chat. A progress file, a git commit, or a trace lets the next session see what the last one did.
  5. When you compare models, hold the harness still, or say that you did not. The July 29 ARC-AGI-3 note is the short version of why.

The task performance topic is where this site follows coding, computer use, and office work. The harnesses topic is the shelf for this guide and the ones that will sit beside it.

Where can you read more on this site?

Frequently asked questions

What is an AI agent harness?

It is the software around a language model that lets the model take steps. It holds the tools, the memory, the permissions, the record of what happened, and the rule for when to stop. On this site, an agent is the model plus that harness.

How do a model, a harness, and an agent differ?

The model reads context and produces the next text, including a request to use a tool. The harness runs the tool, stores the result, and decides what the model may see and do. The agent is the working combination. Databricks’ June 17, 2026 explainer and LangChain’s March 10, 2026 explainer both write this as agent equals model plus harness.

What is harness engineering?

It is the work of designing that surrounding system. OpenAI’s February 11, 2026 post uses the phrase for engineers who specify intent, shape the tools and the repository, and build feedback loops so agents can do the implementation. Writing a better prompt is one part of the job.

Is an agent framework the same thing as a harness?

A framework is a library for building agents. A harness is the running system: the prompts, tools, sandbox, permissions, and stop rules for a job. The directory lists the libraries. Two apps can import the same library and still run different harnesses.

Why can the same model score differently in two harnesses?

The score includes the settings around the model. On July 29, 2026, OpenAI reported that GPT-5.6 Sol scored 13.3 percent on the ARC-AGI-3 public set with the official harness and 38.3 percent after retained reasoning and compaction. The metric was Relative Human Action Efficiency. That pair is one dated measurement.

What is a guardrail in an agent harness?

A guardrail is a check that can allow, block, replace, or pause an action. OpenAI’s Agents SDK uses the word for automatic checks, and uses a separate approval step when a person must decide. Pydantic’s harness docs put a callable on the prompt, the tool call, and the final output.

Sources

Related