LangChain: Tuning the Harness, Not the Model — Nemotron 3 Ultra Closes In on Opus 4.8 at About 1/10 the Cost, Proving Enterprises Don't Need to Pay Top Dollar for Closed APIs

Three levers: system prompt, tool descriptions, middleware. On the Deep Agents suite, typical scores go ~0.80→0.84, with a best run of 0.86 versus Opus's 0.87.
By LangChain Blog07-09 · 9 min read⚑ Research paper
🎧 Listen to the podcast0:00 / --:--
0:00 / --:--
Research Explainer · XiaoHu Explains
Five Sentences
  • LangChain froze the Nemotron 3 Ultra weights and only changed the harness (system prompt, tool descriptions, middleware) — no model changes, no touching temperature or other generation parameters.
  • The method is an eval-driven loop: evaluate → read failure traces → cluster behaviors → change one part of the harness → re-evaluate; screen cheap on a small sample first, then run the full suite.
  • Prompts use short, single-purpose instruction blocks; middleware handles enforcement plus injecting signals right at the failure point.
  • Key mechanism: the same rule written in a tool description does nothing, but stuffed into the tool's return result it works; injecting mid-conversation is more reliable than a standing system-prompt rule.
  • Typical run ~0.80→0.84, best run 0.86 versus Opus 4.8's best of 0.87; the full suite costs about $4.48 vs $43.48, with median latency around 10 seconds per question on both sides.
⚑ Stance note: this piece is a methodology case study from LangChain's official blog. The data comes from its internal Deep Agents evals and its own trace analysis — this is not a third-party reproduction.
1WHAT

What They Did

LangChain published a harness-tuning playbook for Nemotron 3 Ultra: leave the model untouched, change only the scaffolding around it, and see how high an open model can be lifted on agent tasks.

In one line: same open model, a better-fitting shell — the best run closes in on Claude Opus 4.8, at roughly an order of magnitude lower cost for the full eval suite.

◆

Why this matters: same weights, different scaffolding, and the score gap can be sizable. LangChain previously took gpt-5.2-codex from 52.8 to 66.5 on Terminal-Bench 2.0 without touching the model. This time they apply the same idea to an open model, with a cost comparison against Opus.

AGENT = MODEL + HARNESS HARNESS · WHAT GOT TUNED System Prompt Tool Descriptions Middleware Model Core Nemotron 3 Ultra Weights frozen · same model · same temp / top-p
Architecture: an agent isn't a bare model. The harness wraps the core (the model). This time LangChain only turned three screws on the shell — system prompt, tool descriptions, middleware — leaving the core weights untouched.

Generation parameters stayed at the vendor's recommended defaults. The gains in this piece didn't come from cranking temperature and hoping for the best.

Diagram of the model-harness relationship
Official figure: the model sits inside, the harness wraps around it. When they fit, capability goes into the task; when they don't, capability goes into fighting the scaffolding. Source: LangChain Blog
Related Explainer
The key to AI self-improvement is hiding in the shell around the model called the harness
Lilian Weng's long-form piece on harness engineering; this article is LangChain's hands-on playbook applied to an open model.
2MISMATCH

When the Shell Doesn't Fit, Where Does the Horsepower Go

Open models can already carry real agent workloads at a fraction of the cost of frontier APIs. But even a capable model, dropped into a harness that wasn't built for it, will misfire.

An Analogy

The model is the engine; the harness is the chassis and gearing. However good the engine, if the gearing and transmission don't match, horsepower gets wasted spinning and slipping. Tuning the harness means adjusting the gearing and transmission — not swapping the engine.

Good Fit · Capability Into the Task Model Read files · call tools · deliver Most tokens doing real work Bad Fit · Capability Spinning Model Re-asking · quitting early · looping Tokens fighting the scaffolding
Same engine — whether the shell fits decides if horsepower goes into the task or leaks away as idling. Left: a full progress bar. Right: a broken, idling bar.

They picked Nemotron 3 Ultra because NVIDIA's post-training already made it stable across a variety of agent harnesses, not just tuned for single-turn chat. The no-profile baseline sits around 0.80 — the floor is already decent, which is what makes the shell worth building on.

3LOOP

Tuning Runs on a Loop, Not Guesswork

Without eval signal, you're just guessing. An agent's input space is large and there are many acceptable outputs — fixing A can break B. So the workflow is a closed loop, with LangSmith traces as the source of truth.

