Agent harness

Definition

An agent harness is the software wrapped around an AI model that turns it into a working agent: it supplies the tools, file access, permissions, memory and the loop that chains actions together. The model does the reasoning; the harness decides what it can see and do.

By Ronan Liedmeier, fractional head of growth and course author · Published 17 October 2026 · Last updated 17 October 2026

Also called: agentic harness, agent scaffold

The same model can behave very differently in two harnesses.

How it works

Claude Code's glossary puts it plainly: Claude Code is the harness, and Claude is the model inside it. A harness takes care of four jobs:

  1. Tools: which actions exist and what each one may touch.
  2. Context: what the model sees on each step (instruction files, loaded skills, earlier results) and what gets summarized when space runs out.
  3. Permissions: which actions run freely and which wait for a person to approve.
  4. The agent loop itself, including when it stops.

A useful split inside a harness is between rules that always run, such as hooks written in code, and instructions the model applies by judgment, such as a project instructions file.

Example

An agency runs Claude Code every night, with nobody watching, to pull ad spend from three platforms into one client report. Its harness setup gives the run read-only ad-platform tools, a hook that writes every API call to an audit log, and a separate instructions file per client. The team uses the same model in chat during the day. The nightly run is safe to leave alone because of the read-only tools and the log.

Common mistake

Blaming the model for behavior that comes from the harness setup, such as an agent editing files it shouldn't because write access was left open. Check the tool list and the permissions before switching models.

Learn it in AI Academy

Related terms

Claude Code
Claude Code is Anthropic's AI agent that works inside your files and terminal: it reads a project, edits files, runs commands and connects to other tools. Anthropic built it for software work, but it also handles other tasks made of files, APIs and repeatable steps.
Agent loop
An agent loop is the repeating cycle an AI agent runs to finish a task: it plans a step, calls a tool, reads the result and decides whether to continue or stop. The loop ends when the goal is met or a limit is reached.
Context engineering
Context engineering is the practice of deciding what information an AI model sees each time it works: the instructions, documents, tool descriptions, memory and conversation history. It extends prompt engineering from the wording of one request to everything loaded around it.
AI guardrails
AI guardrails are checks and limits placed around an AI system that block or flag unsafe or wrong inputs and outputs before they cause harm. The strongest ones run as code outside the model, so a cleverly worded request can't talk its way past them.

Sources

Browse all terms

Find your next step with AI