Agent runtime rules: boost scores by 14 points

Blog 11 min read

Qwen3.5-35B-A3B performance jumped from 23.8% to 38.1% on Terminal-Bench-2.0 simply by automating its runtime constraints. Manual prompt tuning is replaced by Self-Harness, a framework that freezes model weights to iteratively optimize the agent's surrounding architecture. Instead of guessing which prompt tweak might fix a flaky tool call, this approach forces the agent to mine its own execution traces for specific failure patterns and propose minimal, validated edits to its own ruleset.

The lever is the execution trace. Raw logs expose recurring collapse modes such as infinite retry loops or context window saturation, and weakness mining turns each pattern into a small, targeted edit instead of a broad, destabilizing rewrite. Regression testing against held-out tasks then decides whether that edit ships, while loop breakers cap the failures that burn the most tokens. Reliability ends up carried by failure-recovery logic and verification rules, not by the weights. This is not about improved models; it is about building a self-correcting infrastructure that makes mediocre models perform reliably and great models perform consistently.

The Role of Execution Traces in Modern Agent Reliability

Defining the AI Agent Harness Beyond Model Weights

System prompts, tool definitions, memory structures, and runtime policies form the AI agent harness that governs behavior independent of model weights. Claude Opus 4.8 achieves 88.6% on SWE-bench Verified, yet an agent's behaviour depends equally on this surrounding configuration. Raw execution traces provide the primary evidence source for improvement. Summarizing these traces destroys critical signal needed for optimization, causing accuracy to drop from 50% to 34.9% according to recent findings. This data gap forces a shift from manual tuning to automated loops that analyze failures directly. Agentic Harness Engineering demonstrates that systems mining uncompressed traces outperform baselines like Codex by identifying repeated systemic failures rather than isolated errors. The approach requires machine-checkable outcomes to function. Without objective pass/fail signals, the feedback loop cannot validate harness proposals. Swapping models without adjusting the harness yields diminishing returns because the architecture determines if potential is reached in production. Over-engineering rules can stifle model capability while under-specifying leads to flaky execution.

Real-World Impact of Harness Engineering on SWE-bench Scores

Codex reaches a 77.3% score on Terminal-Bench 2.0 by wrapping the model in a strict execution harness. Raw performance metrics often mislead operators because the delta between a base model and a harnessed agent defines production viability. Systems like SWE-agent and OpenHands demonstrate that Agentic Harness Engineering outperforms human-designed configurations by mining execution traces for systemic failures. The mechanism relies on replacing compressed failure summaries with uncompressed trajectory data to preserve signal fidelity.

Inside Weakness Mining and Automated Harness Optimization

Weakness Mining Mechanics Using Uncompressed Execution Traces

Running task batches with verifiable outcomes generates the raw data required to categorize failed traces without retraining model weights. This Weakness mining stage executes a set of challenges, capturing every tool call and error message in an uncompressed log. Operators must preserve this full fidelity because summarizing execution history destroys the specific signal needed for self-improvement, causing accuracy to collapse significantly compared to raw data retention. The process identifies recurring failure patterns, such as infinite tool loops or incorrect retry logic, which appear consistently across the test batch. Unlike external search processes used by Meta-Harness, this method operationalizes improvement as a bounded edit process driven strictly by internal evidence.

An assigned proposer role converts each categorized failure pattern into a small, targeted edit tied to that specific mechanism. Qwen3.5 initial performance sits at 23.8% before optimization, a baseline reflecting unaddressed execution errors. The mechanism operates as a bounded edit process, distinct from the external search strategies used by Meta-Harness. Instead of scanning broad codebases, the system generates diverse, minimal modifications derived strictly from identified weaknesses in the Self-Harness Architecture. This approach directly addresses the token snowball effect, where minor recursive errors compound into expensive, multi-step failures. Operators must recognize that automated harness optimization creates a tension between edit minimality and coverage breadth. Small edits reduce regression risk but may miss complex, multi-variable failure modes requiring broader intervention. The implication for production networks is clear: reliance on raw trace fidelity remains non-negotiable for valid proposals. Unlike summarized data, uncompressed logs preserve the precise command sequences needed to craft proven runtime policies.

Feature Self-Harness Proposal External Search Methods
Input Source Categorized failure patterns Full source code
Edit Scope Minimal, targeted Broad, exploratory
Validation Regression tests on held-out tasks Score-based selection

