The harness is the product: why AI agents fail

The harness is the product: why AI agents fail
66.5%LangChain on Terminal Bench 2.0, without touching the model
40%+agentic AI projects canceled by 2027, according to Gartner
70-95%agent failure rate on complex enterprise tasks
<200lines in the root instructions file
The Harness Is the Product: Why Your AI Agent Fails (It's Not the Model)
I also cover it in this five-minute video on my Articulator EN channel.

Same model, different resultlink

The article opens with a number that breaks the most common intuition. LangChain's coding agent went from 52.8% to 66.5% on Terminal Bench 2.0, a benchmark of real tasks in the terminal. It climbed from 30th place to the top 5 of the leaderboard. And it did it without changing a single model parameter: the only thing that changed was what surrounded the model.

A robot coding next to the 66.5% LangChain reached on Terminal Bench 2.0.
From 52.8% to 66.5% with the same model.

The author pairs it with two figures that show why the topic matters. Gartner predicts that over 40% of agentic AI projects will be canceled by 2027, and seven independent studies agree that agents fail 70 to 95% of the time on complex enterprise tasks.

A robot facing error screens with failure rates of 70% and 95% on complex enterprise tasks.
Agent failure rates on complex enterprise tasks.

Faced with those failures, the usual move is to blame the model. The article argues the opposite: models have become a commodity. Claude, GPT and Gemini converge in capability every quarter, and the teams shipping agents to production aren't the ones with access to the best model, but the ones that built the best system around it. The question that matters is no longer which model you pick, but which system wraps it.

What a harness islink

A harness is the infrastructure that wraps the model and manages how it works. It isn't the model, which does the reasoning, and it isn't the prompt, which is what you ask for at each moment. It's everything else: what information reaches the model, which tools it has, which checks its results go through and what gets saved for next time.

The author's example comes from OpenAI: they built a production application with over a million lines of code, none of them written by a person. The engineers didn't write the application; they designed the harness. They added constraints, feedback loops, documentation, linters (programs that review code automatically) and lifecycle management, so the model could write code reliably.

According to the article, the harness has three jobs:

Context

Deciding what information the model sees at each step, no more and no less.

Limits

Enforcing what the model can do and what it cannot do.

Memory

Letting the model learn from its own history instead of starting from scratch.

Three icons: an eye for context, a shield for limits and a book with a brain for memory.
The three jobs of the harness.

Without a harness, a model reasons well in isolation but fails in production. With one, you have a system that gets better over time.

Why the giant instructions file failslink

The first mistake the article points out is very common among people working with coding agents. You start with a CLAUDE.md or an AGENTS.md, the instructions file the agent reads at the start, and little by little it turns into an encyclopedia. Every edge case adds a rule and every failure adds an instruction, until the file hits 2,000 lines and the model starts ignoring half of it.

A 2,000-line document stamped «50% ignored».
When the file grows unchecked, the model stops reading half of it.

The reason is that context is a scarce resource. Everything the model reads takes up room in its context window, and a giant instructions file crowds out what really matters: the task, the code and the relevant documentation. When everything is «important», nothing is.

OpenAI's Codex team solved it by treating the instructions file as a table of contents. The knowledge lives in a docs/ folder organized by topic, and the model gets the right context at the right time instead of drowning in all the context all the time.

A CLAUDE.md under 200 lines that works as an index and points to docs/ folders by topic.
The root file as an index; the knowledge, in docs/.

The pattern it proposes has four rules:

  • Short root file: under 200 lines.
  • Knowledge by topic: organized in a structured directory.
  • Dynamic context: load the relevant documentation for each task, not everything every session.
  • Aggressive pruning: if a rule hasn't prevented a failure in 30 days, remove it.

It's what I do in the project I use to make these videos: the CLAUDE.md is a short index, and everything worth remembering between sessions lives in a docs/ folder, one document per topic.

The four pillarslink

Harness engineering, according to the author, rests on four pillars. Typical setups build one or two; production requires all four.

1. Layered context architecture

The model doesn't see everything at once: information is disclosed progressively. First the project, then the module and finally the file.

  • Layer 1, project: architecture, conventions and invariants. Always loaded.
  • Layer 2, module: the module's docs, schemas and constraints. Loaded per task.
  • Layer 3, file: file history, recent changes and related test results. Loaded per file.

It also proposes a context budget: track how many tokens each layer uses and alert when any of them goes over 40% of the window.

Three stacked layers: project, module and file.
Project, module and file: one layer at a time.

2. Specialized agents

A single generalist agent doesn't scale. Production systems use specialized agents, with narrow responsibilities and scoped tools.

  • One agent per domain: code generation, testing, review and deployment.
  • Only the tools it needs: no universal access.
  • Structured handoffs: agents communicate through defined deliveries, not by sharing the same context window.
  • One system prompt per role: an agent that writes tests doesn't need deployment instructions.
Three robots: one writes code, another writes tests and another reviews.
Each agent, with its own job and tools.

3. Persistent memory

Conversation history vanishes when the window closes, and that isn't memory. Real memory lives in the file system:

  • decisions.md: architectural decisions, with their rationale and date.
  • failure-catalog.md: an indexed catalog of failures and how they were resolved.
  • session-state.md: what changed last session, which tests broke and what the agent learned.

The agent reads memory at the start of each session and writes it at the end. Memory is append-only, to keep an audit trail, and it's pruned in a separate review process.

A robot reading a memory/ folder with decisions.md, failure-catalog.md and session-state.md.
The agent's memory, in files it reads at the start and writes at the end.

4. Structured execution

The model should never jump from the prompt to the code in one step. Structured execution enforces a workflow: research, plan, execute and verify. The article spells it out in six steps:

  1. Read: the agent reads the relevant context and its memory.
  2. Plan: it produces a plan with the files it will change, the tests it will write and the risks.
  3. Review the plan: a person or an automated process reviews it before execution.
  4. Execute with guardrails: with a maximum number of files per session, protected file lists and simulation before deploying.
  5. Verify: tests, linting and security scanning.
  6. Remember: the agent writes the session results to memory.
Four chained steps: research, plan, execute and verify.
Research, plan, execute and verify; never from the prompt to the code in one leap.

Non-negotiable guardrailslink

Above the four pillars sit the guardrails. The author insists on treating them as hard policy enforcement the agent cannot override, and arranges them in a hierarchy:

  • Hard limits: the agent can't relax them.
  • Safety nets: they catch failures before they reach production.
  • Golden paths: they guide the agent toward the right patterns.
  • Audit: it lets you reconstruct what happened.

In practice, they translate into a cost ceiling per session, a time limit with auto-pause, protected file lists, simulation before every deployment, mandatory tests before every commit and an audit log of every agent action.

A checked list of guardrails: cost limit, time limit, protected files, simulation before deploying, tests before every commit and audit log, next to a session log.
Guardrails, checked every session and recorded in the log.

The compounding effect: the real moatlink

An agent without a harness starts from zero every session: it rediscovers patterns, repeats mistakes and carries no knowledge forward. An agent with a harness compounds. Every session adds entries to the failure catalog, every decision is recorded with its rationale and every interaction pattern is indexed for reuse.

A growing tree next to counters of sessions, cataloged failures and recorded decisions.
With a harness, every session builds on the previous ones.

According to the article, OpenAI's Codex team saw their agents become more reliable over time. Not because the model improved, but because the harness accumulated context that made the model's job easier.

That's the real moat, the advantage competitors can't copy. The model is interchangeable; the harness isn't. Six months of accumulated context, failure patterns and architectural decisions can't be replicated by switching to a new model or a new framework.

The model is the enginelink

For anyone building agents, the takeaway is clear. The model layer is commoditizing fast, and the gap between the best models narrows with every release. The author cites Carnegie Mellon: agents complete only 24% of standard office tasks, and the failure is infrastructure, not intelligence.

The teams that win build harnesses instead of shopping for models. LangChain proved it: same model, better harness, top 5.

And there's a twist I find the most interesting idea in the article: harness engineering matters more as models get better. A better model lets you give the agent more autonomy, and more autonomy demands better guardrails.

The outline of a car with a brain floating above it and the question «Just the engine?».
Nobody buys a car just for the engine.
In one sentence

The harness is the product. The model is the engine. And nobody buys a car just for the engine.

The production checklistlink

The article ends with a checklist that sums up everything above. I'm including it because it's the most useful part for reviewing the harness of your own agents:

Context architecture
  • Root instructions file under 200 lines.
  • Knowledge organized by topic in a directory.
  • Documentation loaded per task.
  • Context budget per layer, with alerts.
  • Stale rules pruned every month.
Specialized agents
  • Separate agents to generate code, test and review.
  • Scoped tools for each agent.
  • Documented handoffs between agents.
  • System prompt per role.
Persistent memory
  • Decisions, failures and session state stored in files.
  • The agent reads memory at the start.
  • The agent writes results at the end.
  • Append-only memory, with separate pruning.
Structured execution
  • Research → plan → execute → verify workflow.
  • Plans reviewed before execution on critical paths.
  • Maximum number of files per session.
  • Protected files against unauthorized changes.
  • Verification after every step.
Guardrails
  • Cost ceiling per session.
  • Time limit with auto-pause.
  • Simulation before every deployment.
  • Tests passing before every commit.
  • Audit log of every action.

In short: the model brings the power, and the harness brings everything else. What does the harness of your agents look like?

Sourceslink

The figures in this post are the ones cited in the original article; I didn't measure them myself.

Continue reading

Last posts -->

Have you seen these projects?

Gymnasia

Gymnasia Gymnasia
Expo
React Native
TypeScript
OpenAI
Anthropic

Fitness app with two agents that run entirely on the device, with no backend, so the user's data never leaves the phone. A BYOK conversational coach with local tools and a remote system prompt with offline fallback, plus a food estimator that pulls macronutrients out of a photo of the plate, with barcode scanning against OpenFoodFacts.

LangGraph Deep Researcher

LangGraph Deep Researcher LangGraph Deep Researcher
Python
LangGraph
FastAPI
React
TypeScript
Docker

Multi-agent research system built with LangGraph. A supervisor breaks your question down into topics and launches search sub-agents in parallel; each one compresses its findings before handing them to a writer agent that produces the final sourced markdown report. Live streaming over WebSockets, a configurable model per role and bring-your-own API keys that are never persisted server-side.

Tau

Tau Tau
Python
LangChain

Multi-agent tutoring system for secondary school students, with one agent per subject and course material written and validated by a team of teachers. It was used with real students at a private school in Spain and at a secondary school in Colombia.

View all projects -->
>_ Available for projects

Do you have an AI project?

Let's talk.

maximofn@gmail.com

Machine Learning and AI specialist. I develop solutions with generative AI, intelligent agents and custom models.

Do you want to watch any talk?

Last talks -->

Do you want to improve with these tips?

Last tips -->

Use this locally

Hugging Face spaces allow us to run models with very simple demos, but what if the demo breaks? Or if the user deletes it? That's why I've created docker containers with some interesting spaces, to be able to use them locally, whatever happens. In fact, if you click on any project view button, it may take you to a space that doesn't work.

Flow edit

Flow edit Flow edit

FLUX.1-RealismLora

FLUX.1-RealismLora FLUX.1-RealismLora
View all containers -->
>_ Available for projects

Do you have an AI project?

Let's talk.

maximofn@gmail.com

Machine Learning and AI specialist. I develop solutions with generative AI, intelligent agents and custom models.

Do you want to train your model with these datasets?

short-jokes-dataset

HuggingFace

Dataset with jokes in English

Use: Fine-tuning text generation models for humor

231K rows 2 columns 45 MB
View on HuggingFace →

opus100

HuggingFace

Dataset with translations from English to Spanish

Use: Training English-Spanish translation models

1M rows 2 columns 210 MB
View on HuggingFace →

netflix_titles

HuggingFace

Dataset with Netflix movies and series

Use: Netflix catalog analysis and recommendation systems

8.8K rows 12 columns 3.5 MB
View on HuggingFace →
View more datasets -->