Growing Harness is a method that automatically builds reusable control code for LLM agents from task failures. It starts with a minimal scaffold that has no built-in strategy, then uses execution traces to localize failures to specific functions. An optimizer repairs these functions jointly across multiple failures, and a gate system rolls back changes that hurt past performance. Over time, the harness accumulates code that handles recurring control decisions, leaving the LLM to focus only on semantic reasoning.
Tested on two benchmarks with models from 4B to 120B parameters, Growing Harness achieved the highest mean success in five of six settings and reduced inference costs by 74.4-98.6% compared to a standard Tool-Calling agent. The method also showed remarkable stability across model scales, with success varying by less than 1% on WebArena-Verified while the baseline collapsed from 41.7% to 6.7% when the model shrank from 120B to 4B. This offers a path to deploy capable agents with smaller, more efficient models.