ΒΆPaper Feed

Issue 44 Β· Pick 06 AI / ML βœ“ read

Your Policy Is Secretly a Harness: The Decision Geometry of Agent Interfaces

Jian Mu, Ruibo Shen, Yao Shu

TL;DR: When you post-train an LLM agent, the thing it learns is not an abstract policy β€” it's the preference structure of the exact scaffold (prompts, tools, observation format, control loop) it was trained inside, expressed through that scaffold's interface. This paper formalizes the scaffold as a "harness" inducing a KL-regularized control problem, proves that an optimal policy's log-odds literally encode the harness's action scores, and derives an exact decomposition: deployed return = the harness's ceiling (best achievable return) minus the policy's mismatch (return lost to its own suboptimality). The punchlines: reversing the order of JSON fields in the observation β€” changing nothing about which decisions are optimal β€” drops a trained agent from 85.0% to 19.2% success; and every harness revision that a frozen-model comparison rejected but that raised the ceiling ended up winning after retraining under it. If you've ever A/B-tested agent scaffolds with a fixed checkpoint, this paper says you were measuring a confounded quantity, and it hands you the deconfounded one.

The problem: scaffold evaluation with frozen weights is confounded

Everyone who builds agents does the same thing: take a trained model, wrap it in a new scaffold β€” different system prompt, different tool set, different observation serialization β€” and see if benchmark numbers go up. Automated agent-design systems (ADAS, AFlow, Promptbreeder, self-improving coding agents) institutionalize this loop: propose a harness, score it with a fixed model, keep the winner.

This implicitly assumes that what the model learned under harness A transfers to harness B. The paper asks the obvious-in-retrospect question: what exactly did the model learn from its harness, and what survives a harness change? The answer turns out to be clean enough to state as a theorem, and the consequences are not subtle.

The setup: a harness induces a control problem over semantic actions

The first move is a formalization that's worth internalizing. A harness is an interface \mathcal{I} = (c_\mathcal{I}, d_\mathcal{I}, e_\mathcal{I}): an encoder that turns the task state s into a prompt context, a decoder that parses model output into a semantic action a (click element 7, run this query β€” the executed operation, not the token string), and an executor. Many token sequences can decode to the same action, so the token policy \pi_\theta induces a semantic policy by summing over the fiber:

\Pi_{\theta,\mathcal{I}}(a \mid s) = \sum_{y:\, d_\mathcal{I}(y;s)=a} \pi_\theta(y \mid c_\mathcal{I}(s)).

Crucially, both the encoder and the decoder appear here. Fixed weights do not fix the semantic policy. The same \theta expresses different action distributions through different interfaces. Together with the environment, the harness induces transitions P_\mathcal{I}, rewards r_\mathcal{I}, and a reference policy \pi^{\mathrm{ref}}_\mathcal{I} (the frozen base model, read through the same interface), and the standard KL-regularized return J_\mathcal{I}(\Pi) with coefficient \tau and discount \gamma.

model weights ΞΈ (frozen) encoder c₁(s) fields: task, state, actions encoder cβ‚‚(s) same fields, reversed order readout FΜ‚(ΞΈ, I₁) success 85.0% readout FΜ‚(ΞΈ, Iβ‚‚) success 19.2%

Optimal decisions identical in both β€” only the readout changed.

The action preferences a trained model expresses β€” its "readout" β€” depend on the interface it is read through. Reversing observation-field order leaves every optimal decision unchanged, yet the same weights express a catastrophically different semantic policy.

Insight 1: an optimal policy's log-odds are the harness's action scores

Under KL-regularized control, the optimal policy has the Gibbs form \Pi^*(a|s) \propto \pi^{\mathrm{ref}}(a|s)\exp(Q^*(s,a)/\tau). Define the action score F^*(s,a) = Q^*(s,a) + \tau \log \pi^{\mathrm{ref}}(a|s), so \Pi^* = \mathrm{softmax}(F^*/\tau). Then for a policy trained to optimality:

\tau \log \frac{\Pi_\theta(a\mid s)}{\Pi_\theta(b\mid s)} = F^*(s,a) - F^*(s,b).

