arXiv(opens in a new tab)cs.SEAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.26197

Harness Engineering for Predictable Agentic Systems: An Empirical Study of Deterministic Execution Constraints

Saransh Dhage

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Large Language Model (LLM) based agents exhibit substantial run-to-run execution variance even when given identical tasks, tools, and environmental conditions — a property that is acceptable for exploratory use but operationally unacceptable in regulated domains such as finance, compliance, and auditing. We study harness engineering: wrapping an agent in a deterministic execution layer (a finite-state controller, forced single-tool-per-state selection, output validation, bounded retry, and structured planning) and measuring its effect on execution determinism and task success. Across two synthetic tasks (a finance Expected Credit Loss pipeline and a legal clause classification pipeline) and two open-weight models (Qwen-2.5-7B-Instruct, Gemma-3-27B), we find that a first-pass harness (finite-state execution plus forced tool selection, validation, and retry) produces a mixed result: it significantly improves exact-match reproducibility in one of four model×task cells, significantly degrades it in two, and has no significant effect in the fourth. A trace-level diagnostic reveals the cause: once tool sequence, state sequence, and final output are already highly consistent, an unconstrained free-text planning step becomes the dominant — and only — remaining source of variance, and it is this axis, not genuine execution instability, that the reversals track. Adding Structured Planning — validating the agent's plan against a fixed schema before any tool is invoked — eliminates the effect entirely: all four model×task cells reach a Reproducibility Rate and Determinism Index of 1.000 at N = 100 runs per cell, and task success rises to 100% in three of four cells. The gain is not free: token cost falls in every cell relative to baseline (-15% to -17%), but latency shows a genuine, sample-size-robust split by model — Qwen becomes faster under the constraint (-12% to -25% vs. the unconstrained harness) while Gemma becomes markedly slower (+15% to +24%), a cost-for-determinism tradeoff that persists and strengthens when the sample size is doubled. We argue that harness engineering is a distinct, effective discipline for improving agent reliability, but that its cost is model-dependent and must be measured, not assumed.

1 Introduction

Autonomous LLM agents increasingly operate through multi-step workflows involving planning, tool selection, and sequential execution [9, 10]. A recurring practical observation is that agent behavior is difficult to reproduce: given identical instructions, tools, and data, an agent may generate different plans, select different tools, execute steps in different orders, or retry differently across otherwise identical runs. Recent empirical work has confirmed this directly. [1] measured tool-calling consistency across six models and 19 tasks and found a robust “structural consistency, parametric variance” pattern: agents tend to preserve tool order across repeated runs (mean Tool

Sequence Similarity ≈0.87\approx 0.87) while varying tool arguments substantially (mean Argument Consistency ≈0.69\approx 0.69), and that structural (not argument-level) consistency is what predicts task success.

This variance is tolerable for exploratory or creative use, but it is a hard blocker for deployment in regulated domains — credit risk and IFRS 9/CECL reporting, clinical decision support, contract review, safety-critical manufacturing inspection, and aviation checklists — where stakeholders require that an agent follow a predictable, auditable procedure, independent of whether its final answer happens to be correct [7]. [1] measure this inconsistency; they do not intervene on it. A separate line of work, [2], builds a constrained execution layer for scientific-workflow agents (fixed ordering, schema-validated actions, full provenance logging) and shows, on a small evaluation ( N≈5−10N \approx 5-10 runs, one workflow), that such constraints do not reduce task accuracy. Neither paper reports a statistically powered, mechanism-level account of which constraint contributes how much determinism, nor whether a constrained harness can fail to help, or actively hurt, on some tasks.

This paper addresses that gap directly. We ask a single, narrow, and answerable research question:

Does wrapping an LLM agent in a deterministic execution harness reduce run-to-run variance without reducing task success — and if a first-pass harness does not achieve this cleanly, what additional constraint is required, and at what cost?

Our central empirical contribution is not a single clean result but the diagnostic arc that produced one. An initial harness (finite-state execution, forced single-tool-per-state selection, output validation, bounded retry) produced a genuinely mixed effect on our four model×task cells: it significantly improved reproducibility in one cell, significantly degraded it in two, and had no detectable effect in the fourth. Rather than treat this as a negative result, we traced it to its source: because the harness already drives tool-sequence, state-sequence, and output determinism close to their ceiling, the only remaining axis of freedom left to the model is the free-text planning step it produces before execution begins — and it is variance in plan wording, not in execution, that the strict trace-matching metric was actually detecting. Adding a schema-validated planning gate (Structured Planning) that rejects and re-prompts non-conforming plans before any tool is called closes this gap completely: all four cells reach perfect measured reproducibility and determinism, and task success improves as a side effect. We then show this gain is not uniformly free: it reduces token cost everywhere, but its effect on latency is model-dependent, in a way that holds up and strengthens under a doubled sample size.