HarnessFlow: MCTS-Guided Harness Optimization for LLM Agents

Zhi Hong, Qianlong Wang, Hongchen Wei, Aidan Wu, Daohong Ying +3 more
11/4/2026
cs.AI

No confident code implementation found for this paper.

Abstract

The performance of large language model (LLM) agents depends on both the underlying model and the harness that governs interaction with tools and the environment. Yet harness design remains largely manual, and automating it requires navigating an open-ended search space through costly end-to-end evaluations.

Show full abstract

We introduce HarnessFlow, a framework for optimizing complete executable harnesses under a limited candidate-evaluation budget, with the model and task environment held fixed. HarnessFlow organizes candidates and their evaluation histories in a refinement tree, using a Monte Carlo Tree Search (MCTS)-based policy to balance exploitation and exploration. A coding agent refines selected harnesses using archived code, execution feedback, and a library of reusable harness mechanisms. With 15 refinement attempts per benchmark, HarnessFlow achieves the highest mean test scores among the compared methods on six benchmarks spanning agentic tasks, coding, and web interaction. The optimized harnesses achieve an average score of 69.48%, outperforming the initial harnesses and Meta-Harness by 10.89 and 3.95 percentage points, respectively, while incurring lower average per-task execution costs than hand-engineered baselines. These results suggest that structured harness search offers a promising route toward automating the design of capable and efficient LLM agents.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{hong2026harnessflow,
  title  = {HarnessFlow: MCTS-Guided Harness Optimization for LLM Agents},
  author = {Zhi Hong and Qianlong Wang and Hongchen Wei and Aidan Wu and Daohong Ying and Mingze Kong and Bei Liu and Chong Luo},
  year   = {2026},
  eprint = {2611.06254},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.06254v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.06254.svg)](https://codeofpaper.com/paper/2611.06254)

Discussion