TEI: Adaptive Bottleneck Optimization of Agent Harnesses and Prompts
Abstract
Self-improving agents need reliable loops for updating harnesses and prompts, with independent validation of gains and explicit checks for regressions. We introduce the Target-Evaluate-Improve (TEI) Loop, a fast, low-cost method that jointly optimizes agent harnesses and natural-language prompts. TEI identifies the weakest quality dimension of the current best agent, searches for targeted changes across both components, and applies a paired non-regressive gate before deployment. In an empirical study of software-engineering agents selected from the SWE-bench leaderboard archive, TEI found deployable modifications for 26 of 30 systems; direction-hidden judges preferred the modified artifacts to their own baselines in 84.6% of comparisons. Random-search and adversarial controls distinguish substantive gains from evaluator and selection artifacts. Against GEPA, ACE, AHE, and MIPRO, blinded comparisons yielded an estimated 65% preference for the larger-budget frozen TEI artifacts; this exploratory result is not budget-matched, and TEI ranks fourth on matched-budget rubric gain