Agent Reinforcement Learning: Why Benchmark Scores Vary Across Harnesses

    The same coding model can produce substantially different benchmark scores depending on its agent harness. This article explains how tools, context management, verification, execution budgets, and training–evaluation alignment affect results, and outlines reproducible evaluation practices and an abstraction layer for separating policies from harness implementations.

    1. One Model, Three Harnesses, Three Scores

    On software engineering benchmarks, an agent receives an issue description and must independently locate and fix a defect in a code repository. A common finding is that the same model weights and decoding parameters can yield noticeably different success rates when only the surrounding agent harness changes.

    One published set of results from a third-party evaluator illustrates this effect: the same coding model scored 19.9% with harness A, 22.0% with harness B, and 25.5% with the evaluator’s general-purpose harness C. The gap between the lowest and highest scores was approximately 5.6 percentage points—a relative improvement of nearly 28%.

    The model’s underlying capabilities did not change. The capabilities of the combined model-plus-harness system did.

    This raises an important question: when a vendor reports that reinforcement learning has doubled a coding agent’s benchmark score, how much of that gain comes from policy optimization, and how much comes from alignment with the execution harness?

    2. What an Agent Harness Actually Changes

    An agent harness is not a passive wrapper around model calls. It determines what the model can observe at each step, which actions it can take, and how it recovers from failures. Five areas are particularly important.

    Tools and Action Space

    The granularity of available tools determines how effectively a policy can express its decisions. Some harnesses expose only three broad operations: read a file, write a file, and execute a command. Others provide finer-grained tools such as symbol-level search, dependency graph queries, and structured diff editing.

    Different action spaces favor different optimal strategies.

    Context Management

    Repository-level tasks contain far more information than a model’s context window can hold. How a harness truncates, orders, and compresses interaction history determines whether the model sees critical clues.

    With effective context management, the same model has a better chance of identifying the correct files.

    Patch Application and Verification

    Successful execution requires a complete feedback loop: patches must be applied correctly, tests must be triggered appropriately, and failure information must be returned in a structured form.

    A weak link anywhere in this loop can turn an otherwise successful trajectory into a failed task.

    Retries and Budget Controls

    Maximum interaction rounds, per-round token limits, timeout thresholds, and retry counts are often opaque harness-side settings.

    More generous budgets can effectively provide additional attempts, creating an advantage similar to increasing pass@k rather than improving the underlying policy.

    Training–Evaluation Alignment

    The most important factor is whether the policy uses the same harness during training and evaluation.

    A mismatch creates a form of train–serve skew: the policy learns a distribution of effective trajectories under harness A but is then expected to execute under harness B.

    3. Why Training in the Evaluation Harness Creates an Advantage

    A central concern is that official scores may be obtained in the same harness used for training, while comparison models are evaluated in a harness to which they have not been adapted. This creates an alignment advantage for the trained policy.

    Let (H) denote the harness, (\pi) the policy, and (J(\pi, H)) the benchmark success rate. Reinforcement learning optimizes:

    [
    \max{\pi} J(\pi, H{\text{train}})
    ]

    When evaluation uses (H{\text{train}}), the measurement matches the training objective. When evaluation instead uses (H{\text{eval}} \neq H{\text{train}}), it measures (J(\pi, H{\text{eval}})). Typically, the expected relationship is:

    [
    J(\pi, H{\text{train}}) \geq J(\pi, H{\text{eval}})
    ]

    This expresses the expected benefit of training–evaluation alignment, rather than an unconditional guarantee for every harness pair.

    Comparison models that have not been adapted to the evaluation harness may face an even larger mismatch. A claim that a benchmark score has “doubled” therefore needs to specify the harness conditions; otherwise, the comparison is not meaningful.

    4. Five Engineering Principles for Reproducible Evaluation

    Principle 1: Fix and Disclose the Harness

    Every result should identify the harness name and version, tool inventory, context management strategy, and all execution-budget settings.

    Principle 2: Use a Cross-Evaluation Matrix

    Evaluate at least the Cartesian product of models × harnesses. A matrix reveals differences that a single score cannot.

    Principle 3: Run Repeated Samples and Report Uncertainty

    Single-run results can have substantial variance. Report the mean pass@1 and its confidence interval, and avoid strong conclusions when the sample size is insufficient.

    Principle 4: Align Budgets

    Align total tokens, total interaction rounds, and total wall-clock time. Budget differences should not be presented as capability differences.

    Principle 5: Separate Failure Categories

    Classify failures into four groups:

    • Localization errors: the agent identifies the wrong location in the repository.
    • Editing errors: the agent produces an incorrect code change.
    • Verification failures: the proposed change fails validation.
    • Harness-level errors: patch application failures, timeouts, or tool exceptions.

    Disclose the harness-level error rate separately.

    5. A Harness Abstraction Layer: Separating Policy from Implementation

    An engineering approach is to introduce a stable abstraction layer so that the policy depends on an interface contract rather than a specific harness implementation:

    1. class AgentHarness(Protocol):
    2. def reset(self, repo_snapshot: str) -> State: ...
    3. def tools(self) -> list[ToolSpec]: ...
    4. def step(self, state: State, action: Action) -> StepResult: ...
    5. def verify(self, state: State) -> VerifyReport: ...
    6. # Training and evaluation share the same contract;
    7. # concrete implementations can be replaced.
    8. def run_task(policy, harness: AgentHarness, task) -> TaskOutcome:
    9. state = harness.reset(task.repo_snapshot)
    10. for _ in range(MAX_STEPS):
    11. action = policy(state, harness.tools())
    12. result = harness.step(state, action)
    13. if result.terminal:
    14. break
    15. state = result.state
    16. return TaskOutcome(verify=harness.verify(state))

    Supporting engineering practices include:

    • Containerized repository snapshots and dependency environments to make runs reproducible.
    • Structured logs of complete trajectories to support failure attribution.
    • Sandbox isolation and resource quotas to limit unauthorized actions and reduce execution noise.
    • Monitoring and alerting to continuously track task success rates, harness-level error rates, and average step counts.

    These capabilities can generally be assembled from standard cloud service categories, including container platforms, object storage, logging services, and monitoring and alerting systems. Teams can combine them as needed without building the underlying infrastructure themselves.

    6. Conclusion

    Cross-harness benchmark differences are not merely noise. They reflect the design of a composite system in which the model and execution environment jointly determine performance.

    For users evaluating results, the order of questions should be: Which harness was used? What budget was allowed? How many samples were run?

    For teams building agents, the harness should be a first-class component in version control and experiment records. Use an abstraction layer to separate policy logic from implementation, and publish cross-evaluation matrices rather than isolated scores.

    Only then can reported improvements be meaningfully attributed, reproduced, and assessed for transfer across execution environments.