Resources

Best Harness Engineering Tools [Compared]

Compare harness engineering tools for AI agents: Claude Code, Codex, LangGraph, MCP, Docker, evals and tracing, with starter stacks by goal.

Abhishek Ashtekar presenting an open toolbox containing agent component symbols.
On this page
  1. What counts as a harness engineering tool
  2. Coding agents: finished harnesses you configure
  3. Managed agent harnesses: hosted loops and sandboxes
  4. Agent SDKs and frameworks: parts you assemble
  5. Tool protocols: the Model Context Protocol
  6. Sandboxes and isolation tools
  7. Testing and evaluation tools
  8. Tracing and observability tools
  9. Harness engineering tools compared
  10. Starter stacks by goal
  11. How to choose harness engineering tools
  12. Frequently asked questions
  13. Where the book fits
  14. Final thoughts
  15. Sources and further reading

The short answer

Harness engineering tools are the software that runs and controls the layer around an AI model. Coding agents and SDKs run the agent loop. Protocols connect tools, sandboxes limit what an action can reach, and test and tracing tools prove that a run worked. For most projects, a small stack is best: one agent, one sandbox, one test runner and one trace.

Choosing harness engineering tools can feel like walking into a hardware shop without knowing what you are building. Every list tells you which framework is popular. Very few tell you which job it would take off your hands, and that is the thing you need to know.

So I have grouped the tools by the work they do. For each one, you will see what it controls, who it suits and where it will let you down. At the end there is a comparison table and a set of starter stacks, so you can choose without trying everything.

What counts as a harness engineering tool

A harness engineering tool is software that controls how an AI model acts, rather than what the model knows. A harness gives a model instructions, tools, permissions, saved state, stop rules and checks. If the idea is new to you, read what harness engineering is first.

Prompt templates and retrieval systems shape what goes into the model, so they belong to prompt and context engineering. The comparison of harness, prompt and context engineering explains where that line sits.

Every claim below comes from the tool's official documentation or GitHub repository, checked in November 2026. The guide lists no prices, because prices change often, and nothing here is a paid placement.

The guide uses one running example. Suppose your team wants an agent to fix failing tests in one Python repository. Some categories end with what that team needs from them.

Coding agents: finished harnesses you configure

A coding agent is a complete harness for software work. It already has a loop, file and shell tools, permission prompts and a way to load project instructions. You configure it rather than build it.

Claude Code

Claude Code is Anthropic's coding agent. It runs in your terminal, in VS Code and JetBrains, in a desktop app and in the browser. At the start of each session it reads your CLAUDE.md files, and from version 2.1.277 it can read AGENTS.md instead, as its memory documentation explains. By default, that needs a working directory with no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in it or above it. Your personal ~/.claude/CLAUDE.md does not count.

You control it in three ways. Permission rules allow an action, ask you first or deny it, and Claude Code checks deny before ask and ask before allow. Hooks run your own code, so a PreToolUse hook can block a tool call and a Stop hook can send Claude back to work. An optional sandbox limits the files and domains that shell commands can reach.

It suits a team that wants a ready agent in an existing repository with detailed rules. Keep in mind that it is a proprietary product. The documentation says to use bypassPermissions mode only in containers or virtual machines. The sandbox is off by default, and even when it is on, shell commands can still read most of the machine, including ~/.ssh.

Codex CLI

Codex CLI is OpenAI's coding agent for the terminal. It works on your local repository, and its source code is on GitHub under the Apache-2.0 licence. When you run /init, it creates an AGENTS.md file for you.

According to the AGENTS.md guide, Codex loads a global file from ~/.codex and then walks from the project root to your current folder. A file closer to your work overrides earlier guidance. Its sandbox has three modes, read-only, workspace-write (the default) and danger-full-access, and an approval policy such as on-request or never decides when it stops to ask you.

Choose it if you want an open source agent with a sandbox that the operating system enforces. Codex uses Seatbelt on macOS, bubblewrap on Linux and a native sandbox on Windows. By default it loads up to 32 KiB of instruction files in total, and you can change that. If you have an old configuration file, check it, because Codex no longer supports untrusted as an approval policy.

For the running example, either agent fits. Give it a short AGENTS.md that names the test command. Run Codex in workspace-write mode. In Claude Code, turn the sandbox on and deny reads of your credential folders. One file can serve both tools, as the question on sharing one instruction file explains.

Managed agent harnesses: hosted loops and sandboxes

