Large language models (LLMs) are often turned into agents that perform tasks by interacting with tools. The code that manages these interactions, the harness, is usually designed by hand, which is slow and costly. Testing a single harness requires running the full agent, making optimization expensive.
HarnessFlow treats the harness as code that an AI can edit. It uses a search algorithm called that balances exploration and improvement. A coding AI then refines the harness using past results and reusable components.
On six standard tests, HarnessFlow achieved the highest average scores. It improved performance by 10.89 percentage points over the baseline and by 3.95 percentage points over a prior automated method, while also reducing compute costs. This shows that guided search can automate harness design, reducing the need for manual engineering.
