Harness engineering: the part of the agent that isn't the model
most people respond to a failing agent by rewording the prompt, then swapping the model, then buying a bigger context window. the agent still forgets decisions, still picks the wrong tool, still skips verification.
i agree with the argument going around on X that the problem is often not the intelligence. its the environment the model runs in. that environment is the harness, and designing it is harness engineering. i'm making the same case here, plus two things the popular version leaves out.
The core idea
OpenAI's Codex team built an internal product with no hand-written code. early progress was slow "not because Codex was incapable, but because the environment was underspecified." when something failed, the fix was almost never "try harder." they asked what capability was missing and how to make it legible and enforceable for the agent.
to me thats the whole shift. prompt engineering improves the instruction. context engineering decides what the model sees. harness engineering builds the world the model acts in.
The map
What I'd add
1. Harnesses need garbage collection
agents copy whatever patterns already exist, including the bad ones. OpenAI's team spent every Friday, 20% of the week, cleaning up what they called "AI slop." it didn't scale, so they encoded "golden principles" into the repo and ran recurring background tasks that scan for drift and open small refactor PRs.
if you only build the parts that make an agent productive, you've built something that decays. i count the maintenance loop as part of the harness.
2. Every component is a bet that expires
Anthropic's long-running agent work is explicit about this. each harness component encodes an assumption about what the model can't do alone, and those assumptions go stale. context resets that helped one model generation became dead weight on the next, and the sprint structure got removed once a stronger model showed up.
that doesn't make harness engineering a dead end. Anthropic's point is that the useful designs move around as models improve, not that they disappear. but it does change my advice. verification, state and permissions are the durable parts. scaffolding that patches one specific weakness is temporary, so i review it whenever the model changes.
Where the thread claims more than the sources say
a few things in the thread are stronger than what the sources actually back up:
- the Amodei quote about needing "a harness" is real. but he was talking about why Claude Code exists as an interface, not about making agents reliable.
- OpenAI says it loops until the agent reviewers are happy. it never mentions a cap on retries. i think "bounded retries" is good advice, but you can't point to OpenAI for it.
- OpenAI's relaxed merge rules only work because the agents produce so much code. OpenAI itself says they'd be irresponsible at lower volume.
TLDR
when an agent fails twice the same way, dont edit adjectives. in farsi we say:
مؤمن از یک سوراخ دو بار گزیده نمیشود
momen az yek soorakh do bar gazideh nemishavad
literally: a wise person isn't bitten twice by the same hole.
the second bite is the signal. ask what the agent couldn't see, couldn't verify, or wasn't stopped from doing, then close the hole in the system instead of the prompt. and date-stamp the fix, you'll need to re-ask when the model changes.
Sources
- @0xwhrrari, Harness Engineering: How to Build AI Agents That Don't Fall Apart (the thread this responds to)
- OpenAI, Harness engineering: leveraging Codex in an agent-first world
- Anthropic, Harness design for long-running application development
- Anthropic, Scaling Managed Agents: decoupling the brain from the hands
- Dwarkesh Patel, interview with Dario Amodei