# Why Everyone Is Suddenly Building Their Own Agent Harness and why you should care.
**作者**: Kartik
**日期**: 2026-05-02T17:41:19.000Z
**来源**: [https://x.com/code_kartik/status/2050631735529095575](https://x.com/code_kartik/status/2050631735529095575)
---

In February 2026, the LangChain team quietly published a result that should make every AI team rethink their roadmap. They took their open-source coding agent, deepagents-cli, from outside the Top 30 on Terminal-Bench 2.0 to the Top 5, a 13.7 point jump from 52.8% to 66.5%.
The underlying model never changed. It was GPT-5.2-Codex the entire time. They only changed the harness.
That single result captures the most important shift in applied AI right now: the model is no longer the product. The harness is.
What's an agent harness?
An agent harness is everything wrapping the LLM that turns it from a token generator into a working agent. The tool dispatch. The context management. The sandboxing. The planning loops. The sub-agent orchestration. The evals. The observability. The verification logic that decides when work is "done."
When Claude Code's source map briefly leaked in March, the codebase came in at roughly 513,000 lines of TypeScript. The actual model API call? A few lines. Everything else is the harness.
Mitchell Hashimoto, who coined the term in early 2026, defined it bluntly: anytime an agent makes a mistake, you engineer a solution so it never makes that mistake again. That fix lives in the harness.
Why models are commoditizing and harnesses aren't
Two things are happening at once.
Frontier models are converging. Tool use, long context, reasoning, structured output they all do these well now, and prices are collapsing. Cursor's Composer 2 is 10x cheaper than Opus 4.6 with comparable benchmarks. Andrej Karpathy publicly retired the term "vibe coding" in February and renamed the practice agentic engineering, because writing code stopped being the bottleneck.
Meanwhile, harnesses compound. Every failure becomes a permanent fix a lint rule, a hook, a sub-agent, a context pattern. That improvement applies to every future run with every future model. Model releases reset the playing field on raw intelligence. Harness investment doesn't.
The data backs this up everywhere you look. Stanford's IRIS Lab paired Claude Opus with an evolving harness and beat every hand-designed system on Terminal-Bench. Factory.ai's Droid hit state-of-the-art by beating the model labs at their own game same models, different harness. OpenAI's Frontier team shipped roughly a million lines of production code with three to seven engineers and zero hand-written code, with single agent runs working autonomously for six-plus hours. Their lead engineer's summary: "Humans steer. Agents execute." The hard problem became designing the environment, not writing the code.
Why off-the-shelf frameworks aren't enough
LangChain, CrewAI, AI SDK these are useful starting points, but every serious agent product has a custom harness sitting on top. Claude Code, Cursor, Devin, Sourcegraph Amp, Factory Droid, Replit Agent, Vercel v0, Hermes Agent, OpenClaw every one of them is opinionated, custom, and tuned to its specific domain.
The reasons are concrete. Context windows need careful management Cursor's team spends weeks tuning per-model behavior. Tools need to be designed for LLMs, not humans Replit found function calling hit ceilings around argument complexity and switched to a restricted Python DSL with a 90%+ valid call rate. Evals must be tied to your product, not generic benchmarks. Token costs matter at scale and frontier labs have a structural conflict here, because every harness optimization that uses fewer tokens hurts their unit economics.
And then there's lock-in. Building your harness on a single vendor's runtime is itself a vendor decision.
The architecture, briefly
A production harness has roughly seven planes: the agent loop (ReAct, plan-execute, generate-test-repair), the tool layer purpose-built for LLMs, context and memory management with progressive disclosure, sandboxed execution with permission gating, multi-agent coordination, evals and tracing, and prompt and model routing.
The pattern shared by every successful harness: trust the LLM at the reasoning layer, enforce strictly at the tool boundary.
So should you build one?
If you're prototyping, no. Use Claude Code or Cursor or Codex as-is and ship.
If you're moving to production in a single domain, customize via extension points AGENTS.md, hooks, MCP servers, sub-agent definitions. Build your eval suite before you write custom code.
Build your own when the math gets serious: when you see a sustained 15+ point gap between stock and custom on your evals, when per-task economics matter, when you need permissions and audit trails stock harnesses don't provide, or when your domain needs tools that just don't exist yet.
The bottom line
In 2025, every team was racing to build agents. In 2026, the teams winning are the ones investing in the scaffolding around them.
The model gives you intelligence. The harness gives you a product.
Build accordingly.
## 相关链接
- [Kartik](https://x.com/code_kartik)
- [@code_kartik](https://x.com/code_kartik)
- [5.7K](https://x.com/code_kartik/status/2050631735529095575/analytics)
- [Factory.ai](https://factory.ai/)
- [1:41 AM · May 3, 2026](https://x.com/code_kartik/status/2050631735529095575)
- [5,752 Views](https://x.com/code_kartik/status/2050631735529095575/analytics)
---
*导出时间: 2026/5/3 12:49:06*
---
## 中文翻译
# 为什么大家突然都在构建自己的 Agent Harness 以及为什么你应该关注
**作者**: Kartik
**日期**: 2026-05-02T17:41:19.000Z
**来源**: [https://x.com/code_kartik/status/2050631735529095575](https://x.com/code_kartik/status/2050631735529095575)
---

2026 年 2 月,LangChain 团队低调地发布了一项成果,这项成果应该让每一个 AI 团队重新审视他们的路线图。他们将其开源编码代理 deepagents-cli 在 Terminal-Bench 2.0 上的排名从 30 名之外提升到了前 5 名,从 52.8% 跃升至 66.5%,增长了 13.7 分。
底层模型从未改变。整个过程一直使用的都是 GPT-5.2-Codex。他们只改变了 Harness(约束框架)。
这单一的结果捕捉到了当下应用 AI 领域最重要的转变:模型不再是产品,Harness 才是。
什么是 Agent Harness?
Agent Harness 是包裹在大语言模型(LLM)之外的一切,它将模型从单纯的 Token 生成器转化为一个能干活的 Agent。包括工具调度、上下文管理、沙箱隔离、规划循环、子 Agent 编排、评估、可观测性,以及决定工作何时“完成”的验证逻辑。
当 3 月 Claude Code 的源码地图短暂泄露时,其代码库大约有 513,000 行 TypeScript。而实际的模型 API 调用呢?只有几行。其他所有的一切都是 Harness。
Mitchell Hashimoto 在 2026 年初创造了这个术语,他直截了当地定义道:每当 Agent 犯错时,你就要设计一个解决方案,让它永远不再犯那个错。这个修复就存在于 Harness 之中。
为什么模型正在商品化而 Harness 没有
两件事正在同时发生。
前沿模型正在趋同。工具使用、长上下文、推理、结构化输出——它们现在都能很好地处理这些,而且价格正在崩盘。Cursor 的 Composer 2 比 Opus 4.6 便宜 10 倍,但基准测试成绩相当。Andrey Karpathy 在 2 月公开宣布弃用“氛围式编程”一词,并将这一实践重命名为“代理工程”,因为写代码已不再是瓶颈。
与此同时,Harness 在复利增长。每一次失败都会变成一个永久的修复——一条 Lint 规则、一个钩子、一个子 Agent、一种上下文模式。这种改进适用于未来每一次运行以及每一个未来的模型。模型发布会重置原始智能领域的竞争环境,但 Harness 的投资不会。
无论你看向哪里,数据都支持这一点。斯坦福 IRIS 实验室将 Claude Opus 与一个不断演进的 Harness 配对,在 Terminal-Bench 上击败了所有手工设计的系统。Factory.ai 的 Droid 通过在模型实验室自己的游戏中击败它们,达到了最先进的水平——同样的模型,不同的 Harness。OpenAI 的 Frontier 团队仅用 3 到 7 名工程师就发布了大约 100 万行生产代码,且零手写代码,单个 Agent 运行可自主工作 6 小时以上。他们的首席工程师总结道:“人类掌舵,Agent 执行。”难题变成了设计环境,而不是编写代码。
为什么现成的框架还不够
LangChain、CrewAI、AI SDK——这些都是有用的起点,但每一个严肃的 Agent 产品都在上面构建了自定义的 Harness。Claude Code、Cursor、Devin、Sourcegraph Amp、Factory Droid、Replit Agent、Vercel v0、Hermes Agent、OpenClaw——它们每一个都有明确的观点、定制化,并针对其特定领域进行了调优。
原因很具体。上下文窗口需要精心管理——Cursor 的团队花费数周时间来调整针对每个模型的行为。工具需要为 LLM 设计,而不是为人类——Replit 发现函数调用在参数复杂性方面遇到了天花板,因此切换到受限的 Python DSL,实现了 90% 以上的有效调用率。评估必须与你的产品绑定,而不是通用基准。Token 成本在规模化时至关重要,而前沿实验室在这里存在结构性冲突,因为任何使用更少 Token 的 Harness 优化都会损害他们的单位经济模型。
然后还有锁定问题。在单一供应商的运行时上构建你的 Harness 本身就是一种供应商决策。
简要谈谈架构
一个生产级的 Harness 大致有七个层面:Agent 循环(ReAct、计划-执行、生成-测试-修复)、专为 LLM 构建的工具层、具有渐进式披露的上下文和内存管理、具有权限控制的沙箱执行、多 Agent 协调、评估和追踪,以及提示词和模型路由。
每一个成功的 Harness 共有的模式是:在推理层信任 LLM,在工具边界严格执行。
那么,你应该构建一个吗?
如果你是在做原型,不。直接使用 Claude Code、Cursor 或 Codex 的原样功能,专注于交付。
如果你要在单一领域进入生产环境,请通过扩展点进行定制——AGENTS.md、钩子、MCP 服务器、子 Agent 定义。在编写自定义代码之前先构建你的评估套件。
当数学计算变得严肃时,再构建你自己的系统:当你在评估中看到通用版和定制版之间存在持续的 15 分以上的差距时;当单任务的经济性至关重要时;当你需要通用 Harness 不提供的权限和审计跟踪时;或者当你的领域需要尚不存在的工具时。
总结
在 2025 年,每个团队都在竞相构建 Agent。在 2026 年,获胜的团队是那些投资于围绕 Agent 的脚手架的团队。
模型赋予你智能。Harness 赋予你产品。
据此构建。