JIT-Agent: Scaling Harness Intelligence via Just-in-Time Harness Evolution
An AI system that writes a custom 'operating scaffold' for other AI agents on the spot, for every new task
How well an AI agent performs depends less on the language model itself and more on the 'harness' wrapped around it - the rules for memory, planning, tool use, and action. JIT-Agent is a 27B-parameter model trained to generate, repair, and evolve this harness on the fly for any off-the-shelf agentic LLM, instead of relying on hand-built, task-specific scaffolds. With JIT-Agent's generated harness, DeepSeek-V4-Flash surpasses GPT-5.6 on several benchmarks, and an already strong model, GLM-5.2, gains up to 20.2 points.
METAL LAB explanatory visual
JIT-Agent's three-stage training and inference flow
Evidence statusMeasured results reported
- Four-module harness protocolHarnesses are standardized into Memory, Planning, Action, and Capability orchestration modules; HarnessFactory reimplements 13 representative existing scaffolds as a seed bank.
- Stage I: customization learningThe model imitates a stronger teacher's task-adapted harness examples and learns to prefer harnesses that are both more effective and more efficient.
- Stage II: repair learningWhen a generated harness fails to run, the model learns from compiler errors, interface mismatches, and runtime exceptions to fix it within at most two repair rounds.
- Stage III: Evo-GDPO online evolutionNew candidate harnesses are compared against the current best archive entry on reward, latency, and cost; only frontier-improving designs are kept, via reinforcement learning.
- DeploymentGiven a new task, the trained JIT-Agent generates a custom harness on the spot to wrap any off-the-shelf LLM, and keeps updating it from execution feedback.
What they did
- Problem: agent performance is jointly determined by the model and its 'harness' (memory management, planning strategy, action protocol, tool orchestration), but harnesses have so far been designed manually and separately for each task, which does not scale.
- Proposal: JIT-Agent formalizes a harness as four modules - Memory, Planning, Action, and Capability orchestration - under one fixed protocol, and is trained to generate a task-specific harness as executable code just-in-time, whenever a new task arrives.
- Training method: a three-stage pipeline. Stage I imitates a stronger teacher model's task-adapted harness examples; Stage II learns to repair harnesses that fail to run by reading diagnostic error reports; Stage III (Evo-GDPO) trains the model online to propose harnesses that beat prior designs in reward, latency, and cost.
- Measured results: DeepSeek-V4-Flash with a JIT-Agent-generated harness beats GPT-5.6 by +9.1 on DeepSearchQA, +8.7 on PinchBench, and +4.3 on OdysseyBench; GLM-5.2 gains +12.0 on xBench-DS and +6.9 on AgentIF, with gains up to +20.2 points overall. JIT-Agent-generated harnesses are also reported to be performance-competitive with mature runtimes like OpenCode and Claude Code, and consistently improve differently-sized models within the DeepSeek V4, Mimo-V2.5, and Qwen3.6 families.
- Infrastructure: the authors built HarnessFactory, a codebase reimplementing 13 representative existing agent scaffolds (e.g., ReAct, ROMA) under the shared protocol, used as source material and reference bank for JIT-Agent.


| Method | Construction | Instance synthesis | Harness model | Learned repair | Online evolution |
|---|---|---|---|---|---|
| AutoHarness (Lou et al., 2026) | AOT (search) | \xmark | \xmark | \xmark | \xmark |
| Meta-Harness (Lee et al., 2026c) | AOT (search) | \xmark | \xmark | \xmark | \xmark |
| AHE (Lin et al., 2026) | AOT (search) | \xmark | \xmark | \xmark | \xmark |
| Adaptive AH (Liu et al., 2026c) | AOT (test-time editing) | \xmark | \xmark | \xmark | \cmark |
| TTHE (Nie et al., 2026b) | AOT (test-time editing) | \xmark | \xmark | \xmark | \cmark |
| RHI (Lee et al., 2026a) | AOT (test-time editing) | \xmark | \xmark | \xmark | \cmark |
| Harness-R1 (Shao et al., 2026) | AOT (test-time editing) | \xmark | \cmark | \cmark | \cmark |
| JIT-Agent (ours) | JIT | \cmark | \cmark | \cmark | \cmark |


| ♣ Memory | ♠ Planning | ♥ Action | ♠ Capability Orchestration | |
|---|---|---|---|---|
| Harness | 𝐌∈𝔐 | 𝐏∈𝔓 | 𝐀∈𝔄 | 𝐅∈𝔉 |
| ReAct [83] | FullHistory | No explicit planner | ReAct | Full registry |
| Plan-and-Execute [16] | FullHistory | Linear roadmap | ReAct | Full registry |
| ReSum [77] | ReSum memory | No explicit planner | ReAct | Full registry |
| Flash-Searcher [60] | FullHistory | DAG planning | ReAct | Full registry |
| GAM [79] | GAM retrieval | DAG | ReAct | Full registry |
| MemoBrain [59] | Reasoning graph | No explicit planner | Marker-guided execution | Full registry |
| AggAgent [32] | Isolated rollout histories | No explicit planner | Multi-rollout aggregation | Full registry |
| OAgent [100] | Coordinator history | No explicit planner | Ensemble voting | Full registry |
| AgentFold [84] | AgentFold memory | DAG | ReActFold | Full registry |
| HiAgent [22] | Hierarchical memory | No explicit planner | ReAct | Full registry |
| DeepAgent [34] | Three-tier memory | No explicit planner | Marker-guided execution | Tool search |
| ROMA [1] | Context isolation | Atomizer + DAG | Recursive execution | Full registry |
| AOrchestra [63] | Context isolation | Atomizer + DAG | Recursive execution | Agent Delegation |

