TL;DR: The harness is the software around a model that turns it into an agent: it loads instructions, assembles context, calls the model, checks whether the chosen action is allowed, runs it in a sandbox, records the result, keeps the context window under control, verifies the work and decides when to stop. Two agents built on the same model can differ widely because their harnesses do. A PM owns the parts that encode product judgment: what counts as done, what the agent may do without asking, how much it may spend, and what is kept when the run ends.
Model plus harness
Ask why one coding agent finishes a task and another, on the same model, wanders off. The answer is rarely the model. It is what the model is shown, which tools it gets, whether a failing test sends it back to work, and whether anything stops it from deleting the wrong directory.
Vendors now ship harnesses as products. Anthropic describes its Agent SDK as giving developers "the same tools, agent loop, and context management that power Claude Code". OpenAI's Agents SDK offers a deliberately small set of parts: agents, handoffs between them, guardrails and tracing. Both treat the loop the same way: the model evaluates the task, calls tools, receives the results and repeats until the task is complete.
Anthropic's engineers put the design principle in one sentence: every component in a harness "encodes an assumption about what the model can't do on its own". That makes the harness a list of bets about the model's weaknesses, and those bets expire. A planning step that a weaker model needed may only slow down a stronger one. Re-test the harness when the model changes, not only the model.
Nine jobs on every turn
Follow the flow, one stage at a time.
Illustrated sequence; animation speed does not represent processing time.Read diagram description
The harness loads instructions, assembles context, calls the model, checks permission for the chosen action, runs the tool inside a sandbox, records the result in the session log, manages the context window, verifies the work and decides whether to stop. Until the task is done or the budget runs out, it loops back to assembling context.
| Job | What it decides | The product question |
|---|---|---|
| Instructions | What the agent knows about this project before it starts | Who maintains the instruction file, and is it reviewed like code? |
| Model call | Which model, at what effort, with which tools offered | Is this step worth a larger model or more reasoning? |
| Context assembly | Which history, documents and tool results the model sees | What is the agent missing when it fails? |
| Permission check | Whether this action runs, waits for a person, or is refused | Which actions are safe to run unasked? |
| Sandbox | What a running tool can touch | If the agent goes wrong, what is the worst it can reach? |
| Session log | What happened, in order | Can we replay and audit a run? |
| Context management | What to drop or summarise as the window fills | What must survive a long run? |
| Verification | Whether the work meets the bar | Who or what says "done"? |
| Stopping | Done, out of budget, or needs a person | What does a run cost at most? |
Sandbox and approval are different controls
It is tempting to treat "the agent asks before acting" as the whole safety design. OpenAI's Codex documentation separates the two controls cleanly: "The sandbox defines technical boundaries. The approval policy decides when the agent must stop and ask before crossing them." Claude Code's permission modes run from asking for every edit, through accepting edits, to an automatic mode, and reserve the mode that skips all checks for isolated containers and virtual machines. Deny rules apply in every mode.
Asking is weaker than it looks. Anthropic reported in March 2026 that users accepted 93% of Claude Code's manual permission prompts, which is a sign that many approvals are reflexive. It replaced some prompts with model-based classifiers and published their error rates: a false-positive rate of 0.4%, and a false-negative rate of 17% on real overeager actions (company-reported).
Read those numbers as a PM. If an agent attempts 50 overeager actions a week across a team, a 17% miss rate lets about 8 through. Neither a tired human nor a classifier is a guarantee, so the sandbox has to make the misses survivable: no production credentials inside it, writes limited to a working copy, network access allowlisted. Anthropic's managed-agent design states the rule directly: credentials are "never reachable from the sandbox where Claude's generated code runs". Pair this with the tool execution envelope, which covers idempotency and limits per tool.
Context that survives a long run
A single context window cannot hold a day of work. Harnesses compact: the Agent SDK summarises older history automatically as the window nears its limit, keeping recent exchanges and key decisions. For work that spans many sessions, Anthropic found that "compaction isn't sufficient". Its long-running harness adds an initialiser that writes a setup script, a progress log and a first git commit, and a working agent that makes incremental progress and leaves clear artifacts for the next session. The failure it prevents is specific: a fresh session sees partial progress and declares the job done.
The product lesson: decide what the agent must write down, in a file a person can read, so that a restart, a handoff or an audit does not depend on the model's memory. See context engineering for the per-call budget and agent memory for what persists across tasks.
Verification is the expensive part
A model asked to grade its own work tends to approve it. Anthropic reported that tuning "a standalone evaluator to be skeptical" was far easier than making the generator critical of itself, and published a cost comparison for one application build: about 20 minutes and $9 for a single agent, about 6 hours and $200 for the full planner, generator and evaluator harness (company-reported, one task). Anthropic describes the full architecture as producing rich full-stack applications over multi-hour sessions. The PM decision is which tasks justify that kind of spend, and the answer comes from the cost of a wrong result, not from enthusiasm for agents. In June 2026 Anthropic also added workflows in which the model writes its own harness for a task, noting that they use more tokens and suit complex, high-value work.
What the PM owns
- The definition of done. A test suite, a rubric or a reviewer, written before the agent runs. Without it, the verifier step has nothing to check.
- The permission policy. Which actions run unasked, which wait, which are refused, by reversibility and blast radius.
- Budgets. Tokens, wall-clock time and tool calls per run, with a defined stop, as in budgets and loop control.
- The record. What the session log keeps, for how long, and who can read it.
- Harness experiments. Hold the model fixed and change one harness component at a time, measured on the same task set used for model comparisons. A harness change can move success more than a model upgrade, and it is far cheaper to test.
In the interview
Agent design rounds now probe the harness directly: "our agent fails on long tasks", "it deleted a file it shouldn't have", "the same model does better in a competitor's product". A weak answer reaches for a bigger model. A Hire answer adds tools or a human approval. A Strong Hire answer names the harness component at fault, separates sandbox from approval, prices verification against the cost of an error, makes the agent write its progress down, and proposes an experiment that changes one component while holding the model fixed.
Next: context engineering and budgets and loop control. The Premium guide Harness Engineering for PMs goes chapter by chapter.