---
id: "concept-agent-harness"
type: "concept"
source_timestamps: ["§ Can Someone Please Define a \"Harness\"?"]
tags: ["architecture", "definitions"]
related: ["claim-agent-equation", "concept-filesystem-primitive", "concept-context-rot", "quote-harness-definition", "framework-harness-derivation"]
definition: "Every piece of code, configuration, and execution logic surrounding a raw model that gives it state, tool execution, feedback loops, and enforceable constraints."
---
# Agent Harness

## Definition

A **harness** encompasses every piece of code, configuration, and execution logic in an agentic system that is *not* the raw model itself. The thesis is captured by [[quote-harness-definition]]: *“If you're not the model, you're the harness.”*

Because models natively only take in data (text, images, audio) and output text, they require a harness to perform actual work. Concretely, a harness includes:

- **System prompts** — priors and behavioral guidance.
- **Tools / Skills / MCPs** — the actions the agent can take. See [[prereq-mcp]] and [[concept-progressive-disclosure]] for how these are managed.
- **Bundled infrastructure** — filesystems ([[concept-filesystem-primitive]]), sandboxes, browsers, bash environments ([[concept-bash-general-tool]]).
- **Orchestration logic** — subagent spawning, routing, [[concept-ralph-loop|Ralph loops]], retries.
- **Deterministic hooks / middleware** — [[concept-compaction|compaction]], lint checks, [[concept-tool-call-offloading|tool-call offloading]], policy filters.

## Why Harnesses Matter

The harness is what converts *desired agent behaviors* into actual *features*, injecting useful priors to **guide, extend, and correct** model behavior. This is formalized in [[framework-harness-derivation]]: identify a desired behavior, recognize a model limitation, design a harness feature to bridge the gap.

The harness is also the system that battles [[concept-context-rot|context rot]], maintains durable state across sessions, and enables long-horizon execution per [[claim-long-horizon-compounds]].

## Relation to the Core Equation

The harness is the second term in the equation defended by [[claim-agent-equation]]: **Agent = Model + Harness**. Without a harness, a model is a text completion engine; with one, it is an autonomous worker.

## Cross-References

- The harness as a *delivery mechanism* for context engineering: [[quote-context-engineering]].
- Harness/model co-evolution: [[concept-harness-model-coevolution]].
- Will harnesses persist as models improve? See [[contrarian-harness-longevity]].
- Concrete primitives derived from this concept: [[concept-filesystem-primitive]], [[concept-bash-general-tool]], [[concept-ralph-loop]].
