# Harness engineering

Engineering the agent loop, task decomposition, tools, permissions, session state, checks, retries, feedback, checkpoints, and stop conditions that surround a model.

core-concept · Harness & runtime · maturing · Reviewed 2026-08-09

## Definition

Engineering the agent loop, task decomposition, tools, permissions, session state, checks, retries, feedback, checkpoints, and stop conditions that surround a model. The model supplies capability; the harness turns capability into repeatable, inspectable work.

A fast-forming production discipline whose terminology is still new.

## Why it matters

The model supplies capability; the harness turns capability into repeatable, inspectable work.

The operating shift is from “Tune the prompt” to “Engineer the working environment.”

## System anatomy

- **Practice 1:** Expose tests, logs, and interfaces directly to agents
- **Practice 2:** Encode recovery and back-pressure
- **Practice 3:** Make the repository legible to future agent runs



## Important distinctions

- **Tune the prompt:** This concept moves the engineering system toward engineer the working environment.



## Implementation signals

- Expose tests, logs, and interfaces directly to agents
- Encode recovery and back-pressure
- Make the repository legible to future agent runs

## Failure modes

- Retry loops without new evidence
- A powerful model operating in an underspecified environment



## Related knowledge

- [Context engineering](https://aisdlc.ai/agentic-engineering/context-engineering) — The deliberate selection and maintenance of instructions, knowledge, tools, state, examples, and artifacts within a finite model attention budget.
- [Agent execution substrate](https://aisdlc.ai/agentic-engineering/execution-substrate) — The isolated, stateful environment in which agents observe and act, including compute, filesystem, browser, network, credentials, resource limits, and session lifecycle.
- [Independent verifier systems](https://aisdlc.ai/agentic-engineering/multi-agent-verification) — A separation-of-judgment architecture in which builder agents, evaluator agents, deterministic checks, domain experts, and authorization authorities challenge different failure surfaces.

## Sources and further study

- [OpenAI — Harness engineering: leveraging Codex in an agent-first world](https://openai.com/index/harness-engineering/) — A production case study in designing repositories, tools, feedback loops, and environments for agent-first delivery. **Use:** First-party case study. **Limitation:** This first-party account documents one organization, product, or implementation context and should not be generalized without local evidence.
- [Anthropic — Effective harnesses for long-running agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents) — Patterns for incremental progress and durable handoffs across context windows and extended execution. **Use:** First-party case study. **Limitation:** This first-party account documents one organization, product, or implementation context and should not be generalized without local evidence.
- [Anthropic — Harness design for long-running application development](https://www.anthropic.com/engineering/harness-design-long-running-apps) — A planner, generator, and evaluator architecture for multi-hour autonomous application development. **Use:** First-party case study. **Limitation:** This first-party account documents one organization, product, or implementation context and should not be generalized without local evidence.

---

This library synthesizes cited research, standards, official documentation, and clearly attributed practitioner perspectives. Maturity describes the state of a concept—not vendor endorsement, production readiness, or permission to deploy. Benchmarks and demonstrations do not replace use-case evaluation, governed controls, independent verification, or named human release authority.
