Skip to main content
reopt Handbook
reopt Handbook
Harness Engineering

Problem and Structure

Foundations of Harness EngineeringRepo-Readable SystemsThe Five Elements of a HarnessEngineering Mechanics

Evaluation and Interpretation

Evaluation Loop DesignExternal Case Comparison

Case Studies

Case: OpenAICase: AnthropicCase: TossCase: gstackCase: revfactory/harness

Domain Playbooks

Domain PlaybooksScenario: Frontend TeamScenario: Platform TeamScenario: Payments and Settlement TeamScenario: AI Product TeamWhy You Eventually Need Your Own Harness

Rollout and Operations

Team Harness Rollout StrategyTeam Harness Design ChecklistOperations: Entropy and Garbage Collection

Appendix

Verification ReportUpdates
Handbook›Harness Engineering›Engineering Mechanics
한국어English

Engineering Mechanics

Explain why harnesses are engineering systems across input, state, tools, evaluation, approval, sandboxing, classifiers, and cleanup.

Key takeaways

  • A harness is engineering because it handles eight concerns: input, externalized state, tool permissions, evaluation, human handoff, cleanup, harness/compute separation, and auto-approval policy.
  • It changes failure modes, reducing outcome variance, bounding blast radius, and making work reproducible from files and loops rather than personal taste.
  • A task contract compresses the starting input shared by planner, builder, and evaluator, and external state files enable handoff and post-failure reconstruction.
  • Approval is a control system: an allowlist, project-local edits, classifier gates, trust boundaries, deny-and-continue, and hard human gates.
  • Managed Agents separates session (append-only log), harness, and sandbox, with credentials behind a vault or MCP proxy, not inside generated code.

Harness engineering can sound abstract because "create a better environment" hides the actual system design work.

As engineering, a harness handles eight things.

  1. What input starts the task.
  2. How work state is externalized.
  3. Which tools are opened under which permission boundary.
  4. Where quality is judged.
  5. When the system hands work to a human.
  6. How decayed rules get removed.
  7. How the harness is separated from execution compute.
  8. How auto-approval and auto-denial are delegated to policy or classifiers.

Why It Counts as Engineering

A harness changes the system's failure modes.

What it changesWhy this is engineering
VarianceSame model, less outcome spread
Blast radiusBad execution is bounded
ObservabilityFailures are traceable through browser, logs, and tests
ReproducibilityWork depends on files, commands, docs, and loops, not personal taste
Operating costFewer repeated failures, missed reviews, and stale docs

Core View

A harness does not ask the model to be smarter. It designs the system so model mistakes are less damaging.

1. Design the Input Layer

Good harnesses start differently. OpenAI emphasizes AGENTS.md and structured docs/; Anthropic uses a sprint contract. Both compress the starting input.

task_contract:
  goal: "What must be finished"
  non_goals:
    - "What this turn must not do"
  constraints:
    - "Rules that must not be broken"
  files_to_read:
    - "AGENTS.md"
    - "docs/architecture.md"
  validation:
    - "lint"
    - "browser QA"
  escalation:
    - "Ask for human approval if schema changes appear"

This is contract data shared by planner, builder, and evaluator.

2. Externalize State

Long agent work needs external state more than memory.

task-contract.yaml
plan.md
review-notes.md
qa-report.md
release-checklist.md
architecture.md
runbooks.md
invariants.md

External state allows handoff, evaluation against artifacts, and post-failure reconstruction.

3. Tool Access Changes Quality

OpenAI treats browser, logs, and metrics as part of the harness because text-only agents can inspect intent but not runtime behavior.

ToolWithout itWith it
BrowserUI breakage is missedInteraction and state transitions are verified
LogsRoot cause is guessedFailure is reconstructed by time and event
TestsSmall edits cause regressionsRepeated failures are caught
MetricsProduction quality decay is lateResults connect to operating data

4. Separate Evaluation Loops

Anthropic's main lesson is not "use many roles." It is separate bias.

