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.
JIT-Agent: Scaling Harness Intelligence via Just-in-Time Harness Evolution
Primary source — what this article is built on
undefined2026-08-26→undefined2026-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·PDFundefined
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).
In plain terms: a harness is a bundle of four parts. is memory, is planning, is action, and is capability orchestration — deciding which tools get handed over. At runtime their dependency order is fixed as (§3.1).
One step of execution is defined by four lines:
Read left to right. is the complete record of everything that has happened; memory turns it into the view worth looking at right now, (history → view). Planning takes the task , the internal state , and that view, and produces one local directive (view → directive). Capability orchestration then picks , the subset of tools to expose this turn, out of everything available . Finally the action module updates the state and emits — 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):
- Plain ReAct is — keep the whole history, no explicit planner, expose every tool.
- Production runtimes like Codex and OpenCode are — the loop is still ReAct, but history is compressed near the context limit and an explicit todo list is maintained.
- Recursive systems such as ROMA are — spawn subagents, isolate their contexts, route different tools to each.
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.
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).
- Wide-search tasks benefit from parallel evidence exploration.
- Terminal tasks favour a lean serial ReAct loop.
- Deep research needs working memory over retrieved evidence.
- Repo-scale coding is naturally mediated by a filesystem holding patches, tests, traces, and repo state.
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 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 with .
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 , 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 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):
Spelled out: reward must go strictly up, while latency and cost 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.
Comments
Sign in to comment