1 Eval Run suite 2 Observe Read traces 3 Diagnose Cluster failures 4 Tune Shell One change 5 Re-eval Pass → full suite Loop back Keep only: holds up across repeated trials · doesn't hurt other categories Cost Ladder Cheap small-sample screen → full Deep Agents suite Verify cheap first, spend the full budget later
The loop: evals give signal, traces show which step failed, failures get clustered into one behavior, then one part of the shell gets changed — only after passing the screen does the full budget get spent. A single "looks better" run doesn't count.
Harness-tuning loop diagram
Official figure: the agent development lifecycle built around harness tuning. Source: LangChain Blog
Fix behavior classes, not single questions

What gets clustered is a failure pattern (e.g., "answers halfway through reading a file"), not the wording of one specific question. Changes that boost a score by gaming one question's phrasing get thrown out.

Cheap before expensive

Candidates first pass a representative small sample; only then do they run on the full suite. The screening sample has to cover different behavior types, or tasks the screen never touched can regress across the board.

4PROMPTS

Prompts: Don't Rewrite the Whole Page — Write One Small Block Against a Failure

The system prompt is the cheapest lever, and the easiest to overrate. Sweeping rewrites and "be a better agent" instructions often get diluted, because a capable model's real failure points are usually not about wording.

Sweeping Rewrite Into context · easily diluted Single-Purpose Block Fixes one failure behavior Written against a trace · testable
Left: a page of principles piled on, signal gets thin. Right: seeing in a trace that "the tool succeeded but the result wasn't reported," they write only that one instruction.
Copy-Ready Example

When a task finishes but doesn't report the concrete result, add only this block — nothing else:

final_answer_completeness (copy verbatim)
<final_answer_completeness>
After tool calls succeed, the final answer must report the concrete result, not just that the task is done. Include the key entity, action, identifier, title, recipient, service, status, or value that answers the user's request. If the user asked multiple questions, answer each one from its matching tool output.
</final_answer_completeness>
5HERO

Same Sentence, Different Placement, Opposite Outcome

This is the single most important mechanism in the whole piece. They wanted one rule: when a file read returns exactly a full page, assume there's more and keep reading.

Write that sentence into the read_file tool description, and the model stops after page one. Move it, word for word, next to the tool's return result, and the model starts reading on.

Not About Wording · About Where Attention Lands

What the model is actually processing is "the chunk of content right in front of it." The farther a rule sits from that chunk, the more it's as if it were never written; only sitting right next to that chunk does it actually get read.

Approach A · Rule in Tool Description System prompt (far away) Tool description: keep reading if full Rule sits far away Tool return · page 1 Attention mostly lands here Result: answers after one page Rule too far from the data Approach B · Rule Next to the Return System prompt Tool description (ordinary) Full page · keep reading Page 1 body Sweeps over rule + data Result: keeps paging The question shifts from "what to write" to "where the model is actually looking"
The core mechanism: on the left, the rule hangs in the tool's manual while the scan beam lands on the return body — the manual is already outside attention. On the right, the same text sits atop the return block, so the scan beam sweeps over both the rule and the data.

What Middleware Actually Does: Two Kinds of Hooks

Some behaviors have to happen every single time — prompting alone isn't enough. Middleware wraps around model calls and tool calls:

User task MIDDLEWARE Enforcement Caps · retries Inject Signal Main lever here Model Call Tool / Answer
Enforcement: loop caps, one-shot retries. Injecting signal: putting the right information right in front of the model at the exact moment it starts drifting. The latter is the main lever in this case.

Mid-Conversation Injection: More Reliable Than the System Prompt

Nemotron listens better to "a message that shows up exactly when needed" than to a standing rule baked into the system prompt. So middleware injects at two points, timed to that rhythm:

1 MIDDLEWARE INJECTS Plan first, then act. Don't call tools directly. 2 AGENT Writes a plan: which files to read, which tools… 3 MIDDLEWARE'S SECOND SHOT Review the plan before executing, check gaps first. 4 AGENT Checks plan → then executes (trace shows it landing)
Timeline: orange blocks are messages middleware injects into the conversation on the fly; white blocks are the model's responses. The same content written at the top of the system prompt tends to get diluted — it only works when it shows up at the exact moment it's needed.
6FILTER

What Survives, What Gets Cut

Most of what gets tried doesn't survive. A tuning loop that only reports its wins is usually already overfitting.

