mlsanityData to 7 Oct 2026

Composing Task-specific Agent Harnesses at Test Time with Reusable Primitives

arXiv 2609.38912 ↗First posted 30 Sep 2026cs.AIcited by 0

On the map: LLM agents and tool use → Software engineering coding agents

Abstract (arXiv)

Agent harnesses govern how large language models (LLMs) gather context, invoke tools, verify results, preserve state, and terminate, largely affecting agent performance. However, the value of each harness mechanism can differ across heterogeneous tasks: a mechanism that improves one task may impose overhead or context distraction on another, leading to the suboptimality of a global harness. We characterize this suboptimality as a mismatch induced by fixed mechanism choices, motivating task-specific harness construction. Nonetheless, generating harness code for each task introduces generation and debugging costs, with execution risks that can compound as more mechanisms are generated. To address those challenges, we introduce Harness Primitives, reusable harness mechanisms with clear application scope and composition contract mined from failed task trajectories. Based on Harness Primitives, we propose STITCH, a framework that Selects suitable primitives given Task Information and compiles them into Task-speCific Harnesses at test time. This separation enables task-specific harnesses without generating or repairing mechanism code at test time. Extensive experiments demonstrate that STITCH not only improves harness adaptability and robustness, but also scales with the primitive library size, boosting task success rates by up to 12 points over fixed harness baselines, surpassing human-designed harnesses like Codex CLI while maintaining a minimal test-time harness composition overhead of only 2.7%, 638 times more efficient than generating task-specific harnesses from scratch. Ultimately, our work demonstrates that building task-adaptive harnesses can be beneficial for completing diverse tasks and that building reusable primitives can be a promising path towards this goal.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 13 of its 15 references that are in the map. First posted on arXiv 30 Sep 2026.

Builds on

13 of 15 references.

Closest ancestors · 5

Same direction, newest first

  1. 2026JIT-Agent: Scaling Harness Intelligence via Just-in-Time Harness Evolution26 Aug
  2. 2026AutoSaddler: Automatic Harness Optimization with Durable Updates from Agent Execution Traces24 Aug
  3. 2026KV-PRM: Efficient Process Reward Modeling via KV-Cache Transfer for Multi-Agent Test-Time Scaling10 Jul
  4. 2026Self-Harness: Harnesses That Improve Themselves8 Jun
  5. 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering6 May

Other references · 8

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  2. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
  3. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  4. 2026Terminal-Bench: Benchmarking Agents on Hard, Realistic Tasks in Command Line Interfacescited by 515
  5. 2026Meta-Harness: End-to-End Optimization of Model Harnessescited by 248
  6. 2026HarnessX: A Composable, Adaptive, and Evolvable Agent Harness Foundrycited by 37
  7. 2026Recursive Harness Self-Improvementcited by 22
  8. 2025Optimal Aggregation of LLM and PRM Signals for Efficient Test-Time Scalingcited by 3

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026Harnesses for Inference-Time Alignment over Execution Trajectories
  2. 2026Grow the Harness, Not the Context: From Strategy-Free Scaffolds to Reusable Specialist Agents
  3. 2026Vestrum: Improving Agent Harnesses by Adapting Their Verification, Structure and Memory
  4. 2026MESH-Harness: Self-Improving Agent Harnesses via Bandit-Guided Compositional Evolution
  5. 2026Code as Agent Harness
  6. 2026Verify Smarter, Evolve Further: Efficient Harness Evolution through Behavior-Aware Verification
  7. 2026The Empire, Long Divided, Must Unite: Architectural Convergence in Three LLM Agent Harnesses
  8. 2026Stop Comparing LLM Agents Without Disclosing the Harness