This post by Vivek Trivedy on LangChain’s blog is a report on applying
Harness Engineering to LangChain’s own coding agent, deepagents-cli, which the post links to within the
Deep Agents repository. Its headline is that the agent went from just outside the Top 30 to
the Top 5 on Terminal Bench 2.0 (Terminal-Bench) while the model, gpt-5.2-codex, was held
fixed and only the harness changed — a gain of 13.7 points, from 52.8 to 66.5.
The post frames a harness as the system built around a model to mold its “inherently spiky intelligence” toward the tasks one cares about, optimizing for goals such as task performance, token efficiency and latency. Of the many knobs a harness offers, the team deliberately restricted itself to three — the system prompt, tools, and middleware, LangChain’s term for hooks around model and tool calls — and used traces of the agent’s runs to decide what to change.
Key Points
- The experiments ran on Terminal Bench 2.0, which the post describes as a now-standard benchmark for agentic coding with 89 tasks across domains such as machine learning, debugging and biology; runs were orchestrated with Harbor in Daytona sandboxes, and every agent action was stored in LangSmith.
- Trace analysis was made repeatable by packaging it as an Agent Skill: fetch experiment traces, spawn parallel error-analysis agents whose findings a main agent synthesizes, then make targeted harness changes. The post likens this to boosting, and says a human can help — though is not required — in checking proposed changes, since changes that overfit to one task can cause regressions elsewhere.
- The most common failure it reports was an agent that wrote a solution, re-read its own code, judged it
fine and stopped without testing. Its remedy was system-prompt guidance for a plan, build, verify and
fix cycle (see Verification loop), plus a
PreCompletionChecklistMiddlewarethat intercepts the agent before it exits and reminds it to verify against the task specification — which the post compares to the Ralph Loop. - A
LocalContextMiddlewaremaps the working directory and its parents and children and finds tools such as Python installations when the agent starts; the post argues that injecting this context reduces the error surface of context discovery and search, and calls this onboarding the agent into its environment. - The team also prompted the agent to write code that programmatic tests will measure, and injected time-budget warnings to nudge it toward finishing and verifying, on the grounds that agents are bad at estimating time.
- A
LoopDetectionMiddlewaretracks per-file edit counts and, after a set number of edits to the same file, suggests reconsidering the approach, against Doom Loops. The post calls this a heuristic engineered around today’s perceived model issues, likely to become unnecessary as models improve. - On reasoning compute, it reports that running only at the highest reasoning setting (
xhigh) scored 53.9% because of agent timeouts, against 63.6% athigh, and adopted a Reasoning Sandwich —xhighfor planning,highfor implementation,xhighfor verification — as its baseline. - Its practical takeaways are to do Context engineering on the agent’s behalf, push agents to self-verify, use traces as a feedback signal, detect and fix bad patterns in the short term, and tailor harnesses to models. On the last point it reports that an earlier harness version run with Claude Opus 4.6 scored 59.6%, which it attributes to not having run the same improvement loop with Claude.
Context
The post is LangChain reporting results for its own open-source agent on a public benchmark; the figures are the team’s own measurements and the harness heuristics are presented as findings from its experiments rather than as general rules. It closes by naming open research directions — multi-model systems, memory primitives for continual learning, and measuring harness changes across models — and says the team published a dataset of its traces.