A managed agent harness runs the loop, the tools and the sandbox on a provider's servers. You send configuration and tasks through an API. Anthropic and AWS both describe their hosted offering as an "agent harness".

Claude Managed Agents

Claude Managed Agents is Anthropic's "pre-built, configurable agent harness that runs in managed infrastructure". You define an agent and an environment and start sessions. Anthropic looks after the loop, the tool execution, the sandbox and the session state, while Claude runs bash, edits files, searches the web and calls MCP servers in a cloud sandbox or one you host.

It is a good choice for long or asynchronous tasks when you do not want to build the loop and the sandbox yourself. It is still in beta and runs Claude models only. Sessions keep their history on the server, so it is not eligible for Zero Data Retention unless you host it.

Amazon Bedrock AgentCore harness

The AgentCore harness is a generally available managed harness from Amazon Web Services. You declare the model, the tools, the skills and the instructions as configuration, and Strands Agents powers the rest. Each session runs in its own isolated microVM with a file system and a shell, and AgentCore handles memory, identity, networking and tracing. The models can come from Amazon Bedrock, OpenAI, Google Gemini or a LiteLLM-compatible provider.

Teams on AWS will like it because they get production hosting without managing servers. The price is that your runtime is tied to AWS. When configuration is no longer enough, you can export the harness to Strands code.

Agent SDKs and frameworks: parts you assemble

An SDK sits between a finished agent and plain code. You write the application, and the library supplies the loop, tool calling, state or tracing. Each option below decides a different amount for you.

Plain Python

Plain Python means your own loop, written with the standard library. My harness engineering tutorial builds one in 114 lines, with eight tests that run offline. You control everything, from the allowed tools and the input checks to the step budget and the final check.

Build one of these before you adopt a framework, so that you can see what the framework is doing for you. It also works well for small tasks with fixed tools. You will have to write whatever is missing, such as storage across machines, parallel workers, retries and approval queues.

Claude Agent SDK

The Claude Agent SDK gives you the tools, the loop and the context management behind Claude Code as a Python and TypeScript library. You get file and shell tools, hooks, subagents, MCP, permissions and sessions that you can resume or fork.

Use it when your product needs to behave like Claude Code inside your own process. It runs Claude models only. The Python package is MIT-licensed, but Anthropic's Commercial Terms govern its use, and you sign in with an API key.

OpenAI Agents SDK

The OpenAI Agents SDK is a Python framework with "very few abstractions", built around agents, handoffs and guardrails. It manages handoffs between agents, input and output guardrails, sessions, tracing and human approval. It can call MCP tools, and its sandbox agents work in isolated workspaces.

It fits a design with several specialised agents, where the handoff between them is the hard part. It uses OpenAI's Responses API by default and reaches other providers through adapters such as LiteLLM, so test your model before you commit.

LangGraph

LangGraph is a "low-level orchestration framework and runtime for long-running, stateful agents". You describe the work as a graph of nodes, and you can use it without LangChain. It saves state with checkpoints, using InMemorySaver for tests, SqliteSaver for development and PostgresSaver for production. Interrupts pause a graph for approval, and Command(resume=...) continues it on the same thread.

Choose it for long work that must pause, recover from a crash or wait for a person. For a simple agent with two tools, a graph is extra code. Be careful when you resume, because the interrupted node starts again from its beginning, so anything before interrupt() must be safe to repeat. If you would like a ready loop on top of it, LangChain offers Deep Agents, which it calls "the agent harness for complex, multi-step work".

Strands Agents

Strands Agents is an Apache-2.0 toolkit from AWS for Python and TypeScript. It comes as a Harness SDK for building your own, and as Strands harness, which is a fully assembled agent. The model plans the steps while you supply the tools and the limits. It connects to MCP servers and supports many providers, including Amazon Bedrock, Anthropic, OpenAI and Ollama.

It suits teams on AWS, and teams that want to change models without a rewrite. It moves quickly. Harness 0.4.0 came out on 12 November 2026 with a breaking change, so pin your versions.

Tool protocols: the Model Context Protocol

A direct function is the simplest tool interface. You write a function, describe its arguments and decide in your own code whether a call may run. For a tool that one application uses, that is enough.

MCP

The Model Context Protocol (MCP) is an open standard for connecting AI applications to outside systems. An MCP server offers tools that the model can call, resources that provide data and prompts that act as templates. The architecture guide describes two transports, stdio for local servers and Streamable HTTP for remote ones. In protocol version 2026-07-28, MCP is stateless, so each request carries its own version and capabilities.

