JA EN
LearnAgents
·★ MEMBER·PAPER·13 min read

Paper Explained: JIT-Agent — A Model That Writes the Agent Harness On Demand

An agent's capability is not the model's alone. This is a ground-up walkthrough of JIT-Agent, a model trained to synthesize the four-module harness — memory, planning, action, tools — freshly for each task.

ModalitytextTaskagents

JIT-Agent: Scaling Harness Intelligence via Just-in-Time Harness Evolution

Primary source — what this article is built on

undefined2026-08-26undefined2026-08-30same month

JIT-Agent: Scaling Harness Intelligence via Just-in-Time Harness EvolutionGuibin Zhang, Leo Lu, Fangzhou Xie et al. · 2026-08-26 · v1arXiv:2608.25593Paper page·PDF
undefined

Agent capability is not determined by the model alone. The agent harness, encompassing memory management, planning strategy, action protocol, and tool/skill orchestration, can dominate the contribution of the underlying foundation model. Yet harness design remains manual, task-specific, and fundamentally unscalable. We present JIT-Agent, a harness intelligence model trained to synthesize task-adaptive agent harnesses on the fly for arbitrary off-the-shelf agentic LLMs. We formalize the agent harness as a composable, machine-generatable artifact governed by a fixed four-module protocol, and train JIT-Agent to customize harnesses for a given task at hand, repair harnesses for stable and reliable execution, and self-evolve by distilling performance signals from an expanding archive of prior harness configurations. Equipped with JIT-Agent as a harness helper, DeepSeek-V4-Flash surpasses GPT-5.6 on DeepSearchQA (+9.1) and OdysseyBench (+4.3), while the already strong GLM-5.2 gains up to +20.2 points. Across controlled evaluations, JIT-Agent-generated harnesses are performance-competitive with mature agent runtimes such as OpenCode and Claude Code and consistently improve multi-scale model families of DeepSeek V4, Mimo-V2.5, and Qwen3.6. To our knowledge, JIT-Agent is the first model purpose-built for just-in-time harness generation, establishing harness intelligence as a trainable, transferable, and compounding dimension of agent capability orthogonal to model scaling.


The same cook, a different kitchen

Hire a brilliant cook. Is the quality of the food determined by their skill alone? Where the knives live, what is left in the fridge, how order tickets arrive, who does the washing up — if the kitchen is badly laid out, even a brilliant cook is slow and sloppy.

LLM agents work the same way. A foundation model like GPT or GLM is the cook, but around it there is always a harness: the machinery that decides what of the conversation history is kept and what is thrown away, how the next step is recorded, which tools and skills are exposed at this exact moment, how actions are executed, and what happens when one fails. What products like Claude Code and Codex actually are is not the model — it is this surrounding machinery.

The paper's framing is that agent capability "is not a property of model weights alone, but of the model–harness pair" (§1). A strong model fails behind the wrong memory, planner, or action protocol; a strong harness only unlocks capability when the model can understand and follow it. The dependency runs both ways.

Which leaves a problem. Harness design today is manual, task-specific, and fundamentally unscalable. JIT-Agent (arXiv:2608.25593) is an attempt to hand the job of writing the harness to a machine.

Cutting a harness into four parts

The first move is to stop treating a harness as free-form code and push it into a fixed template. The paper assumes every harness can be written as a tuple of four modules (§3.1).

h=(M, P, A, F)\mathbf{h}=(\mathbf{M},\ \mathbf{P},\ \mathbf{A},\ \mathbf{F})
(1)

In plain terms: a harness h\mathbf{h} is a bundle of four parts. M\mathbf{M} is memory, P\mathbf{P} is planning, A\mathbf{A} is action, and F\mathbf{F} is capability orchestration — deciding which tools get handed over. At runtime their dependency order is fixed as MPFA\mathbf{M}\rightarrow\mathbf{P}\rightarrow\mathbf{F}\rightarrow\mathbf{A} (§3.1).

One step of execution is defined by four lines:

vt=M(ξ<t),dt=P(τ,st,vt)\mathbf{v}_t=\mathbf{M}(\boldsymbol{\xi}_{<t}),\quad \mathbf{d}_t=\mathbf{P}(\boldsymbol{\tau},\mathbf{s}_t,\mathbf{v}_t)
(2)

Ct=F(Cτ,st,vt,dt),(st+1,et)=A(st,τ,vt,dt,Ct)\mathcal{C}_t=\mathbf{F}(\mathcal{C}_{\tau},\mathbf{s}_t,\mathbf{v}_t,\mathbf{d}_t),\quad (\mathbf{s}_{t+1},e_t)=\mathbf{A}(\mathbf{s}_t,\boldsymbol{\tau},\mathbf{v}_t,\mathbf{d}_t,\mathcal{C}_t)