Evaluation becomes engineering when:

  • builder and evaluator have different inputs;
  • the evaluator asks what was proven, not what was built;
  • QA checks actual execution instead of code explanation.

5. Design Approval Boundaries

A harness is also a control system.

approval_policy:
  auto:
    - "docs edits"
    - "local refactors"
  review_required:
    - "user-facing UI changes"
    - "test changes"
  human_gate:
    - "production deploy"
    - "database migration"
    - "permission, billing, or policy changes"

This defines the blast radius the system can tolerate.

6. Treat Auto Approval as Policy

More permission prompts do not automatically make a system safer. Anthropic's auto mode work shows that approval fatigue turns safety into a classifier and policy design problem.

LayerDesign question
Safe allowlistWhich actions are almost always safe, such as read-only exploration?
Project-local editsWhich repo-local edits are safe because they are version controlled?
Classifier gateWhich shell, web, external-tool, subagent, or out-of-repo actions require classification?
Trust boundaryWhich GitHub orgs, buckets, APIs, or domains count as internal infrastructure?
Deny and continueAfter denial, should the agent stop, find a safer route, or escalate?
Hard human gateWhich production, destructive, or security changes must never be auto-classified?

The classifier reduces approval fatigue. It does not remove human review for high-risk work.

7. Separate Harness and Execution Compute

OpenAI Agents SDK and Anthropic Managed Agents both point toward a control-plane/data-plane split. The harness controls the loop; sandbox compute executes generated code and tool calls.

Execution pieceHarness question
ShellWhich commands are allowed and when is approval required?
Filesystem / apply_patchWhich paths can be edited and how is patch scope constrained?
SkillsWhich knowledge bundles are loaded only when needed?
Memory / CompactionWhere does long-task state live and when is it compressed?
Manifest / mounted dataHow are input data, output paths, and dependencies made predictable?
MCP / tunnelWhich internal tools are opened through which network boundary?

Anthropic Managed Agents describes the same issue as separating session, harness, and sandbox. The session is an append-only event log, not the model context window. The harness can wake up from the session log, and external hands are exposed as execute(name, input) -> string. Credentials should live behind a vault or MCP proxy, not inside generated sandbox code.

8. Build in Garbage Collection

Harnesses decay over time.

DriftSymptom
Doc driftAGENTS no longer matches the codebase
Loop bloatUnused reviewer steps remain
Approval bypassHuman gates are ignored under pressure
Tool agingBrowser or log scripts break silently

A harness without cleanup becomes ritual.

Minimum Harness Architecture

LayerArtifactAutomationFailure prevented
InputAGENTS.md, invariantsfile search, task contractWrong start, missing rules
Executionplan, diff, commandeditor, shell, workflowScope drift, unsupported implementation
Verificationtest, browser QA, logsrunners, browser, observability"Looks correct" failures
RecordQA report, updatestemplate, PR checkrepeated failure, weak handoff

Related docs

Foundations of Harness Engineering

Define harness engineering, its scope, and why system design matters more than prompt wording for long-running agents.

Case: Anthropic

Analyze Anthropic's long-running harness through planner/evaluator, Managed Agents, and auto approval patterns.

Security Governance

Vercel Enterprise AI Platform · Govern identity, secrets, provider policy, data handling, WAF, BotID, and approvals.

Ch2. Source Code Atlas

Enterprise Eve Agent Development · Read packages/eve/src by implementation responsibility and identify the files enterprise reviewers should understand.

The Five Elements of a Harness

Explain the five design axes behind most practical harnesses: environment, roles, criteria, loops, and maintenance.

Evaluation Loop Design

Use Anthropic and gstack patterns to decide when planner, builder, evaluator, and QA should be separated.

On this page

Why It Counts as Engineering1. Design the Input Layer2. Externalize State3. Tool Access Changes Quality4. Separate Evaluation Loops5. Design Approval Boundaries6. Treat Auto Approval as Policy7. Separate Harness and Execution Compute8. Build in Garbage CollectionMinimum Harness Architecture