Skip to content

AI & automation · Guide

What is harness engineering, and when does it matter to a business?

Harness engineering is the work of designing everything around an AI model so that an agent is reliable: instructions, tools, permissions, checks and the execution loop. The name caught on in 2026 among teams using AI coding agents; the core idea is to turn every recurring mistake into a permanent rule or check.

Master TimmUpdated on 6 min read

Where the term came from, and how settled it is

The name spread in early 2026. In February, Mitchell Hashimoto, a co-founder of HashiCorp, described the practice of engineering a fix every time an agent makes a mistake so that the mistake never comes back, and wrote that he did not know of an industry-accepted term yet but had come to call it harness engineering.

Around the same time, an OpenAI team published a report under the same name on building a product with Codex, and Birgitta Böckeler, of Thoughtworks, organized the idea in an article on Martin Fowler's site. There, the harness is everything in an agent except the model: agent = model + harness.

It is practitioner jargon, not a standard: there is no specification or official definition, and Böckeler herself notes that the term means different things in different contexts. The idea behind it, however, is stable and can be checked in the repository.

What a harness is made of

Tools such as Claude Code and Codex ship with a built-in harness: the loop, file and terminal tools, permissions and context management. The Claude Code documentation calls this layer around the model the agentic harness. Harness engineering, as the term is used in 2026, is mostly what the team builds on top of it, in its own repository.

Guides, sensors and limits: the parts of the harness a team builds
ControlWhen it actsExamples
GuidesSteer the agent before it actsBefore the actionAGENTS.md and CLAUDE.md, skills, ADRs, scripts and project templates
SensorsCheck the result and let the agent self-correctAfter the actionTests, linters, type checks, review by another agent
LimitsSet how far the agent can goThroughout the runPer-tool permissions, hooks that block commands, human approval, step and cost caps

Guides and sensors come from Böckeler's article, which also separates deterministic controls, such as tests and linters, from inferential ones, such as AI review, which are slower, more expensive and less predictable.

Harness, context engineering and the agent loop: the difference

The three terms overlap, and each author draws the line in a different place. A practical way to tell them apart is by the question each one answers.

Context engineering, harness engineering and the agent loop: the question each one answers
TermQuestion it answersExamples
Context engineeringWhat enters the context window at each stepWhat does the agent know right now?Context selection, compaction, memory, token budget
Harness engineeringThe whole environment around the modelWhat can the agent do, and how is a mistake stopped?Rules, tools, permissions, hooks, tests
Agent loopThe cycle of gathering context, acting and verifyingWhen does the agent keep going, and when does it stop?Turn limits, cost budget, stop condition

In Böckeler's reading, building a harness for a coding agent is a specific form of context engineering: guides and sensors only work if they reach the agent's context at the right time. Designing the loops got a name of its own in mid-2026, loop engineering, and has a guide of its own.

When harness engineering matters to a business

The harness starts to matter when the agent stops being one person's experiment and becomes part of the team's work. The usual signs:

  • The same mistake returns: The agent repeats the wrong command or the old API because the fix stayed in the chat, not in the repository.
  • Repetitive reviews: Whoever reviews the agent's pull requests keeps pointing out the same problems.
  • The agent acts on systems: It opens tickets, changes data or deploys, and someone needs to know what it may and may not do.
  • Security questions: Someone has to answer what the agent can read, run and send outside.
  • Changing models or tools: The team wants to switch agents without losing the rules, which therefore have to live in versioned files.

For occasional use, such as asking for a function or an explanation of some code, the tool's built-in harness is enough. On the program we work on for The Hackett Group, the operating model uses 12 agents, 25 skills and quality-gate hooks.

Risks and limits of a harness

A harness is also software, and it ages like software. The problems show up when it grows without an owner.

  • Contradicting rules: Guides and sensors added at different times start pointing in opposite directions, and the agent picks one.
  • False confidence: A sensor that never fires may mean good code or a weak check; without measuring, there is no way to tell.
  • Cost and time: AI-based checks are slower and more expensive than tests; they complement tests and do not replace them.
  • Too much permission: Hooks and skills can grant tools without approval, and a harness with broad access turns an agent's mistake into an incident.
  • Vendor lock-in: Rules kept in a single tool's format make switching hard; Markdown, scripts and AGENTS.md in the repository travel better.

Böckeler sums up the goal this way: a good harness does not aim to eliminate human input but to direct it to where it matters most.

Related service

AI Software Automation

Coding agents on your team, with specs and quality gates.

Free first conversation · Reply within 1 business day

See also: AI & LLM Engineering and Technical Mentoring & AI Training.

Frequently asked questions

What is the difference between a harness and an agent framework?

In LangChain's classification, a framework provides abstractions to get started (LangChain), a runtime runs agents in production (LangGraph) and a harness is a batteries-included package with built-in tools for long-running agents (Deep Agents, Claude Agent SDK). A team's harness engineering is the layer it builds on top of any of them: the rules, checks and limits of its own repository.

Can you buy a ready-made harness?

Partly: Claude Code, Codex and SDKs such as the Claude Agent SDK already ship the loop, tools and permissions. What no product ships is your team's part: the repository rules, the tests, the scripts and each tool's limits, which have to be written and maintained like code.

Who maintains the harness once it is in place?

The engineering team itself, the same way it maintains CI. The harness lives in the repository, changes through pull requests and grows with every recurring mistake: when a problem shows up a second time, the fix becomes a rule, a script or a check, not just a prompt tweak.

How do you know a harness is working?

By the mistakes that stop coming back and the rework that goes down. Track how many of the agent's pull requests are approved without change requests, which failures the gates catch before human review, how many mistakes repeat and the cost of each task in the traces.

Sources

Master Timm · Updated on

Tell us what you're building

Tell us the context: the problem, the timeline and what already exists. You talk directly to the engineer who will do the work.

Request a first call

Free first conversation · Reply within 1 business day