You don't design an AI harness all at once, you grow it from observed failures. Anthropic recommends starting simple and adding complexity only when the simple approach falls short. Mitchell Hashimoto supplies the engine: every time the agent errs, you engineer a permanent fix. Then you systematize into guides and sensors.
Start simple, add complexity only when you need it
The first step isn't wiring up a multi-step agent. It's the smallest prompt that solves the problem. Anthropic, in "Building Effective Agents" (December 2024), is direct: start with simple prompts and add multi-step agentic systems only when simpler solutions fall short. The reason is practical. You don't know where the agent will fail until you run it, and every piece of complexity you add before seeing a real failure is a bet. Build the minimum, run it, and let the failures tell you what to engineer.
The error-to-rule loop is the engine
This is where the harness grows. Hashimoto describes the loop like this: anytime you find the agent makes a mistake, you stop and engineer a solution so the agent never makes that mistake again ("My AI Adoption Journey"). It isn't fixing it by hand and moving on. It's turning the failure into a permanent rule. In practice, each line in your AGENTS.md or CLAUDE.md is based on a bad behavior you saw. The rules file isn't written in one sitting, it's the accumulated record of everything that has gone wrong.
The five steps, in order
| Step | What to do | Concrete example |
|---|---|---|
| 1. Start simple | The smallest prompt that solves it; complexity only when simple fails | A single prompt before wiring a multi-step agent |
| 2. Error-to-rule loop | Each failure becomes a permanent fix, not an in-the-moment patch | Saw the agent err, write the rule that prevents it |
| 3. Guides | Direct the agent before it acts (feedforward) | CLAUDE.md, operating rules, allowed tools |
| 4. Sensors | Give feedback after the action so it self-corrects | Tests, linters, and typecheck the agent reads |
| 5. Memory and observability | Rules persist across sessions and behavior stays auditable | Versioned rules, per-phase artifacts (spec, plan, report) |
Systematize into guides and sensors
After a few cycles the patterns show up, and that's when you systematize. Birgitta Böckeler (Thoughtworks) gives the two build primitives (martinfowler.com, April 2026): guides, which direct the agent before it acts (rules, allowed tools), and sensors, which give feedback afterward (tests, linters, typecheck the agent reads). Hashimoto reinforces the sensor side: give the agent fast, high-quality tools that automatically tell it when it's wrong. Atlan proposes one more step, a "data layer", as the third stage of the sequence (guides, sensors, data layer). Worth noting that Atlan is a data-catalog company, so that step is self-interested, not neutral consensus. Guides and sensors are the core; the rest depends on your context.
Where it comes ready (and where it has to be built)
You don't have to build the coding layer from scratch. For development, the error-to-rule loop, the guides, and the sensors already ship inside capivaOS, the open-source harness on top of Claude Code: a spec-first pipeline with mandatory tests and a state machine. It installs as a plugin and you start today. But the harness that pays off most is rarely the coding one, it's the operational harness: the same pattern applied to running your business. Nobody installs that ready-made, it's designed from your own failures, and it's the starting point of our strategic diagnosis. The account of how it gets built in production is in AI Harness in Practice.
Frequently asked questions
How do I build an AI harness from scratch?▼
Start with the smallest prompt that solves the problem and run it. When the agent errs, turn each failure into a permanent rule instead of fixing it by hand (Hashimoto's error-to-rule loop). After a few cycles, systematize the rules into guides (direction before the action) and sensors (feedback afterward, like tests and linters). Anthropic recommends exactly this order: simple first, complexity only when needed.
Why start simple instead of designing everything up front?▼
Because you don't know where the agent will fail until you run it. Anthropic ("Building Effective Agents", December 2024) recommends starting with simple prompts and adding multi-step systems only when the simple approach falls short. Complexity added before seeing a real failure is a bet. The observed failures tell you what to engineer.
What is the error-to-rule loop?▼
It's the engine of the harness, described by Mitchell Hashimoto in "My AI Adoption Journey". Every time the agent makes a mistake, you engineer a solution so it never makes that mistake again. Each line in your CLAUDE.md or AGENTS.md is based on a bad behavior you observed. The rules file is the accumulated record of failures you've fixed.
What goes into guides and sensors?▼
Guides direct the agent before it acts: operating rules, CLAUDE.md, the list of allowed tools. Sensors give feedback afterward: tests, linters, and typecheck the agent can read and use to self-correct. The taxonomy is Birgitta Böckeler's (Thoughtworks, on Martin Fowler's site, April 2026). Hashimoto adds that the feedback tools need to be fast and high-quality.
Do I need a "data layer" to build a harness?▼
Atlan puts a data layer as the third step, after guides and sensors. But Atlan is a data-catalog company, so that step is self-interested, not neutral consensus. The core of any harness is guides and sensors plus the error-to-rule loop. A data layer may make sense in your context, but it isn't required to start.
Can I use a ready-made harness instead of building one?▼
For the coding layer, yes. capivaOS is an open-source harness on top of Claude Code, with a spec-first pipeline, mandatory tests, and the correction loop already built in, installed as a plugin. It handles development. The operational layer, the harness that runs the business, still has to be designed on your own stack, and that's where a strategic diagnosis comes in.
You don't design the harness. You grow it, one failure at a time.