Read left to right. ξ<t\boldsymbol{\xi}_{<t} is the complete record of everything that has happened; memory turns it into the view worth looking at right now, vt\mathbf{v}_t (history → view). Planning takes the task τ\boldsymbol{\tau}, the internal state st\mathbf{s}_t, and that view, and produces one local directive dt\mathbf{d}_t (view → directive). Capability orchestration then picks Ct\mathcal{C}_t, the subset of tools to expose this turn, out of everything available Cτ\mathcal{C}_{\tau}. Finally the action module updates the state and emits ete_t — either a tool call or a terminal answer.

What makes this factorization useful is that existing agent designs turn out to be different ways of filling the same four slots. The paper's own examples (§3.1):

So the "schools of thought" in agent design largely reduce to which option you pick in each of four slots. And once four slots have independent choices, the number of combinations multiplies. Exhausting them by hand stops being realistic.

FIG 1As independent choices stack up, the combination count multiplies. A feel for why "just try every configuration by hand" stops working — an illustration of the design space, not a measurement from the paper

Cooked ahead (AOT) or cooked to order (JIT)

Automatic harness improvement is not new. The paper groups most prior work as Ahead-of-Time (AOT) (§1, §2): accumulate execution traces, optimize harness code, prompts, tools or control policy from them, and grow a single durable artifact in the hope it generalizes. That is powerful when the deployment distribution is stable, but it asks the optimizer to precompile a broadly useful harness before seeing the structure of the next problem (§1).

JIT-Agent takes the Just-in-Time position instead. The observation behind it is simple: different tasks want structurally different harnesses (§1).

And the right harness is not merely domain-dependent but instance-dependent. If that is true, generating one on the spot beats fitting one artifact to everything. That is the Model-as-a-Harness formulation: a trained meta-agent generates a task-specific harness, and an arbitrary off-the-shelf agentic LLM executes under it (§1).

Thirteen seeds — HarnessFactory

To generate, you first need exemplars. Under a shared protocol Π\boldsymbol{\Pi} and a common execution kernel, the authors re-implemented 13 representative contemporary scaffolds: ReAct, Plan-and-Execute, ReSum, Flash-Searcher, GAM, MemoBrain, AggAgent, OAgent, AgentFold, HiAgent, DeepAgent, ROMA, and AOrchestra (§3.2). That collection is the seed bank B0\mathcal{B}_0 with K0=13K_0=13.

Forcing them onto one interface does two jobs. It tests whether the four-module space is expressive enough to cover the existing landscape, and it supplies reference material for the generator. As the system runs, the bank grows into BnB0\mathcal{B}_n \supseteq \mathcal{B}_0, each entry tagged with its task and the observed reward, latency, and cost.

Training harness intelligence in three stages

The paper splits the required ability into three (§1): ❶ adaptivity — matching the generated harness to the task; ❷ reliability — being executable at all, and recovering when synthesis fails; ❸ evolvability — turning execution feedback into stronger future harnesses. Together these define harness intelligence, acquired through a three-stage pipeline (§4).

Stage I: imitate a teacher, then prefer the cheaper win

A stronger frozen teacher qϕq_\phi receives the task, the protocol, the capability registry, and three reference scaffolds sampled from the seed bank, and writes a task-adapted harness. Only generations that pass protocol validation and execution checks are kept as supervised data (§4.1).

But protocol compliance is a floor, not a goal. Two executable harnesses can differ enormously in reward, latency, and cost. So candidates are compared under the same backbone and the same evaluation seeds, and a preference pair is recorded only when (§4.1):

r+>r  +  κ+κr^+>r^-\ \land\ \ell^+\le\ell^-\ \land\ \kappa^+\le\kappa^-

Spelled out: reward rr must go strictly up, while latency \ell and cost κ\kappa must both not get worse — and at least one of the two efficiency terms must strictly improve. "Accuracy went up but it costs twice as much" never enters the preference data in the first place.

Generations that fail validation would normally be discarded. JIT-Agent turns them into repair supervision instead (§4.2). A failed harness is paired with its diagnostic report — compiler errors, interface mismatches, tool-call failures, runtime exceptions — the teacher proposes a structured patch , `Apply` determinist

What's behind this

§

Members-only from here

371 walkthroughs, 26 textbook chapters, 48 student units and 6 close readings — all included for $4.99/mo, with three new explainers every day. Cancel any time; access runs to the end of the period.

Already a member? Sign in to keep reading

References

  1. Guibin Zhang, Leo Lu, Fangzhou Xie, Kang Zhu et al.. (2026-08-26) JIT-Agent: Scaling Harness Intelligence via Just-in-Time Harness Evolution. arXiv:2608.25593Paper page·PDF

This article is written from the source paper above. Where they differ, the original is authoritative.

Comments

Sign in to comment