Findings
- DeepSeek-V4-Flash with a JIT-Agent harness outperformed GPT-5.6 by +9.1 on DeepSearchQA, +8.7 on PinchBench, and +4.3 on OdysseyBench.
- On the already strong GLM-5.2, JIT-Agent produced up to +20.2 absolute points of gain, including +12.0 on xBench-DS and +6.9 on AgentIF.
- JIT-Agent-generated harnesses were reported as performance-competitive with mature agent runtimes such as OpenCode and Claude Code.
- Across differently-scaled model families (DeepSeek V4, Mimo-V2.5, Qwen3.6), JIT-generated harnesses consistently improved over a fixed ReAct baseline harness, and moved backbone-harness pairs toward better cost-performance frontiers on benchmarks like DeepSearchQA and AgentIF.


Where it can be used
- Attaching an automatically generated, task-tailored harness to an existing off-the-shelf LLM (open or commercial) instead of manually building a separate scaffold for each new type of task, such as deep research, shopping planning, travel planning, or office document work.
- Automating harness construction in pipelines that must handle many different task types with one backbone model, without hand-engineering a new scaffold each time.
- Using automatic diagnostic-driven repair of failed harness generations as a reference pattern for building more reliable agentic automation systems.


Limits and open work
- Reported numbers are measured on specific benchmarks (DeepSearchQA, OdysseyBench, PinchBench, xBench-DS, AgentIF) with specific model backbones (e.g., DeepSeek-V4-Flash, GLM-5.2), and generalization to other tasks or models is not established.
- Some benchmark comparisons use subsets of only 50 or 100 examples, so absolute gains may differ on the full benchmark distributions.
- Comparisons to OpenCode and Claude Code are described only as 'performance-competitive,' not as consistently exceeding them.
- The authors themselves note this work explores a deliberately radical form where the entire harness can be redesigned just-in-time, and suggest future production systems may instead keep a stable core with selective component replacement - a direction the paper does not test.


Why it matters
Rather than only scaling up the underlying model, this work shows that the scaffold surrounding a model can be treated as a separately trainable and improvable source of capability, offering gains that don't require touching model weights at all. For practitioners, it points to a way of boosting task performance and cost-efficiency by auto-generating a tailored execution structure around an existing off-the-shelf LLM instead of manually engineering one for every new task.
Terms in this paper
- Agent harness · The operational scaffold around a language model that decides how memory is kept, how plans are formed, which tools are exposed, and how actions are executed
- Just-in-Time (JIT) harness · Generating a task-specific harness at the moment a task arrives, instead of pre-building one general-purpose harness ahead of time
- Evo-GDPO · The paper's online reinforcement-learning method that trains the model to propose harnesses that beat the current best archive entry on reward, latency, and cost
- ReAct · A standard baseline agent loop that alternates between reasoning and acting
Original abstract (English)
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.
Read on arXivLatest papers
- The Dialect Tax: Dialectal Biases Persist throughout the Language Modeling PipelineAI language models still charge a hidden 'dialect tax' on AAVE and other non-standard English at every stage, not just tokenization
- Sycophantic Chatbots Cause Delusional Spiraling, Even in Ideal BayesiansA math model shows that even a perfectly rational person can be talked into delusion by a chatbot that keeps agreeing with them
- Autonomous Mathematical Discovery in an Open-World Multi-Agent EnvironmentAI agents from different companies self-organized in an open-world simulation and produced new results on five math problems, with no one directing them
- Automata from Agent Traces: Failure and Next-Step PredictionResearchers compress massive LLM-agent execution logs into one small finite-state machine that predicts both the next action and eventual failure
- MARS: Multi-Specialist LLM Relay System for Competitive ProgrammingFor competitive programming, a relay of topic-specialist AIs beats one generalist model handing coding work off in sequence
- AgentRoom: Concurrent Multi-Agent Coding in a CRDT-Backed Shared WorkspaceLetting multiple AI coding agents share one workspace and coordinate in real time beats running them one-by-one or in uncoordinated parallel
- Recursive Agentic ReasoningSampling several answers and voting on them also fixes cases where an AI simply fails to produce any answer at all
- Black hole singularity is a surface not a pointA black hole's singularity is a surface, not a single point
Latest from METAL LAB
Figures: Guibin Zhang et al., arXiv:2608.25593, CC BY 4.0