The cost of this precision is the requirement for verifiable task outcomes during the mining phase. Without objective pass/fail signals, the proposer lacks the feedback loop necessary to validate changes. This constraint limits immediate application to domains with deterministic evaluation metrics. AI Agents News highlights that such systematic loops replace manual hunches with evidence-based configuration updates. Validating a harness change means comparing exact command sequences, which is precisely what a summary obscures.

  1. Execute task batches to capture full execution traces.
  2. Categorize failures using raw logs rather than abstracts.
  3. Generate edits only from high-fidelity pattern matches.

Ignoring this constraint forces the system to regress toward random guessing. For more on validating these loops, consult resources from AI Agents News.

Implementing Regression Testing and Loop Breakers for Agents

Defining Loop Breakers and Regression Testing in Self-Harness

Dashboard showing agent loop metrics: 50 call limit, 451% injection risk, 60% relative gain, accuracy drop from 50% to 34.9% with summarized traces, and model success rates ranging from 64.3% to 88.6%.
Dashboard showing agent loop metrics: 50 call limit, 451% injection risk, 60% relative gain, accuracy drop from 50% to 34.9% with summarized traces, and model success rates ranging from 64.3% to 88.6%.

Hard tool-call limits stop infinite retry cycles by terminating execution after 50 attempts. This mechanism swaps vague instructions for deterministic runtime policies that kill specific failure patterns. Operators place these guards inside the agent's policy file to interrupt recursive errors before resource consumption spikes.

  1. Define a maximum tool-call threshold in the runtime configuration.
  2. Implement a rule prohibiting exact duplicate commands in the retry logic.
  3. Validate proposed edits against held-out tasks to prevent performance regression.

The Self-Harness Architecture uses this validation stage to accept changes only when they fix failing cases without hurting success on other tasks. Testing across models like MiniMax M2.5 and GLM-5 shows that freezing model weights while optimizing the harness yields relative performance gains of up to 60%. AI Agents News highlights that this empirical debugging process transforms ambiguous failures into testable edits.

Fixing MiniMax M2.5 Timeout Errors with Targeted Policy Edits

MiniMax M2.5 previously explored dataset configs until timeout, shipping zero artifacts due to missing runtime limits.

  1. Identify infinite exploration patterns in the raw execution logs before any compression occurs.
  2. Insert a loop breaker policy that forces redirection after a fixed number of tool calls.
  3. Mandate early generation of required artifacts to satisfy downstream verification steps immediately.

Specific edits replace generic prompt extensions with legible, deterministic rules tied to the failure mode. Operators must note that Proposal Validation rejects changes unless they improve failing cases without regressing held-out tasks. This gate prevents the harness from over-correcting based on noise in a single trace batch. Unlike manual tuning, the system auto-optimized versions beat hand-engineered entries by using a proposer role to read failed traces. AI Agents News highlights that such infrastructure determines whether feedback loops fit within nightly deployment windows.

Validating Agent Stability on Terminal-Bench-2.0 Artifacts

Terminal-Bench-2.0 execution requires artifact management checks before any loop breaker activates.

  1. Run baseline tasks to capture raw failure traces covering command use and verification.
  2. Mine weaknesses from logs to identify specific retry loops or missing artifact generation.
  3. Propose minimal harness edits that target the identified failure mode without generic prompt padding.
  4. Validate changes against held-out datasets to confirm improvement without degrading prior capabilities.
Trace Input Failure Pattern Required Edit
Raw Execution Infinite config exploration Loop breaker at 50 calls
Raw Execution Blind command retry Duplicate command prohibition
Summarized Token overflow Discard (low fidelity)

The proposal validation stage rejects edits that improve one metric while breaking another, ensuring net stability gains. High CI/CD integration viability depends on this strict, evidence-based gatekeeping. Blindly increasing prompt length fails where targeted policy edits succeed. Skipping regression testing leads to unverified behavior in production artifacts. AI Agents News recommends freezing model weights to isolate harness efficacy during these tests.

Why a Model Swap Restarts the Loop

Replacing a Qwen3-32B backbone with GPT-4o-mini causes Effectiveness under Token Budget scores to plummet from a strong majority to a small fraction without automatic adaptation. Cheaper models display distinct failure modes that static prompts miss entirely, so a swap that looks like a configuration change behaves like a rewrite. Self-Harness answers it as a bounded edit process: Weakness Mining spots error patterns in raw traces, Harness Proposal creates minimal code edits, and Proposal Validation accepts them only if held-out tasks improve without regression. Unlike Meta-Harness, which searches broadly over source code, this method refines policy iteratively, which turns a model upgrade from an engineering project into a configuration update.

