When an AI agent's setup keeps failing, does tracing what it does while running show you which code to fix?
Can runtime behavior mapping help localize harness deficiencies?
This explores whether organizing a harness (the scaffolding of prompts, tools and control code around a model) by what it does at runtime, instead of by how its code is laid out, helps you find where the harness is going wrong.
This explores whether organizing a harness by what it does at runtime, instead of by how its code is laid out, helps you find where the harness is going wrong. The corpus says yes. It also suggests that finding the problem is the harder half of fixing it.
The difficulty comes from a mismatch. A complaint about a harness is behavioral, such as "it handles failed tool calls badly." But harnesses spread one behavior across many files, functions and stages, so no single place holds it. Why is finding distributed behavior code so hard? argues this is the real bottleneck in evolving production harnesses. Writing the edit is easy once you know every location that implements the behavior, and locating them all is where things break down.
The most direct evidence is a behavior-to-code map, which lists each runtime behavior next to the code that implements it. Can explicit behavior maps help weaker planners compete with stronger models? found that this raised win rates by 10–19 points and cut planner tokens by 8–13%. Weaker planners using the map matched stronger models' code localization on every precision and recall metric. So most of the gap between weak and strong planners was a lookup problem, and a good representation removed it without a bigger model.
Three other findings show why a map is needed. Do harness edits learn reusable strategies or memorize task fixes? shows that most evolved edits just record fixes an agent could have rediscovered in one rollout, so they patch symptoms instead of the underlying deficiency. Can language models build and maintain their own agent harnesses? shows that harness quality can't be read off downstream task scores, so a score tells you something is wrong but not where. Do stronger models always evolve harnesses better? shows that weak models often fail to invoke a harness at all, and strong models struggle to follow it faithfully. The notes don't test whether a behavior map makes edits less memorized. That link is a reasonable guess, not a result.
Behaviors also look like the natural unit for this work. Can agent harnesses be automatically optimized across many environments? found four mechanisms (action execution, context compaction, observation handling, delegated reading) that cut token traffic by 44.7–49.0%. Can harness modules improve separately from benchmark data? improves modules separately, pooling evidence across tasks before touching a component. Both treat the harness as a set of separable behaviors. The raw material for a map may already exist, since Can a routing harness generate its own training data automatically? notes that a deployed routing harness already records execution trajectories and outcomes.
There is a limit on how far the map carries. Should safety harnesses be customized for each deployment? shows that a harness strict enough for one model over-blocks another, so a deficiency depends on the model and the deployment as well as the code. A map would likely need rebuilding for each one. The corpus proves the point for code localization in one setting. It has nothing yet on using behavior maps to diagnose safety or reasoning failures, or on whether they hold up across models.
Sources 9 notes
The core difficulty in evolving production harnesses is not generating edits but finding every code location that implements a behavior. Harnesses distribute single behaviors across files, functions, and stages, creating a representational mismatch between behavioral requests and structural code organization.
A behavior-to-code mapping representation improved win rates by 10–19 points while reducing planner tokens by 8–13%. Weaker planners using this mapping matched stronger models' code localization across all precision and recall metrics.
Analysis of evolved harness trajectories shows rational, well-motivated edits across prompt and tool layers, but most persist fixes an agent could rediscover in a single rollout. Gains remain limited because memorized shortcuts cache what's already within reach rather than converting hard failures into successes.
Research shows that LLMs vary sharply in building harnesses across domains, struggle to retain useful intermediate updates during evolution, and produce harnesses whose performance shifts dramatically with different executors—demonstrating that harness quality cannot be inferred from downstream task scores alone.
Model capability to produce useful harness edits stays constant across tiers, but capacity to actually benefit from those edits follows an inverted U-shape, peaking in mid-tier models. Weak models fail to invoke harnesses; strong models struggle with faithful instruction-following.
Show all 9 sources
Cross-environment harness optimization yielded four mechanisms (action execution, context compaction, observation handling, delegated reading) that reduced token traffic by 44.7–49.0% while maintaining comparable performance on a 51-task benchmark, suggesting harness-level gains are orthogonal to model improvements.
ModularRSI evolves harness modules independently using contrastive trajectories on benchmark-disjoint data, showing consistent gains across unseen tasks and domains. The approach isolates mechanism-level improvements from task-specific adaptation by aggregating evidence across tasks before updating components.
A deployed routing system records execution trajectories, capability demand estimates, and outcome data that can be converted into labeled training examples for fine-tuning and distillation, turning the harness into both a serving component and a difficulty labeler.
A harness strict enough for one model over-blocks another, while policies general enough to transfer across domains miss application-specific safety relations. Domain semantics and model characteristics jointly determine which harness is effective.
Papers this line draws on 8
The research behind the notes this line reads — ranked by how closely each paper relates.
- Rethinking the Evaluation of Harness Evolution for Agents
- Harness Updating Is Not Harness Benefit: Disentangling Evolution Capabilities in Self-Evolving LLM Agents
- Harness Handbook: Making Evolving Agent Harnesses Readable,Navigable, and Editable
- HarnessDev: Can LLMs Create and Evolve Their Own Agent Harness?
- ModularRSI: Modular and Generalizable Recursive Harness Self-Improvement
- Ouroboros: A Self-Developing Frontier Coding Agent with Reviewed Core Evolution
- StateM: Reaching 95.3% Raw Accuracy, or a \$15 Frontier Run, on Terminal-Bench 2.1 via Harness Scaling
- DarwinX: Evolving Agent Harnesses Through Natural Selection