Summary

A comprehensive breakdown of the “agent harness” concept — the complete software infrastructure wrapping an LLM (orchestration loop, tools, memory, context management, state persistence, guardrails). The article synthesizes patterns from Anthropic, OpenAI, LangChain, LangGraph, CrewAI, and AutoGen into 12 universal harness components and 7 architectural decisions every harness designer faces. Central claim: changing only the harness (not the model) can shift benchmark rank by 20+ positions.

這篇文章系統性地解構「agent harness」的概念,亦即包覆 LLM 的完整基礎設施。文章綜合了 Anthropic Claude Code、OpenAI Agents SDK、LangChain、LangGraph 等主流框架的設計選擇,整理出 12 個生產 harness 核心元件,以及每個 harness 設計師都必須面對的 7 項架構決策。核心論點:同樣的模型,只改 harness 就能讓 benchmark 排名移動 20 名以上。

Key Points

  • Agent harness = 除模型以外的所有基礎設施(「If you’re not the model, you’re the harness」)
  • 三層工程:prompt engineering → context engineering → harness engineering(包含前兩者)
  • 12 個核心元件:Orchestration Loop、Tools、Memory、Context Management、Prompt Construction、Output Parsing、State Management、Error Handling、Guardrails、Verification Loops、Subagent Orchestration、(隱含的生命週期管理)
  • Context rot 問題:關鍵內容落在視窗中段時性能下降 30%+(Stanford “Lost in the Middle”)
  • LLMCompiler 的 plan-and-execute 比 sequential ReAct 快 3.6x
  • ACON 研究:優先保留 reasoning trace 而非 raw tool output,26-54% token 減少同時維持 95%+ 準確率
  • 工具越少越好:v0 移除 80% 工具後結果更好;Claude Code 用 lazy loading 達到 95% context 減少
  • Scaffolding 比喻:模型越強,harness 應該越薄(Anthropic 不斷從 Claude Code 刪除規劃步驟)
  • Claude Code 的 Ralph Loop:Initializer Agent 設定環境 + 每次新 session 的 Coding Agent 讀 git log 定向

Insights

最值得記錄的洞見是「co-evolution principle」:模型現在是帶著特定 harness 在 post-training 的,改變工具實作方式可能降低性能,因為模型已學會特定的工具介面。這解釋了為何 Anthropic 不輕易改 Claude Code 的工具 schema。另一個洞見是 harness 厚度的政治:Anthropic 押注 thin harness + model improvement,LangGraph 等圖形框架押注 explicit control flow——兩者分歧背後是對模型能力發展曲線的不同預測。文章整理的「10-step process with 99% per-step success = 90.4% end-to-end success」是一個好用的框架,說明為何 error handling 在長 chain 任務中如此關鍵。

Connections

Raw Excerpt

LangChain proved this when they changed only the infrastructure wrapping their LLM (same model, same weights) and jumped from outside the top 30 to rank 5 on TerminalBench 2.0.