Two terms are constantly being conflated in the AI coding space: spec-driven development and harness engineering. They are not synonyms, and treating them as such is costing teams time. A spec defines what a single change must achieve before an agent starts writing code. A harness defines everything surrounding that agent except the model itself—what it reads, what it can modify, and which checks run on its output. If you are deploying agents to write real code, you need both, and each fails predictably without the other.
Defining the Harness
The concept of a harness was formally defined by Birgitta Böckeler on martinfowler.com as "everything in an AI agent except the model itself." This definition gained significant traction in February 2026, following OpenAI engineer Ryan Lopopolo’s description of a five-month internal experiment. In that experiment, a small team shipped a product with roughly 1,500 merged pull requests and zero manually written lines of code. The engineers' primary role shifted to designing environments and feedback loops that allowed Codex agents to perform reliable work. Two core principles emerged from that work: the repository must be the system of record, and invariants must be enforced mechanically.
Specs vs. Harnesses
Specs answer the question "What must this change do?" and are scoped to a single feature or task. Their main artifacts are spec.md, tasks.md, and acceptance criteria. Harnesses, conversely, answer "How do we make any change trustworthy?" and apply to the entire repository for its entire lifecycle. The harness artifacts include AGENTS.md, custom linters, structural tests, and CI configurations. A spec changes with every new feature; a harness changes only when the same failure happens twice. If you lack a spec, your team argues about intended behavior during code review. If you lack a harness, everyone agrees on the behavior but cannot prove it cheaply.
Enforcing Boundaries Mechanically
To make specs enforceable, every section must produce a check. For example, the "Allowed files" list in a spec should cause CI to fail if the diff touches anything else. Acceptance criteria like AC-1 or AC-2 should have corresponding tests that explicitly name them. The source article provides a bash script, spec-gate.sh, that validates these constraints. It checks if the git diff leaves the allowed files list and verifies that every acceptance criterion is mentioned in the tests. Without this mechanical enforcement, agents drift. They might refactor files outside the scope or skip a criterion entirely, errors that are expensive to catch in human review.
The Cost of Missing Either Component
A spec without a harness is merely a document nobody enforces. Agents will mostly follow it but will drift at the edges, adding extra fields or refactoring unrelated code. A harness without a spec is a fast, green pipeline pointed at the wrong target. The tests might pass, but the feature might do something nobody asked for. Anthropic’s March 2026 post on harness design highlighted a related trap: agents tend to confidently praise their own work when asked to evaluate it. The solution is a separate evaluator grading against pre-agreed criteria, which is essentially a spec by another name.
Key Takeaways
- The repository is the only source of truth; Slack decisions are invisible to the agent unless committed.
- Use mechanical sensors like custom linters and structural tests to enforce invariants, not just human review.
- A spec gate script can automatically fail CI if an agent touches files outside the
Allowed fileslist. - Agents often hallucinate success; separate evaluators based on specs are required to verify actual compliance.
The Bottom Line
Stop treating specs and harnesses as the same thing. One sets the target, the other builds the fence. If you don't have both, you're just shipping bugs with a green checkmark.