Skip to content

Glossary

AI agent harness: the loop, tools, memory and limits around a model

The model decides. The harness is what lets the decision happen: it calls the tools, keeps the context and stops the run.

An AI agent harness is the code around a language model that runs its loop, gives it tools and memory, and enforces the limits it must stay inside. The model supplies the reasoning, and the harness supplies everything else an agent needs to finish a task: what it can call, what it remembers and when it must stop.

On this page
  1. What an agent harness holds
  2. Harness versus model, framework and protocol
  3. What a harness needs to reach

What an agent harness holds

Anthropic’s guide Building effective agents describes an agent as a model using tools in a loop, checking results from its environment at each step, and stopping when the task is done or a limit such as a maximum number of iterations is reached. The harness is the code that makes that loop run. Anthropic’s engineering team calls its Claude Agent SDK a general-purpose agent harness.

  • The loop: ask the model for a step, run it, return the result, repeat.
  • Tools: the list of things the model may call, each with a plain description of what it does.
  • Memory: what is kept between steps, and between sessions for work that runs for days.
  • Guardrails: the limits on what it may do, how many steps it gets and when a person must approve.

Harness versus model, framework and protocol

The model is the reasoning, and it comes from a lab. The harness is the program wrapped around it, whether you wrote it or took it from an SDK. A framework is a kit for building harnesses. MCP is one way a harness reaches tools, a standard connection rather than the loop itself.

What a harness needs to reach

A harness can only call what exists. For an agent that works with people outside your company, that means an inbox, a phone number, messaging and a browser, each reachable as a tool. Obsession is the toolkit for AI agents, through one API and one bill, and its pieces are those tools. A developer calls them from their own harness through the API, SDKs or MCP, and a persona keeps them under one identity.

Not quite. A framework is a library for building the harness. The harness is the finished program that runs the loop, tools, memory and limits for one agent.

The model proposes each step. The harness decides whether the step is allowed, runs it and returns the result, so it holds the limits the agent can’t talk its way past.

Many teams start from an SDK or a framework and add their own tools and limits. Building from scratch is worth it when you need control over memory, costs or what the agent may touch.

How to build an AI agent from scratch

Sources

In the order the page cites them. Every page was read on 24 Nov 2026.

  1. Building effective agentsAnthropic, 19 Dec 2024
  2. Effective harnesses for long-running agentsAnthropic, 26 Nov 2025

Start with the piece your agent needs, or a ready-made job.

Browse blueprints