---
schema: "swft.publication/v1"
id: "harness-engineering-explainer"
title: "What is harness engineering?"
description: "Harness engineering is the design of everything around a coding model: instructions, tools, context, permissions, execution, and feedback. It is a named product and cost decision, not an inherited default."
summary: "Harness engineering designs everything around the model: instructions, tools, context, permissions, environment, and feedback. The same model behaves differently under different harnesses, so the harness is a product and cost decision with an owner — not an inherited default."
canonical: "https://swft.io/what-is-harness-engineering"
author: "SWFT Editorial"
author_type: "Organization"
published: "2026-09-23"
modified: "2026-09-23"
kind: "explainer"
section: "Guides"
tags: ["harness engineering", "agent harness", "coding agent harness", "context engineering", "software factory"]
evidence_labels: ["INFERENCE", "OBS", "SELF-REPORT", "STUDY"]
source_ids: ["ai-engineer-harness-engineering", "ai-engineer-harness-failure", "anthropic-effective-agents", "harnesstax-pan-2026", "openai-harness-engineering", "pi-coding-agent", "smol-news-harness-scan", "swe-bench-lite", "terminal-bench-2"]
authorship_disclosure: "AI-drafted from the cited public sources and independently checked by a second AI editorial-review agent (Codex) for source fit, claim boundaries, overlap, and reader utility. SWFT Editorial is responsible for corrections."
---

# What is harness engineering?

The discipline of designing the instructions, tools, context, permissions, and feedback around the model — and why it is a cost and control decision.

> **Authorship:** AI-drafted from the cited public sources and independently checked by a second AI editorial-review agent (Codex) for source fit, claim boundaries, overlap, and reader utility. SWFT Editorial is responsible for corrections.

## Quick answer

Harness engineering designs everything around the model: instructions, tools, context, permissions, environment, and feedback. The same model behaves differently under different harnesses, so the harness is a product and cost decision with an owner — not an inherited default.

**Harness engineering** is the discipline of designing everything that surrounds the model: the instructions, tools, context, permissions, execution environment, and feedback loops that determine what a coding agent can see, do, check, and recover from.

