Harness Engineering
Designing the environment, tools, context, rules and feedback loops around an AI model, so it can do real work reliably.
New to harnesses? Start with the Harness learning path: basics, designing one, then harness engineering in practice.
The evolution
- Prompt engineering (2022 to 2024): what you say to the model. Message level. “How should I ask?”
- Context engineering (2025): what the model sees. Session level. “What information should it have?”
- Harness engineering (2026 onwards): the whole system it runs in. System level. “How does it execute reliably?”
Each layer contains the one before: the prompt sits inside the context, and the context pipeline is a subsystem inside the harness. Same model, better harness, very different results.
The 5 pillars
1. Context
What the model knows right now.
- System instructions, retrieved documents (RAG), skills loaded on demand
- Memory and state that persist across steps and sessions
- Compaction and summarising so long tasks don’t overflow the window
Prevents: hallucination from missing information, or confusion from too much noise.
2. Action
How the model touches the world.
- MCP servers, APIs, browser and computer use, code execution
- Clear tool descriptions matter as much as the tools themselves
Prevents: a model that can only talk, not do.
3. Orchestration
How work is sequenced.
- Planning, state tracking, task breakdown, delegation to sub-agents, retries
- Lets an agent run for hours without losing the thread
Prevents: drift, loops, and forgetting what it was doing.
4. Control
What the model is allowed to do.
- Guardrails, permissions, human approval for risky steps, output validation
- Sandboxing (an isolated environment to work in), cost and time budgets
Prevents: irreversible mistakes, data leaks, runaway spend.
5. Feedback
How you know it’s working, and how it improves.
- Evals, logs and traces, monitoring, self-checks (for example, running tests before declaring “done”)
- The improvement loop: treat every agent mistake as a permanent signal. Each failure becomes a new rule, tool or check in the harness
Prevents: silent failure and “it worked in the demo”.
One-line test for any AI system
Background and what’s next
- The term spread quickly in early 2026, notably through OpenAI’s Codex experiments, where the harness, not the agent, turned out to be the hard part.
- No single official list of components exists. These five pillars are the author’s own synthesis, and map closely to commonly cited ones: context delivery, tool interfaces, planning, verification, memory and sandboxes.
- Emerging next: loop engineering, where agents run in loops without a human pressing the button. The loop is the choreography; the harness is the stage.
Sources
Based on a working document of the author’s. For terms, see the Jargon Decoder. For how to measure the feedback pillar, see AI Evals.