Harness Engineering: The Wrapper Wins
Table of Contents
Related reading on the blog: If youâre new to the topic, this post assumes you already know the basics of agents and context. To get up to speed, read first Effective Context for AI in Android, GSD Core: the anti-ceremony context engineering framework, and Headroom: the compression layer your agent stack needs. If youâve already read those, jump to âThe 3 Erasâ â this article is the meta-layer that ties the others together.
Thereâs a number I keep saying out loud since I first read it: +13.7 points on Terminal Bench 2.0 by changing ONLY the harness, with the exact same model (gpt-5.2-codex). The LangChain team published it in mid-March: their deepagents-cli agent went from Top 30 to Top 5 on the leaderboard (52.8% â 66.5%) without touching a single model parameter, just by rewriting the system prompt, tuning the tools, and adding middleware around the calls. Zero fine-tuning. Zero provider swap. Zero magic. Pure wrapper engineering.
Then thereâs the Vercel data point that cinematically completed the picture: they removed 80% of their agentâs tools, left it with a flat filesystem + grep, and the results were better on almost every metric: 100% success (up from 80%), 3.5Ă faster, â40% tokens. Again, the model didnât move a millimeter.
If youâve been reading about agents for six months, youâve probably come across the word harness somewhere. Maybe you saw it first on Mitchell Hashimotoâs blog on February 5, 2026; maybe it reached you via the LangChain team; maybe some influencer on X dropped it on you. The interesting question isnât where the term comes from, itâs why suddenly everyone is obsessed with the same idea: the model commoditizes, the wrapper wins.
This post is what I would have wanted to read three months ago, before spending two weeks diving into HN, Reddit, X, the LangChain blogs, Tomasz Tunguzâs newsletter, Stuart Millerâs Substack, and Nicolas Neiraâs guide. Itâs the indie â and slightly skeptical â answer to the question: what exactly is Harness Engineering, does it actually affect me as an independent developer, or is it just another hype rebrand?
đ The metaphor: the mustang and the saddle
Tomasz Tunguz (GP at Theory Ventures, 150,000 readers on his newsletter) summarized it in his piece âHarnessing AIâ with the best metaphor Iâve read in months:
âAI is powerful but wild. Harnessing the power means domestication. There are seven parts to this domestication: context & memory, tools & action, orchestration & loop, state & persistence, sandbox & compute, observability & governance, and cost & workflow optimization.â
The mental image is powerful: an LLM is a mustang â pure brute force, instinct, undirected intelligence. Useless in your day-to-day until you put a saddle on it, some reins, a fenced path, and a rider who knows what theyâre doing. The harness is the set of all those things. Without it, the model is an inference bill. With it, the model is an engineer.
Vercel discovered exactly this in production: fewer tools and more filesystem gave them a more capable agent. Why? Because tools are constraints and the filesystem is freedom. An agent with 16 specialized tools has to remember which one to use in each case; one with bash + read_file + write_file can improvise its own approach. The saddle doesnât have to be elaborate; it has to be the right one.
đ The origin: Mitchell Hashimoto, February 5, 2026
The term was put into circulation by Mitchell Hashimoto, co-founder of HashiCorp and creator of Terraform. He did it in Step 5 of a personal post titled âMy AI Adoption Journeyâ, written by hand and dated February 5, 2026.
Hashimoto recounts his 6 steps from AI skeptic to AI-productive. Step 5 is literally titled âEngineer the Harnessâ and the key quote is this:
âAt risk of stating the obvious: agents are much more efficient when they produce the right result the first time, or at worst produce a result that requires minimal touch-ups. The most sure-fire way to achieve this is to give the agent fast, high quality tools to automatically tell it when it is wrong. I donât know if there is a broad industry-accepted term for this yet, but Iâve grown to calling this âharness engineering.â It is the idea that anytime you find an agent makes a mistake, you take the time to engineer a solution such that the agent never makes that mistake again.â
Note what he doesnât say. He doesnât talk about the model. He doesnât talk about the provider. He doesnât talk about GPT-5 or Claude 4.6 or Gemini 3.1. He talks about AGENTS.md (documentation the agent reads on startup) and programmed tools (verification scripts, tests, health checks). The most sober definition that exists:
âIt comes in two forms: better implicit prompting (AGENTS.md) and actual, programmed tools.â
Thatâs it. Thatâs the seed. Everything else â Tunguzâs 7 components, Neiraâs 5 patterns, LangChainâs Agent = Model + Harness â are expansions of that minimalist idea.
đ§Ź Operational definition: Agent = Model + Harness
Vivek Trivedy (LangChain) gave it the canonical form in his post âThe Anatomy of an Agent Harnessâ on March 10, 2026:
âAgent = Model + Harness. If youâre not the model, youâre the harness. A harness is every piece of code, configuration, and execution logic that isnât the model itself. A raw model is not an agent. But it becomes one when a harness gives it things like state, tool execution, feedback loops, and enforceable constraints.â
The formula is deliberately simple, and thatâs why itâs powerful. It forces you to classify every component of your system in one of two boxes: is it the model? or is it the harness? If the answer is âI donât knowâ, itâs harness. And that includes:
- System prompts (the
AGENTS.mdthe agent reads on startup) - Tools, skills, and MCPs (with their descriptions, which are part of the prompt)
- Bundled infrastructure (filesystem, sandbox, browser)
- Orchestration logic (subagent spawning, handoffs, model routing)
- Hooks and middleware (compaction, continuation, lint checks)
That classification is what makes Trivedyâs post useful as a catalog. He follows a brutal design rule: derive each harness component working backwards from a desired agent behavior. Want the agent to verify its own work â add a PreCompletionChecklistMiddleware. Want the agent to not get stuck in a doom loop editing the same file 10 times â add a LoopDetectionMiddleware. Want the agent to not run out of time â inject a time budget into the prompt.
đ°ď¸ The 3 eras: Prompt â Context â Harness
Nicolas Neira (senior engineer with his own newsletter) gave it the historical dimension. He summarizes 2022-2026 as three eras of AI engineering, each answering a different question:
| Era | The question it answers | Period | Canonical example |
|---|---|---|---|
| Prompt Engineering | What do I tell the model? | 2022-2024 | âAct as an expert in Xâ |
| Context Engineering | What does the model know? | 2025 | RAG, context window, skills |
| Harness Engineering | Where does the model work? | 2026 | AGENTS.md, hooks, sandboxes, observability |
The chronology he reconstructed from primary sources (each citation verified):
- November 2025 â Anthropic publishes âEffective Harnesses for Long-Running Agentsâ. First formal use of the term in a frontier-lab blog. Talks about initializer agent, coding agent, and a
claude-progress.txtto maintain state across sessions. - February 5, 2026 â Mitchell Hashimoto, âMy AI Adoption Journeyâ. Coines the verb âharness engineeringâ as a discipline.
- February 11, 2026 â OpenAI publishes âHarness engineering: leveraging Codex in an agent-first worldâ. Anecdote: 7 engineers, 1 million lines of code in 5 months, zero written by hand. The engineerâs job stops being writing code; it becomes designing the harness. (The post hit 123 points on HN the same day.)
- April 2026 â Martin Fowler publishes his formal taxonomy: Guides (computational / inferential) + Sensors (computational / inferential). When Fowler organizes something, the industry adopts it. It happened with Refactoring, it happened with Microservices, itâs happening now with Harness Engineering.
- April 2026 â Andrej Karpathy at Sequoia AI Ascent declares âvibe codingâ dead and replaces it with agentic engineering, where 99% of the time you donât write code â you orchestrate agents.
In less than 6 months, harness went from an adjective only used by OpenAIâs internal teams to a noun with academic taxonomy. Itâs not pure hype: itâs a convergence of multiple lines (Anthropic, OpenAI, LangChain, Mitchell, Fowler, Karpathy) reaching the same place by different paths.
đ§Š The 5 patterns (Neiraâs practical taxonomy)
Nicolas Neira identified 78 moments of harness engineering in engineering videos on his channel before the term even existed. He grouped them into 5 patterns. This is the part that serves me most as an indie developer, because I can apply it tomorrow:
1. Restrictions (27 moments)
Limit what the agent can do BEFORE it acts. This is the most frequent category, and the most counter-intuitive for those of us who start with agents: your first instinct is to give it more tools; the right one is to give it fewer. Concrete forms:
- Tool restriction (remove tools the agent shouldnât be able to invoke)
- IAM permissions (limit which files it can read/write/delete)
- Secrets in Secret Manager (not hardcoded in the prompt)
- Allow-lists of permitted bash commands
2. Verification (18 moments)
Observe AFTER the agent acts. The category with the most impact on autonomy. Forms:
- Hooks that reject dangerous operations (deleting DNS records, running
rm -rfin prod) validate.shthat rejects malformed skills- Programmatic tests the agent runs on its own output
- A second LLM reviewing the first oneâs output (Fowler calls this Inferential Sensor; I call it âthe reviewer who never gets boredâ)
3. Documentation (19 moments)
Files that define how the system behaves. This is where each projectâs AGENTS.md lives, the skills, the tool contracts, the constitution files from Spec-Kit. The rule I learned: every line in an AGENTS.md should come from a real agent error. If it didnât come from an error, itâs noise. If it came from an error, itâs gold.
4. Observability (5 moments)
If you canât see what the agent does, you donât have a harness. LangSmith traces, OpenAIâs 7 tmux panels, structured OpenTelemetry logs, session replay. Without observability, debugging an agent in production is witchcraft.
5. Reactive iteration (5 moments)
When something fails, the harness adapts â not the model. The piece that closes the loop. Neiraâs real example: when AI Studio returned 503 mid-run, the team didnât rewrite anything â they migrated the endpoint to Vertex AI by changing 3 variables in the config. That ability to reroute without retraining is what separates a harness from a prompt.
đ§Ş The benchmark that proves it works (LangChain + Terminal Bench 2.0)
Letâs go back to the data point from the beginning because it deserves to be dissected. LangChain documented in âImproving Deep Agents with Harness Engineeringâ the full recipe that took their deepagents-cli agent from position 30 to 5 on Terminal Bench 2.0 (89 tasks in ML, debugging, and biology) with the same model:
- Model fixed:
gpt-5.2-codex - Baseline: 52.8% with standard prompt + standard tools
- Final: 66.5% after the harness changes
- Delta: +13.7 points
The knobs they turned (and only those):
- System prompt with explicit 4-phase guidance: Planning & Discovery â Build â Verify â Fix. Obsessive insistence on writing tests before calling anything done.
- New middleware:
PreCompletionChecklistMiddleware(intercepts the agent before exit and reminds it to verify against the spec) andLoopDetectionMiddleware(counts edits per file and, if they exceed N, injects âconsider reconsidering your approachâ). LocalContextMiddlewarethat on startup mapscwd, parent dirs, finds binaries (Python, Node) and injects them into context. Result: the agent doesnât waste time discovering its own environment.- Reasoning sandwich:
xhighat the start (to understand the problem) âhighormediumduring the work âxhighagain at the end (to verify). Optimizes compute spend.
The most interesting thing is what they didnât do. They didnât change models. They didnât fine-tune. They didnât change providers. They didnât rewrite the algorithm. They changed what was around the model, and that was enough to climb 25 spots.
đŁď¸ The honest critique: is it just Platform Engineering in a new coat?
Not everyone is convinced. Stuart Miller published on May 8, 2026 in his Substack âHarness Engineering? Why the AI Industryâs Newest Buzzword is an Old Ideaâ an article that went viral on LinkedIn, and the thesis is direct:
âThe âthingâ being described is not new. It is not even slightly new. When you look at what is being defined, it is the practice of building a sensible software environment around a moving part, and we have names for that. A lot of names, and most older than my favorite pair of shoes: Platform engineering. Middleware design. Site Reliability Engineering. Service-oriented architecture. Control plane design.â
Miller concedes an honest nuance: LLMs are stochastic (they donât give the same answer twice), and wrapping something stochastic in a disciplined environment is indeed a slightly different design problem from wrapping a deterministic microservice. But his conclusion is that the principle â putting discipline around an unreliable component so it produces repeatable results â is as old as the assembly line.
And heâs partly right. The principle is old. Whatâs new is:
- The scale of variability of the wrapped component. A microservice with bugs is 99.9% reliable. An LLM with good temperature is 70% reliable on long tasks.
- The iteration speed of the harness. In 2015, tuning a systemâs harness cost a sprint. In 2026, tuning an agentâs harness costs a commit and a
/clear. - The direction of the discipline: in SRE/Platform Engineering, the harness surrounds a system that canât be rewritten. In Harness Engineering, the harness also writes and rewrites the system (or part of it), because the agent is both tool and operator.
The constructive critique Iâd add, as an indie: donât get obsessed with the name. Call it agent infrastructure, agent ops, scaffolding â whatever you want, the work is the same. What matters is that you do it. An agent without a harness is an expensive hobby. An agent with a harness is an engineer.
đ ď¸ What this means for your indie workflow
If youâve been reading my articles for a while, youâll have noticed that Iâve spent a year building, without knowing it, a harness. The enumeration surprised me when I did it:
AGENTS.mdin every repo with rules born from real errors â Agents.md as a standard is exactly âDocumentationâ from pattern 3.- Curated skills (kanban, write-blog, write-devlog, grill-me) loaded as procedural context â fits âContext & Memoryâ from Tunguz.
- Hermes hook system that intercepts destructive actions â âRestrictionsâ + âVerificationâ from patterns 1 and 2.
- Durable cron jobs that execute workers with persistent memory â âState & Persistenceâ.
- Telegram sandbox so the user can approve sensitive operations â âHuman-in-the-loopâ as an inferential sensor.
- Traces and logs of every session in
~/.hermes/logsâ pure âObservabilityâ. - Context compression with Headroom between the agent and the provider â the missing piece.
- Task decomposition with kanban into small workers with clean context â âOrchestration & Loopâ.
- Memory stack (Hipocampus, hmem, plugmem, PARA files) â âState & Persistenceâ with 4 different strategies.
- Spec-driven workflows (OpenSpec, Spec-Kitty, BMAD) â feed the
AGENTS.mdand skills with verifiable contracts.
Mapped point by point, my setup is a textbook harness â I just built it by reading real errors from my agents over a year, which is exactly the methodology Hashimoto describes in his Step 5. Itâs not theoretical. Itâs not marketing. Itâs the direct consequence of treating every error as a hole in the harness and patching it with a rule, a tool, or a hook.
The uncomfortable but useful lesson: if youâve been using agents seriously for more than 6 months, you already have a harness. The question isnât âshould I build one?â â itâs âam I iterating on it discipline by discipline, or am I patching holes with more prompts?â If the answer is the second one, this post is for you.
đ Minimum anatomy: 5 pieces for Monday
If I had to distill everything above into an actionable checklist for an indie starting next week, it would be this:
- Create an
AGENTS.mdat the root of the project, with 5-10 rules that come from real errors your agent made this week. Nothing generic. Each line is your blood. - Reduce the number of tools to the minimum (the Vercel lesson). If you have more than 10, ask yourself which ones are redundant. A
bash+ flat filesystem often wins. - Add ONE verification hook â for example, a
validate.shthat the agent runs before marking a task as done. Start with one. Youâll add more later. - Make the invisible visible: traces from every session, structured logs, or at least a
tail -fof the conversation. Without observability, debugging agents in production is witchcraft. - Write ONE explicit exit condition: âthe reviewer canât iterate more than 2 roundsâ, âthe agent canât edit the same file more than 5 timesâ, âif verification fails 3 times, escalate to humanâ. Exit conditions are the agent equivalent of the
forloops withbreakthat your 2015 self refused to write.
Five pieces. One week. More impact on agent autonomy than any fine-tuning or model upgrade youâll do this quarter.
đ Lessons learned (what I take away)
After two weeks reading everything published on the topic and mapping it against my own setup, hereâs what I know:
- The model commoditizes, the harness wins. The LangChain benchmark is the empirical proof. In 12 months, gpt-5.2-codex will be gpt-6; the harness you wrote keeps working because itâs model-agnostic.
- The harness is not the prompt. The prompt is one piece of the harness. Confusing the two is why most âprompt engineersâ never get to building a production agent. If your only job is writing prompts, youâre doing 5% of the work.
- The error is the construction material. Hashimoto is right: every line in a good
AGENTS.mdcomes from a real error. If you donât accumulate errors and convert them into rules, youâre not doing harness engineering, youâre doing wishful thinking. - Fewer tools, more power. Vercel, LangChain, and Tunguz agree without having coordinated. Restraint generates capability. Itâs counter-intuitive until you try it.
- The name matters less than the practice. Harness, scaffolding, agent infrastructure, agent ops⌠Call it X. The discipline is the same: serious engineering around a stochastic component.
- As an indie, you already have a harness â you just havenât documented it. If youâve been working with agents for a year, open your
AGENTS.mdand count how many of the 5 patterns you recognize. Probably 4 or 5. The work now is to document it and share it.
đ Bibliography and references
Primary sources (ordered by importance)
- Mitchell Hashimoto â âMy AI Adoption Journeyâ (February 5, 2026). The origin of the term. Step 5, âEngineer the Harness.â
mitchellh.com/writing/my-ai-adoption-journey - Vivek Trivedy (LangChain) â âThe Anatomy of an Agent Harnessâ (March 10, 2026). The canonical definition:
Agent = Model + Harness.langchain.com/blog/the-anatomy-of-an-agent-harness - LangChain â âImproving Deep Agents with Harness Engineeringâ (March 2026). The Terminal Bench 2.0 case study: +13.7 points by changing only the harness.
langchain.com/blog/improving-deep-agents-with-harness-engineering - Anthropic â âEffective Harnesses for Long-Running Agentsâ (November 2025). The first formal use of the term in a frontier lab.
anthropic.com/engineering/effective-harnesses-for-long-running-agents - OpenAI â âHarness engineering: leveraging Codex in an agent-first worldâ (February 11, 2026). 7 engineers, 1M LoC in 5 months, zero by hand.
openai.com/blog/harness-engineering
Analysis and critique
- Tomasz Tunguz â âHarnessing AI / Software After AIâ (May 2026). The mustang metaphor and the 7 components of âdomesticationâ.
tomtunguz.com/harnessing-ai - Simon Willison â âHow coding agents workâ (March 2026). The clearest technical definition: âA coding agent is a piece of software that acts as a harness for an LLM.â
simonwillison.net/guides/agentic-engineering-patterns/how-coding-agents-work - Addy Osmani â âAgent Harness Engineeringâ (April 2026). The product-engineering angle.
addyosmani.com/blog/agent-harness-engineering - Martin Fowler â âAgent Harnesses: Guides and Sensorsâ (April 2026). The formal taxonomy: computational vs inferential.
martinfowler.com/articles/exploring-gen-ai/harnesses.html - Nicolas Neira â âHarness Engineering: Why Claude, GPT and Gemini No Longer Matterâ (2026). The chronology of the 3 eras and the 5 patterns.
nicolasneira.com/en/harness-engineering - Andrej Karpathy â âAgentic Engineeringâ (Sequoia AI Ascent, April 2026). The death of vibe coding.
- Stuart Miller â âHarness Engineering? Why the AI Industryâs Newest Buzzword is an Old Ideaâ (Substack, May 8, 2026). The most honest critique: platform engineering with new clothes.
haverin.substack.com/p/what-is-harness-engineering-ai-hype
Community threads worth reading
- Hacker News â âHarness engineering: Leveraging Codex in an agent-first worldâ (123 points, February 2026).
news.ycombinator.com/item?id=48416264 - Hacker News â âHarness Engineering: 52 Days, One Person, 965K Lines of Codeâ (March 2026). AgentsMesh case: 600 commits, 365k LoC in production.
news.ycombinator.com/item?id=47372903 - Hacker News â âBuilding agents without harness engineeringâ (June 2026). The thread that questions adoption: âI read this twice and didnât fully understand what it was telling me.â
news.ycombinator.com/item?id=48493447 - r/ArtificialInteligence â âHarness Engineering: Turning AI Agents Into Reliable Engineersâ (April 2026).
reddit.com/r/ArtificialInteligence/comments/1sc3m1t - r/theprimeagen â âwtf is Harness Engineer & why is it importantâ (April 2026). The best line: âUse deterministic logic and only use LLMs when they are required.â
reddit.com/r/theprimeagen/comments/1sx738w - r/Trae_ai â âThe Definitive Guide to Harness Engineeringâ (April 2026).
reddit.com/r/Trae_ai/comments/1sti4jx
Related reading on this blog
- Effective Context for AI in Android: the art of clear communication â era 2 (Context Engineering) explained for Android.
- GSD Core: the anti-ceremony framework for context engineering â a concrete harness for Claude Code.
- Headroom: the compression layer your agent stack needs â âVerificationâ + âContext & Memoryâ in production.
- Agents.md as an open standard â the âDocumentationâ piece of pattern 3.
- Persistent Memory for AI Agents: Practical Guide â the âState & Persistenceâ piece in four strategies.
- Complete AI Agent Stack 2026 â the catalog of tools that fit in a harness.
- Superpowers Deep Dive: the most complete skills framework â skills as harness pieces.
- OpenSpec in Mobile Development: spec-driven without theater â feed the
AGENTS.mdwith verifiable specs. - Alternative Paradigms in AI-Assisted Software Engineering â the broader philosophical context.
- Production-Ready Agentic Frameworks: 6 Strategies â frameworks that already implement part of the harness.
- Spec-Driven Development with Agentic AI â specs as input to the harness.
Hashimotoâs post closes with an image thatâs stuck with me: âI literally did the work twice. Iâd do the work manually, and then Iâd fight an agent to produce identical results.â Itâs the opposite image to Karpathyâs âvibe coding.â Itâs harness engineering in its most honest form: you do the work by hand, you see where the agent fails, and you build the guardrail that prevents that failure forever. Itâs not glamorous. Itâs not viral. But itâs what separates a demo agent from one that produces real software at 3 AM while you sleep.
If you read this far and your AGENTS.md has fewer than 10 lines, you have homework for Monday. If it has more than 100, youâre probably over-documenting instead of iterating. The sweet spot, as always, is iterating real errors one by one until the harness stops being noticed and starts feeling like part of the model. Thatâs the moment you won.
You might also be interested in
DeepSeek Super Agent: Router, Workers, Attention
DeepSeek's Super Agent ships as an MIT prototype: one Router, many isolated Workers. What it does, what its numbers show and what it costs to run.
DeepSeek Harness vs OpenCode, Codex and Claude Code: head to head
Honest comparison of DeepSeek Harness (dsh), OpenCode, Codex CLI and Claude Code. Philosophy, plugin model, sandbox, ecosystem and who wins each in 2026.
RTK vs Caveman: real token savings in AI agents
RTK and Caveman promise 60-90% token cuts in agents. I measure both with real data: JetBrains' 8.5% finding, a 614M-token replay and the output-vs-prose gap.