The trained policy's log-odds recover exactly how strongly its training harness favored each action over the others β€” combining long-term value and reference prior β€” even though the policy contains none of the harness's code or tools. Hence the title: your policy is secretly a harness. (Scores are only identified up to a per-state constant, which is why behavior fixes decisions but not the harness's absolute value β€” that gets added back in Insight 3.)

This isn't just an existence claim about optima. In a controlled MiniWoB++ study (six harnesses H0–H5 over three web-task families, each compiled into a finite graph so the optimum is exactly solvable via soft Bellman, with a 2B model trained by exact policy gradients), real post-training drives the model's centered scores toward the training harness's optimum β€” geometry error falls 69–90%, equally on held-out tasks β€” and makes them harness-specific: under every deployment harness, the checkpoint trained under that harness has the lowest score error (the diagonal of a 6Γ—6 matrix wins every column).

Insight 2: three ways transfer breaks, and one of them is pure presentation

When you move a trained policy from harness 1 to harness 2, the deployed score error splits exactly into three vectors:

\underbrace{\widehat{F}_{\theta,2} - \bar{F}^*_2}_{\text{deployed error}} = \underbrace{\bar{F}^*_1 - \bar{F}^*_2}_{\text{target shift}} + \underbrace{\widehat{F}_{\theta,1} - \bar{F}^*_1}_{\text{training residual}} + \underbrace{\widehat{F}_{\theta,2} - \widehat{F}_{\theta,1}}_{\text{readout drift}}.

Target shift: the optimum moved (execution changed). Training residual: the policy was never perfect. Readout drift: the same weights express different scores through the new interface. The killer experiment isolates the third term: keep actions, execution, rewards, and reference fixed (verified numerically β€” ceiling differences of order 10^{-16}), and only change presentation. The optimal policy is certified unchanged. Results:

Presentation changes with identical optimal decisions (H0-trained agent)task success (%)02040608085Original86Menu as list68.2Reversed codes67.6Permuted codes57.1Shifted codes19.2Reversed fieldsTable 1. All variants provably share the same optimal policy; the entire spread is readout drift.

Reversing observation-field order flips the model's most probable action at 52% of states. Prompt-format sensitivity has been reported before (Sclar et al.), but here the control problem certifies that nothing about the task changed β€” the full effect is attributable to the readout, a quantity the framework defines and measures.

Insight 3: return = ceiling βˆ’ mismatch, and frozen comparisons mix the two

Scores fix decisions but not value. Applying the regularized performance-gap identity to the harness-induced problem gives an exact decomposition:

J_\mathcal{I}(\Pi_\theta) = \underbrace{C(\mathcal{I})}_{\text{ceiling}} - \underbrace{M(\theta,\mathcal{I})}_{\text{mismatch}}, \qquad M = \frac{\tau}{1-\gamma}\,\mathbb{E}_{s\sim d^{\Pi_\theta}}\,\mathrm{KL}\!\left(\Pi_\theta \,\|\, \Pi^*_\mathcal{I}\right),

where C is the best return any policy can achieve under the harness and M accumulates the KL to the optimum along the policy's own trajectories (errors on common paths cost most). Training with a fixed harness can only reduce M. Changing the harness moves both terms. So a frozen comparison J_2 - J_1 = (C_2 - C_1) - (M_2 - M_1) conflates what the new harness offers with how badly the current checkpoint misuses it β€” and the mismatch term is exactly the part retraining can remove.

ceiling C₁ Harness 0 β‘  return small M ceiling Cβ‚‚ > C₁ H1, frozen ΞΈ β‘‘ large mismatch M H1, adapted ΞΈβ€² β‘’ return > β‘  swap harness retrain β‘ 's return
A frozen harness swap (β‘  β†’ β‘‘) can raise the ceiling yet lower return, because the inherited mismatch grows faster. Retraining (β‘‘ β†’ β‘’) only removes mismatch; once mismatch falls below the threshold T = Ξ”C + M(ΞΈβ‚€, I₁), the adapted agent beats the original.

The concrete instance: harness H1 adds batched clicks (two clicks per decision). It raises the ceiling by 0.012 but raises the frozen model's mismatch by 0.123 β€” about ten times as much β€” so frozen return drops by 0.110 and a frozen comparison rejects it. After equal-budget retraining from the same checkpoint under each harness, the H1-adapted agent beats both the source (85.1% β†’ 88.2% success) and the H0-continued branch, with paired bootstrap CIs excluding zero. The derived condition is exact: adaptation pays off iff the remaining mismatch falls below T = \Delta C + M(\theta_0, \mathcal{I}_1).

The generalization is the strongest result in the paper. Across all harness swaps among H0–H5 that a frozen comparison rejects and where T>0 (nine swaps), all seven that raise the ceiling win after adaptation, and the two that lower it don't. The pre-adaptation prediction T - r_2 (where r_2 is the mismatch of a model trained directly under the target) gets every sign right and orders the gains with Spearman \rho = 0.95; the frozen return change β€” the quantity everyone currently uses β€” manages \rho = 0.17. Notably, three winning swaps targeted H5, which only adds instructions: changing the prompt changes the reference policy, which raises the ceiling without touching the action space.

Does it survive contact with real agents?

The controlled study has exact optima. Deployed agents don't. Section 6 builds the bridge in two steps. First, mismatch can be estimated from sampled actions alone (geometric stopping gives unbiased occupancy samples; smoothed action counts give the KL), and with a calibrated budget this estimate predicts return changes about 100Γ— better than ceiling-alone and ~10Γ— better than equal-budget direct rollouts on the small differences that decide whether adaptation pays off.

Second β€” the part most relevant to practice β€” when no optimum exists, substitute a stronger teacher model. Five real coding-agent harnesses (Terminus-2, mini-SWE-agent, DeepSeek Harness, Pi coding-agent, DeepAgents) wrap a frozen 9B model on Terminal-Bench Lite, with accuracy ranging 47.9%–64.1%. Using GPT-5.6-luna as the optimum stand-in, with outputs bucketed into 13 shared action categories (inspect, modify, plan, run, …), teacher-based estimates \widetilde{C} and \widetilde{M} are computed from just three probe tasks β€” never seeing the evaluated model's task outcomes:

Coding-agent harnesses: ceiling, mismatch, and accuracyvalue-0.200.20.40.6Terminus-2mini-SWE-agentDeepSeekPi coding-agentDeepAgentsCΜƒ (teacher ceiling)MΜƒ (mismatch)CΜƒ βˆ’ MΜƒTable 2. Accuracy order: 64.1, 59.8, 54.7, 51.3, 47.9%. CΜƒβˆ’MΜƒ matches it exactly (Spearman ρ=1.0); CΜƒ alone and βˆ’MΜƒ alone each give ρ=0.7.

The difference \widetilde{C}-\widetilde{M} reproduces the accuracy ranking exactly; either term alone misorders. The structure is diagnostic: Terminus-2 wins through the smallest mismatch with only a middling ceiling; mini-SWE-agent and DeepSeek have the highest ceilings but large mismatch β€” the signature of the batched-click harness pre-adaptation, i.e., harnesses that should improve most under targeted training. DeepAgents' mismatch per decision is comparable to Terminus-2's, but it forces ~3Γ— more model calls per trajectory, and mismatch accumulates per decision β€” a concrete argument that harnesses demanding many decisions from a mediocre policy pay compounding tax.

What changes if this holds, and where to be skeptical

If you take the framework seriously: stop scoring candidate harnesses solely by frozen-model performance. Report an estimate of the ceiling next to the frozen return; evaluate multiple checkpoints per harness; run a cheap presentation-perturbation test to detect readout fragility. For automated harness search and joint harness+weight adaptation, the ceiling/mismatch split tells you whether a candidate offers too little or is merely not-yet-learned β€” qualitatively different failure modes that the current scalar score conflates. It also reframes "prompt sensitivity" from an empirical nuisance into a measurable quantity (readout drift) with a bound (Prop. D.2) in terms of token-level sensitivity to corresponding outputs.

Reasons for caution. The mechanistic results live in an unusually clean world: MiniWoB++ compiled to finite graphs, single-token action menus so the semantic policy is read directly off next-token logits, exact policy gradients, a 2B model with LoRA, and a solvable soft-Bellman optimum. Real agents have open-ended action spaces, long token-level actions, and no fiber structure as tidy as one-token-per-action; whether post-training still cleanly converges to harness-specific score fields at scale is untested. The coding-agent validation is suggestive but thin β€” five harnesses, three probe tasks, 39-task benchmark with Β±3–8% run-to-run spread, action space coarsened to 13 categories, and a teacher that is explicitly not the optimum (so \widetilde{C} is only a lower bound on the ceiling and \widetilde{M} is distance-to-teacher). A Spearman of 1.0 over five points is roughly a 1-in-120 event by chance, not iron-clad. And the adaptation-threshold story depends on being able to retrain under each candidate harness, which cheap harness search was precisely trying to avoid β€” though T - r_2-style predictions mitigate this if you can estimate ceilings.

The deepest caveat is conceptual: the identity J = C - M is exact but the ceiling is defined relative to the KL-regularized objective with a particular reference, and the reference is itself interface-dependent (an instruction-only change moved the ceiling through the reference). That's a feature for the theory and a subtlety for practitioners β€” "the harness's ceiling" is not a property of the tools alone.

Where to spend your reading time: Section 5 (ceiling/mismatch and the adaptation corollary) plus Table 10 in Appendix F.4 β€” the nine-swap experiment is the cleanest evidence that frozen comparisons systematically reject the harnesses most worth training under. Section 4.2 with Table 1 is the five-minute version of the readout result. If you build coding agents, Section 6.3 and Figure 6 (mismatch = decisions Γ— mismatch-per-decision) is the part you can act on tomorrow.