A pile of "seems reasonable" changes Behavior-class fixes Cut Dead-weight changes Score-gaming phrases Keep: fires on real conditions · not tied to one question's wording
The funnel: a good lever fires on a real condition (e.g., any file read that comes back full). Changes that boost a score by riding one question's phrasing please the number but teach nothing about how to build the next agent — cut.
7RESULTS

How the Numbers Move After Tuning

A single overall score only tells you better or worse. They scored by category, matching what agents actually do: files, tools, retrieval, multi-turn conversation, long-context summarization.

0.80
No-profile baseline (typical)
0.84
Typical score after harness tuning
0.86
Nemotron's best run
0.87
Opus 4.8's best (typical ~0.86)
Nemotron, no profile
~0.80
Nemotron, tuned (typical)
~0.84
Nemotron, best
0.86
Opus 4.8, best
0.87
Category-by-category comparison chart
Official category chart: summarization had the most room and nearly maxes out after tuning; tool use rises noticeably; retrieval and files were already strong and rise further; conversation barely moves. Source: LangChain Blog
Category lift illustration (bar heights relative, not exact scale) Largest Summarization Tools Retrieval / Files Flat Conversation Flat conversation = out of harness's reach → points to the weights layer
Reading the chart: summarization was the messiest to begin with (no compression guidance), so it gained the most once the shell filled that gap. Conversation barely moves, which shows long-horizon state issues sit outside what the scaffolding can turn.
Summarization / Compression↑ Largest

With no profile, there was no compression guidance: content that should be compressed wasn't, or the model answered off the summary alone without reading the offloaded history file. Adding explicit guidance pushed it nearly to the max.

Tool Use↑ Notable

Many tool failures come down to how tools are described, how retries work, how to close things out — not just the model "not knowing how to use tools."

Retrieval · Files↑ Further lift

Already strong out of the box (a post-training artifact); a small shell tweak still squeezes out a bit more.

Multi-turn ConversationFlat · barely moves

Problems around maintaining long-horizon backend state barely budge. They didn't twist the profile to game the score here.

$4.48
Tuned open model, full suite, approx.
$43.48
Opus, same suite, approx. (~10×)
3–10×
Depending on precision and prompt caching
~10s
Median latency, on par with Opus
Cost-versus-quality comparison chart
Official comparison: when quality nears the frontier's best run, the full suite's cost comes in roughly an order of magnitude lower. Source: LangChain Blog
8CEILING

Where Tuning the Shell Stops Working

Harness tuning has a ceiling. Knowing the boundary matters as much as knowing the payoff.

Scaffolding Layer · Within Harness's Reach Prompts · tool descriptions · retries / loops Most of what makes production agents unreliable lives here Weights Layer · No Hook Helps Long-horizon state · unmoved either way Signal: next move is post-training, not another hook
The layers: anything that improves when you change the prompt, tools, or middleware is still in the scaffolding layer. Anything that stays flat no matter what's tried around it is in the weights layer. The flat line on conversation in this case is exactly that second kind of signal.

A second line gets drawn inside the harness itself: what belongs in the "core shared by every agent," and what's just "one model's profile."

Core Harness · Usable by Every Agent Example: full-page read → keep reading (any model) Model Profile · Serves Only This One Example: in-conversation injection for Nemotron, not a standing rule
Push changes toward the core wherever possible: once the model and the eval questions are out of date, the core layer is still earning its keep. A profile is the gearing tuned for this one engine — don't mistake it for universal truth.

The question worth asking again and again on any project: can this change honestly be pushed a little closer to "core"?

When a failure doesn't respond to anything you change around the model, that's the signal it lives in the weights, and the fix is post-training, not another hook. LangChain · Tuning the harness, not the model
Source: LangChain Blog, "Tuning the harness, not the model: a Nemotron 3 Ultra playbook" (2026-07-08). Data is the article's internal Deep Agents eval and cost figures. Further reading: Improving Deep Agents with harness engineering; Better Harness; Tuning Deep Agents to different models. This is a locally refined, illustrated version, not yet deployed.
Source
LangChain BlogLangChain Blog·Read the source
↑ End of article
✓ This article is free to read in full

Members can copy or download the full Markdown, and let their AI subscribe and ask.

Read the original ↗
📮 New explainers, straight to your inbox

Found this useful? Leave your email — every new explainer, the moment it's out. Unsubscribe anytime.