[OpenAI named the practice in February 2026](https://openai.com/index/harness-engineering/), describing how it prepared specifications, tools, feedback, and repository structure around Codex rather than tuning the model itself. Ryan Lopopolo's [AI Engineer talk](https://www.youtube.com/watch?v=am_oeAoUhew) gives the operator's account of the same preparation. The field had been converging on the idea — Anthropic's [guidance on effective agents](https://www.anthropic.com/engineering/building-effective-agents) treats the agent as model-plus-scaffolding, and [HarnessTax](https://harnesstax.github.io/) then measured the harness as a variable in its own right.

## Why the harness is a product decision

The same model produces different outcomes under different harnesses. [HarnessTax compared 21 model–harness pairs](https://harnesstax.github.io/) on SWE-bench Lite and Terminal-Bench 2.0 and reported roughly a five-fold spread in token cost for comparable task success — a bounded result (two benchmarks, one-attempt scoring), but enough to show the wrapper is not a neutral detail. The harness moves cost, failure shape, and what a reviewer must still check.

That makes the harness a choice with an owner, not an inherited default. A team can accept its provider's wrapper, adopt a minimal open harness such as [Pi](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/README.md) — four tools: read, write, edit, bash — or engineer its own for a specific work class. The right answer depends on the work, the risk, and the evidence the team can produce.

## What the harness includes

- **Instructions and skills** — the standing guidance and versioned recipes the agent loads.
- **Tools** — what the agent can actually do: read, write, run tests, open tickets, query internal systems.
- **Context engineering** — which code, decisions, and rules the agent sees, and what stays out.
- **Permissions and environment** — the sandbox, credentials, spend limits, and stop conditions.
- **Feedback and evals** — the checks that let the agent prove its own work before a person is asked.

## What harness engineering is not

It is not prompt engineering alone — a prompt is one instruction inside a much larger system. It is not model selection — the model is a component the harness routes around. And it is not sufficient by itself: the AI Engineer counterpoint [Harness Engineering Is Not Enough](https://ai.engineer/talks/Ib5GBkD555M-harness-engineering-is-not-enough-why-software) argues that faster generation still needs architecture, review, maintainability, and human judgment around it. A [Smol News scan](https://news.smol.ai/issues/26-08-17-not-much) of harness-level evaluation and secure execution shows the same boundary from the tooling side.

## Where it fits in a software factory

In SWFT's working architecture the harness is one layer of the factory: it determines how well a worker executes a task brief, while intake, proof, release, and the learning loop decide which work deserves a run at all. For the cost angle, read [HarnessTax as a factory cost lever](/ideas/harnesstax-coding-agent-cost); for the surrounding system, read [How an AI software factory works](/software-factory-architecture).

## Questions product teams ask

### Is harness engineering just prompt engineering?

No. A prompt is one instruction inside the harness. Harness engineering covers the whole environment: tools, context, permissions, execution, and the feedback that lets the agent check its own work.

### Does the harness matter as much as the model?

HarnessTax's bounded comparison reports roughly a five-fold token-cost spread across model–harness pairs for comparable success, so the harness is at least a cost decision. Whether it outweighs model choice depends on the task class and the evidence a team can produce.

### Who should own the harness?

A named owner — usually the team operating the agents. Treating the provider's default wrapper as unexamined infrastructure hides a decision that moves cost, failure shape, and review load.

## How we know

- **First-party report (SELF-REPORT)** OpenAI named and described harness engineering as preparing specifications, tools, feedback, and repository structure around Codex; Anthropic's guidance treats the agent as model plus scaffolding. Sources: [Harness engineering: leveraging Codex in an agent-first world](https://openai.com/index/harness-engineering/); [Harness Engineering](https://www.youtube.com/watch?v=am_oeAoUhew); [Building effective agents](https://www.anthropic.com/engineering/building-effective-agents).
- **Independent study (STUDY)** HarnessTax's 21-pair comparison reports roughly a five-fold token-cost spread for comparable task success on two benchmarks, bounding the claim to those suites and one-attempt scoring. Sources: [HarnessTax: How Much Does the Harness Matter for Coding Agents?](https://harnesstax.github.io/); [SWE-bench Lite](https://www.swebench.com/lite); [Terminal-Bench: Benchmarking Agents on Hard, Realistic Tasks in Command Line Interfaces](https://arxiv.org/abs/2601.11868).
- **Observed artifact (OBS)** A minimal open harness (Pi's four-tool agent) and harness-level evaluation coverage mark the practice's inspectable edges. Sources: [Pi coding agent](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/README.md); [AINews: harness-level evaluation and secure execution](https://news.smol.ai/issues/26-08-17-not-much).
- **First-party report (SELF-REPORT)** Practitioners argue the harness alone is insufficient: architecture, review, maintainability, and judgment still decide outcomes. Sources: [Harness Engineering Is Not Enough: Why Software Factories Fail](https://ai.engineer/talks/Ib5GBkD555M-harness-engineering-is-not-enough-why-software).
- **Analysis (INFERENCE)** SWFT treats the harness as one factory layer: it governs how a worker executes a task brief, while intake, proof, release, and learning own the wider system. Sources: [Harness engineering: leveraging Codex in an agent-first world](https://openai.com/index/harness-engineering/); [HarnessTax: How Much Does the Harness Matter for Coding Agents?](https://harnesstax.github.io/).

## Sources

- **First-party report (SELF-REPORT)** [Harness Engineering](https://www.youtube.com/watch?v=am_oeAoUhew) — AI Engineer; published 2026-04-16; accessed 2026-09-01. Ryan Lopopolo's first-party account of how OpenAI prepared specifications, tools, feedback, and repository structure around coding agents in a bounded internal experiment.
- **First-party report (SELF-REPORT)** [Harness Engineering Is Not Enough: Why Software Factories Fail](https://ai.engineer/talks/Ib5GBkD555M-harness-engineering-is-not-enough-why-software) — AI Engineer; published 2026-07-23; accessed 2026-09-01. A practitioner counterpoint arguing that faster generation still needs architecture, review, maintainability, and human judgment.
- **First-party report (SELF-REPORT)** [Building effective agents](https://www.anthropic.com/engineering/building-effective-agents) — Anthropic; published 2024-12-19; accessed 2026-08-31. Practitioner guidance distinguishing fixed workflows from agents and describing common orchestration patterns; Anthropic now warns that the 2024 tooling landscape described there has changed.
- **Independent study (STUDY)** [HarnessTax: How Much Does the Harness Matter for Coding Agents?](https://harnesstax.github.io/) — HarnessTax; published 2026-09-16; accessed 2026-09-17. Pan, Yang, Arabzadeh, Chiang, Stoica, and Zaharia compare 21 model–harness pairs on SWE-bench Lite and Terminal-Bench 2.0. The project page was generated 16 September 2026 UTC; SWFT accessed the rendered post on 17 September 2026.
- **First-party report (SELF-REPORT)** [Harness engineering: leveraging Codex in an agent-first world](https://openai.com/index/harness-engineering/) — OpenAI; published 2026-02-11; accessed 2026-09-01. OpenAI's bounded internal experiment with an agent-written repository, enforceable architecture, repository-legible context, proof loops, observability, and recurring cleanup.
- **Observed artifact (OBS)** [Pi coding agent](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/README.md) — earendil-works; accessed 2026-09-17. The inspectable README HarnessTax cites for Pi's four-tool interface: read, write, edit, and bash.
- **Observed artifact (OBS)** [AINews: harness-level evaluation and secure execution](https://news.smol.ai/issues/26-08-17-not-much) — Smol News / Latent Space; published 2026-08-17; accessed 2026-09-01. A secondary trend scan used for vocabulary discovery. SWFT follows its links to primary sources before making product claims.
- **Observed artifact (OBS)** [SWE-bench Lite](https://www.swebench.com/lite) — SWE-bench; accessed 2026-09-17. Official description of the SWE-bench Lite split used as one of HarnessTax's two evaluation suites.
- **Independent study (STUDY)** [Terminal-Bench: Benchmarking Agents on Hard, Realistic Tasks in Command Line Interfaces](https://arxiv.org/abs/2601.11868) — arXiv; published 2026-01-17; accessed 2026-09-17. Merrill et al., arXiv:2601.11868, the Terminal-Bench paper HarnessTax cites for Terminal-Bench 2.0.

## Read next

- [The coding-agent harness is a cost lever](/ideas/harnesstax-coding-agent-cost)
- [How an AI software factory works](/software-factory-architecture)
- [Software factory glossary](/glossary)