MCP is worth it when one integration must work in several places, such as Claude Code, Codex and your own application. It standardises the connection and nothing else. The guide says it "focuses solely on the protocol for context exchange", so your harness still decides whether a tool runs. Version 2026-07-28 also deprecates roots, sampling and protocol logging.

Sandboxes and isolation tools

A sandbox decides how much damage a wrong action can do. Claude Code and Codex CLI have their own sandboxes, but Claude Code's is off by default and covers shell commands only. Anthropic's sandbox environments guide says unattended runs need more than that sandbox. The two tools below add isolation that any agent can use.

Docker

Docker runs a process in a container, where kernel namespaces isolate it and control groups limit its resources. You decide which files, processes and networks the agent's commands can reach. With --network none, for example, the none network driver leaves the container with only a loopback device.

Use it for agents that run shell commands you would rather keep off your own machine. A container is as safe as its configuration, so a mounted home folder, cloud credentials or extra privileges will undo most of the protection. The daemon needs root unless you choose rootless mode, and containers share the host kernel.

For stronger separation, Docker Sandboxes gives each agent a microVM with its own kernel. A directly mounted workspace stays writable on the host, so review the agent's changes before you run them. Anthropic's guide says a dedicated virtual machine gives the strongest separation.

git worktree

git worktree is a built-in Git command that gives you a second working copy of a repository. Each task gets its own folder and branch, so a bad edit stays away from your main checkout. It is ideal when several agents work on one repository. It isolates files only, and it does nothing about commands, the network or your credentials.

For the running example, a worktree plus the coding agent's sandbox is a sensible start. To practise deny-first rules and a Docker sandbox, work through the companion permissions and sandbox project.

Testing and evaluation tools

Tests and evaluations answer different questions. A test checks fixed behaviour, such as whether the harness rejects an unknown tool. An evaluation measures how often the agent solves a set of tasks.

pytest

pytest is the standard testing framework for Python, under the MIT licence. Use it for fast, repeatable checks on the code of your harness, such as input validation, refused operations, budget limits and the verifier. The tests should finish in seconds, so you can run them after each change. Remember what they cannot tell you. A green suite says nothing about how often a real model finishes the task.

Inspect

Inspect is an MIT-licensed evaluation framework from the UK AI Security Institute and Meridian Labs. It manages your tasks, the scoring and the agent runs. It has built-in bash, Python, web search and computer tools, supports MCP, and can run outside agents such as Claude Code and Codex CLI.

Choose it for repeatable evaluations, especially when you want untrusted code in Docker, Kubernetes or another sandbox. You write the tasks and the scorers, so a weak definition of success will give you weak results.

promptfoo

promptfoo is "an open-source CLI and library for evaluating and red-teaming LLM apps", under the MIT licence. You write test cases and assertions, and it runs them, along with security scans, on your machine or in CI/CD. It works well as a regression and security test whenever you change a prompt, a tool or a model.

OpenAI announced a deal to acquire Promptfoo in March 2026 and said it would keep building the open source project. Watch the roadmap if you depend on it.

The guide on how to test AI agents shows how to define success first and then build a small task set.

Tracing and observability tools

A trace records what the agent did, step by step, so you can find where a run first went wrong. For a small local harness, one JSON line per step is often enough: run ID, action, result, duration and status, with no secrets.

OpenTelemetry

OpenTelemetry is an open standard and toolkit for producing, exporting and collecting traces, metrics and logs. It gives your agent traces the same format as the rest of your system, and its semantic conventions for generative AI now have their own repository that covers GenAI clients and MCP. Teams choose it because it does not tie them to one vendor. The documentation says that it "is not an observability backend itself", so you still need somewhere to store and read the data.

Langfuse

Langfuse is an open source platform for tracing, evaluation and prompt management, and you can host it yourself. Its tracing is based on OpenTelemetry. It stores your traces and lets you review them beside datasets, scores and prompt versions.

It is a good fit when you want agent traces on your own servers. If your team already uses LangGraph, LangChain's LangSmith does a similar job. The core of Langfuse is MIT-licensed, and its enterprise folders have a separate licence. ClickHouse acquired Langfuse in January 2026, and the team said it had no plans to change the licence.

When a trace shows a failure you cannot explain, the guide to why AI agents fail helps you name the missing harness responsibility.

Harness engineering tools compared

The table puts the seventeen tools side by side. The "What it controls" column names the harness responsibility each tool takes over.

