What is harness engineering?
Harness engineering is the practice of designing the environment, tools, constraints and feedback loops that let AI agents complete work reliably, so engineers specify intent and check results instead of writing every step by hand.
A capable model on its own does not ship software or close tickets. What decides whether an agent finishes a long task is the setup around it: what it can see, which tools it can call, how it knows it is done, and what catches it when it is wrong. Harness engineering is the work of building that setup on purpose.
The shift is in where engineering effort goes. Less of it goes into writing each function, and more into making the codebase legible to an agent, defining done before work starts, and wiring tests and reviews that the agent cannot talk its way past.
What a harness engineer works on
A legible environment
A short root instruction file such as AGENTS.md or CLAUDE.md that points to deeper docs, so the agent finds conventions instead of guessing them.
A definition of done
A feature list or checklist agreed before work starts, with every item marked failing until a check proves otherwise, so the agent cannot declare victory early.
Feedback loops
Tests, linters, type checks and end-to-end browser tests the agent runs on its own work, with terse output that does not flood its context.
Durable progress
Plan, progress and status files plus regular commits, so a fresh session can pick up where the last one stopped.
A separate checker
A reviewer or evaluator agent, or a person, that grades the output, because a generator tends to rate its own work too highly.
Boundaries
Sandboxes with file system and network limits, so the agent can act freely inside them without a permission prompt for every step.
What the labs say
Anthropic's "Effective harnesses for long-running agents" (November 2025) splits a long build between an initializer agent that sets up the environment once and a coding agent that makes incremental progress each session, recovering state from a progress file and git history.
Anthropic's follow-up on harness design for long-running apps (March 2026) adds that every harness component encodes an assumption about what the model cannot yet do, so each one should be stress-tested and removed as models improve. OpenAI's guide to long-horizon Codex tasks describes the same pattern from the other side: a spec, a plan with milestones and validation commands, and a rule to fix failing checks before moving on.
How Motiontic's engineers apply it
On a client codebase, Motiontic's engineers start by making the repo readable to an agent: a root instruction file, a docs map, and the commands that prove a change works. Then they define done in a form a machine can check, and add the tests and structural checks that enforce the architecture.
The harness is treated as code the client owns. It is versioned, reviewed and trimmed as models get stronger, so the team is not left maintaining scaffolding that no longer earns its place.
Prompt engineering compared with harness engineering
| Prompt engineering | Harness engineering | |
|---|---|---|
| Unit of work | One prompt and its response | A task that spans many model calls and sessions |
| What gets changed | Wording, examples and instructions | Tools, docs, tests, sandboxes, state files and review steps |
| How errors are caught | A person reads the output | Tests, linters and a separate evaluator run on every change |
| When the model improves | Prompts may need rewording | Scaffolding is removed where the model no longer needs it |
Common questions
What is harness engineering in AI?
Harness engineering is designing the environment, tools, constraints and feedback loops around an AI agent so it can complete long tasks reliably, with engineers specifying intent and verifying results rather than writing each step.
How is harness engineering different from prompt engineering?
Prompt engineering tunes the text of a single request. Harness engineering builds the system around many requests: the tools an agent can call, the files that hold its progress, the tests that check its work and the boundaries it runs inside.
Does harness engineering replace writing code?
It changes the mix. Engineers still write code, but more of it is tests, checks, tooling and documentation that let agents produce and verify the rest, and more time goes into reviewing agent output.
Who does harness engineering?
Usually AI engineers and senior software engineers who know the codebase well enough to define what correct looks like, and who can turn that into checks an agent cannot skip.
Related
Agent harness
The loop, tools, context, permissions and state that sit around the model.
AGENTS.md
A README for coding agents: the file an agent reads first in a repo.
Context engineering
Curating everything in the model's view, not just the wording of the prompt.
Claude Code vs Cursor
Anthropic's coding agent and the SpaceX-owned AI editor compared on plans, models and agent tooling.
AI Engineer
Builds the model-facing parts of a product: prompts, retrieval, tools, evals and the code around them.
Running agents that have to hold up?
Describe the agent, the systems it touches and what it must never get wrong. The first call is with a lab engineer, who will say plainly whether it is ready for production, and whether Motiontic is the right team.