Case & CodeA FIELD GUIDE TO AI
Start learning
Intermediate

Agent harness

Also: harnesses

In plain words

The code that runs an agent's tools. It can keep logs and limit what the agent may do.

The fuller definition

An agent harness is the surrounding software that runs and supervises an agent: supplying context, executing tool calls, tracking state, handling errors, and enforcing operational limits.

How it fits together
  1. Model

    Propose the next step

  2. Harness

    Validate, execute, record

  3. Environment

    Files and authorized services

A simplified relationship, not a screenshot or a complete design.

A concrete example

A document-review harness checks source IDs, saves progress, and stops an attempted rename outside the approved scope.

The distinction that matters

The model proposes or selects actions; the harness and permission system determine how those actions are executed.

Try it: step through a controlled agent run

Step through this deterministic teaching simulation. No real agent runs and no files are changed. Compare an allowed read with a proposed rename that exceeds the permissions.

HARNESS / CONTROLLED ENVIRONMENT
Context & state
Model
Permissions & tools
Task received

Read A01 and prepare a source-linked summary. No renaming or sending.

  1. Task received
Step 1 of 6

What belongs to the model?

Interpreting the request, proposing a next tool call, and generating a candidate answer. A proposal is not evidence that an operation has executed.

What belongs to the harness?

Passing the right context, applying permission checks, running authorized tools, recording results, and stopping at a defined limit. A robust design enforces important boundaries outside the model's prose.

Related terms

Where it is taught

Prompts, skills, workflows, and agents

Source and further reading

Anthropic · Effective harnesses

The definition and example are written for this library. The link gives background, official documentation or legal authority as labelled. Legal scope depends on the jurisdiction and current text; product features depend on release and settings.

Lessons, terms, practical guides and sources ESC