Tool Category What it controls Best for Open source
Claude Code Coding agent Allow, ask and deny rules, hooks, optional OS sandbox A ready agent in an existing repository No
Codex CLI Coding agent Layered AGENTS.md, OS sandbox, approval policy An open source terminal agent Yes, Apache-2.0
Claude Managed Agents Managed harness Hosted loop, tools, sandbox, sessions Long tasks without your own infrastructure No (beta)
AgentCore harness Managed harness MicroVM per session, memory, identity, tracing Production agents on AWS No
Plain Python Your own code Everything, written by you Learning and small fixed tasks Your code
Claude Agent SDK Agent SDK Claude Code's loop, tools, hooks, sessions Claude Code's harness in your product MIT code, Commercial Terms for use
OpenAI Agents SDK Agent SDK Handoffs, guardrails, sessions, tracing Several agents that hand work over Yes, MIT
LangGraph Orchestration Graph state, checkpoints, interrupts Work that pauses, resumes or waits Yes, MIT
Strands Agents Agent SDK Model-driven loop, MCP tools, many providers AWS teams and model switching Yes, Apache-2.0
MCP Tool protocol How tools, resources and prompts reach the model One integration across several hosts Yes
Docker Sandbox Process, file and network isolation Commands you do not want on your host Engine (Moby), Apache-2.0
git worktree Workspace isolation A separate working copy per task Parallel tasks in one repository Yes
pytest Testing Fixed checks on harness code Fast tests on every change Yes, MIT
Inspect Evaluation Task sets, scoring, sandboxed runs Repeatable agent evaluations Yes, MIT
promptfoo Evaluation Assertions and red teaming in CI Regression and security tests Yes, MIT
OpenTelemetry Tracing standard Vendor-neutral traces, metrics and logs Traces that join your other systems Yes, Apache-2.0
Langfuse Observability Trace storage, evaluations, prompt versions Tracing you can self-host Core MIT, enterprise parts separate

No single row replaces the others. The running example needs a coding agent, a sandbox and the repository's own tests, and nothing more on day one.

My free resource pack also has a list of 20 tools and a list of 10 open-source harnesses to study.

Starter stacks by goal

Start from your goal, then add one tool for each real problem you meet.

Goal Starter stack Add later when you need it
Learn how a harness works Plain Python, a scripted model, unittest or pytest, a JSON trace A real model provider, then the companion projects
Let an agent work in your codebase Claude Code or Codex CLI, AGENTS.md, a git worktree, the repository's tests Hooks, a stricter sandbox, Docker for risky commands
Build an agent into a product Claude Agent SDK, OpenAI Agents SDK or Strands Agents, pytest, OpenTelemetry Langfuse or LangSmith, an evaluation set in Inspect or promptfoo
Run long workflows with approvals LangGraph with a SQLite or Postgres checkpointer, pytest Tracing, operation IDs for external actions
Host agents for many users Claude Managed Agents or the AgentCore harness Your own evaluation set and trace reviews
Prove reliability before release Your current harness, Inspect or promptfoo, a fixed task set Repeated runs per task, a trace review for each failure

The running example uses the second row. The team runs Codex CLI in workspace-write mode with a short AGENTS.md that names the test command. A git worktree holds the task, and the existing test suite is the check.

How to choose harness engineering tools

Answer these five questions in order before you compare features. Each answer removes options.

  1. Write down the task and the evidence that proves it is done. If you cannot name a check, start with tests, not a framework.
  2. Decide whether you need a finished agent or a library. Use a coding agent for repository work and an SDK for an agent in your product.
  3. Name the worst action the agent could take. That answer sets your sandbox and permission rules.
  4. Decide whether the work must survive a restart or wait for a person. If yes, choose a tool with checkpoints or sessions.
  5. Decide how you will find the first failure in a bad run. Pick the smallest tracing setup that shows it.

Then build a one-day prototype of the same task in each remaining option. Check that you can stop and resume it, read a failed tool call and add an approval step.

Watch for three common mistakes:

  • Adding agents too early. Each extra agent adds handoffs, state and places for a failure to hide. Add one only when you can name its job and the check its output must pass.
  • Trusting a feature list. A checkpoint helps only if the saved state is enough to resume. Test each feature with a failure you care about.
  • Treating instructions as controls. Claude Code's documentation says CLAUDE.md files are context, not enforced configuration. Put rules that must hold into deny rules, sandbox settings or hooks.

Frequently asked questions

1. What are the best harness engineering tools for beginners?