Evaluation speed decides whether that promise survives a deadline. Parallelizing workloads across 50 sandboxes cuts validation time from days to roughly one hour, and slower feedback stalls the loop until adaptation after a swap becomes impossible. The cost of maintaining human-engineered harnesses scales linearly with model churn rates, while automation ties harness proposals directly to observed execution data.

Scenario Trigger Condition Required Action
Model Swap Performance collapse on known tasks Run weakness mining loop
Recurring Timeout Infinite tool exploration detected Insert loop breaker policy
Data Loss Blind command retry observed Prohibit duplicate commands

Strategic ROI: Self-Harness Automation Versus Manual Tuning Costs

Manual harness rewrites consume engineering weeks while automated loops validate edits in hours against objective pass/fail gates. Economic divergence stems from token consumption patterns where unoptimized agents generate expensive failure cascades during context management. Static configurations force operators to choose between over-provisioning resources or accepting frequent service degradation.

Metric Manual Tuning Self-Harness Loop
Adaptation Speed Weeks per model Hours per iteration
Failure Response Reactive patching Proactive pattern mining
Token Efficiency Low (repeated errors) High (targeted fixes)
Regression Risk High (human error) Low (automated gate)

The formalization of harness engineering shifts focus from prompt text to the code infrastructure governing tool calls and memory. This architectural pivot allows smaller models to achieve production readiness without the latency penalties of larger alternatives. Rapid iteration creates tension with stability. Continuous automated changes risk introducing subtle regressions if the validation dataset lacks sufficient diversity. Teams must maintain rigorous held-out test sets to prevent the system from optimizing for specific benchmark quirks rather than general reliability. Organizations lacking machine-checkable success criteria cannot adopt this methodology regardless of potential efficiency gains. AI Agents News recommends implementing strict acceptance gates before deploying any self-modifying agent logic to production environments.

About

Diego Alvarez, Developer Advocate at AI Agents News, brings direct, hands-on expertise to the critical discussion on self-harnessing AI agents. His daily work involves building and benchmarking autonomous systems using frameworks like CrewAI, AutoGen, and LangGraph, where he consistently observes that agent reliability hinges less on the underlying model and more on the surrounding harness. By rigorously testing coding agents such as Claude Code and OpenHands, Diego identifies how system prompts, tool definitions, and failure-recovery logic dictate real-world performance. This practical experience allows him to argue convincingly that when agents fail in production, engineers should scrutinize their orchestration layers before blaming the model. At AI Agents News, an independent hub dedicated to technical deep dives for engineers, Diego translates these field observations into actionable insights. His analysis helps technical founders and ML engineers understand that mastering the agent harness is the true key to deploying reliable, production-ready autonomous systems.

Conclusion

Self-Harness moves the unit of improvement from the weights to the rules around them. Qwen3.5-35B-A3B climbed from 23.8% to 38.1% on Terminal-Bench-2.0 with its weights frozen, which means the gap it closed had been sitting in retry logic, tool-call limits, and verification rules all along.

The loop runs on two inputs, and both are infrastructure rather than research. Keep traces uncompressed, because a summary drops exactly the command sequences a proposal needs. Keep task outcomes machine-checkable, because an acceptance gate that cannot separate a fix from a hallucination will wave through both. Each one converted into a scriptable check is one more failure the harness can close without you.

Frequently Asked Questions

Automated harness optimization lifts held-out performance by up to 60% in relative terms. This significant gain allows teams to achieve stability without manual labor, transforming how agents handle complex tasks compared to traditional hand-tuning methods used today.

Summarizing execution traces causes accuracy to drop from 50% to 34% according to recent findings. Preserving uncompressed trajectory data is essential because summarization algorithms frequently discard the critical signal fidelity needed for effective optimization cycles.

Qwen3.5-35B-A3B performance jumped from 23.8% to 38.1% on Terminal-Bench-2.0 simply by automating runtime constraints. This approach freezes model weights to iteratively optimize the surrounding architecture rather than guessing which prompt tweaks might fix issues.

Codex reaches a 77.3% score on Terminal-Bench 2.0 by wrapping the model in a strict execution harness. Raw performance metrics often mislead operators since the delta between base models and harnessed agents defines viability.

Accuracy collapses from 50.0% to 34.9% during the refinement cycle when using compressed failure summaries. Replacing these with uncompressed trajectory data preserves the signal fidelity required for the proposer role to generate valid harness edits.