Begin with plain Python, a scripted model and the built-in unittest module, because nothing is hidden from you. Then use one coding agent, either Claude Code or Codex CLI, on a small repository. Add an SDK such as LangGraph when you need saved state or an approval step, and not before.

2. Do I need LangGraph if Claude Code or Codex already acts as a controlled agent?

No, if all of your work happens inside one repository. Claude Code and Codex CLI already have a loop, permissions and a sandbox, although Claude Code's shell sandbox is off by default and covers shell commands only. LangGraph helps when you build your own application and it has to save state, survive a crash or wait for someone to approve a step.

3. Is MCP a must, or is function calling enough?

Function calling is enough when one application uses the tool. MCP earns its place when you want the same integration to work in several places, such as Claude Code, Codex and your own app. Whichever you choose, your harness still decides whether a call may run.

4. Is a Docker container enough to sandbox a coding agent?

A container lowers the risk, but it is only as safe as what you put inside it. It shares the host kernel, and a mounted folder or a password in an environment variable gives the agent a way out. Start with no network, a throwaway workspace and no secrets. If you need a stronger wall, use a virtual machine or Docker Sandboxes, which give each agent its own microVM.

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

A framework is a box of parts, and a harness is the machine you build with them. LangGraph is a framework. Claude Code, Deep Agents and the managed services are harnesses that you configure. If you want to see all six parts of one, read about the six parts of an agent harness.

6. Are Claude Code and Codex CLI open source?

Codex CLI is open source under the Apache-2.0 licence. Claude Code is a proprietary Anthropic product, although its documentation and configuration formats are public. Both can share one AGENTS.md, as the question on sharing one instruction file explains.

7. What do people use to trace and debug agent runs?

Many teams use OpenTelemetry as the trace format, with Langfuse or LangSmith to store and read the traces. For a small harness on your own computer, one JSON line for each step is often enough. Remember that a trace explains one run. You need an evaluation set to know whether a change made the agent better.

8. Which agent harness should I use?

For work in a code repository, use Claude Code or Codex CLI. For hosted agents, look at a managed harness such as Claude Managed Agents or the AgentCore harness. If the agent belongs inside your own product, build with an SDK or LangGraph. The starter stacks table gives the parts for each goal. If you are choosing between two tools, use the one-hour harness trial.

9. Which open-source agent harness should I build on?

Start with mini-swe-agent to learn, and look at Pi for your own product if you can supply the sandbox. These five publish their code under open-source licences:

  • Pi (MIT) has no built-in permission system, so run it inside a sandbox that you control.
  • mini-swe-agent (MIT) suits learning, with an agent class of about 100 lines of Python and bash as its only tool.
  • OpenCode (MIT) includes a build agent with full access and a plan agent. The plan agent denies file edits by default and asks before it runs bash commands.
  • Codex CLI (Apache-2.0) gives you a terminal agent with an operating system sandbox.
  • Goose (Apache-2.0) offers a desktop app and a command line.

10. Can I use Claude Code and Codex on the same project and share one instruction file?

Yes, the documentation for both tools supports one shared AGENTS.md. Set it up like this:

  • Codex reads AGENTS.md from the project root to your current folder. In each folder, it checks AGENTS.override.md first.
  • Claude Code (2.1.277 or later) reads AGENTS.md directly when the working directory and the folders above it have no project CLAUDE.md files. If you keep a CLAUDE.md, import the shared file with @AGENTS.md, or set Project instructions to claude-md-and-agents-md.
  • One copy of each shared rule. Two separate instruction files can drift apart. Keep shared rules in AGENTS.md, and put only tool-specific notes elsewhere.
  • Separate worktrees. Start Claude Code with claude --worktree name. Give Codex a plain Git worktree, or a Codex worktree in the ChatGPT desktop app.

Where the book fits

Tools come and go, and it is tiring to learn each new one from nothing. I wrote The Harness Engineering Blueprint to explain the jobs behind the tools, such as permissions, checkpoints, traces and evaluations. When you know the jobs, you can look at something new and see what it would take over for you. I believe it is the best book to learn harness engineering, although I am its author, so do not take me as a neutral reviewer.

The free companion course has eleven projects to practise on, and the harness engineering projects guide lists them in order. If you prefer to learn a tool from a teacher, look at these harness engineering courses.

Final thoughts

You do not need most of the tools on this page. Choose one row from the starter stack table and give it one narrow task that you can judge for yourself.

Before you install anything, write the check that will tell you the task is done. Then read the traces from your first five runs. If they show you a gap, come back and choose a tool that closes it.

Sources and further reading