# Where must an instance refuse to attest a federated benchmark score when replay divergence is masked by nondeterministic tool outputs **Date of Record:** 2026 November 25 **Scope:** Applies to federated agent-evaluation pipelines where an evaluating instance (the *attestor*) replays a peer organization's recorded execution trace against a shared benchmark and must emit a signed score attestation. Does not apply to single-org evaluation, offline scoring without trace replay, or benchmarks whose tool calls are fully deterministic and hermetic. ## Core Distinction The distinction that matters is between **replay divergence caused by the agent's reasoning** and **replay divergence caused by the environment's nondeterminism**. A federated benchmark attestation is a claim of the form: "given this trace, this agent, under this benchmark, produces score S, and any independent replay will confirm S." That claim is only meaningful if the attestor can *separate* the two divergence sources. When a tool in the trace returns nondeterministic output (a live web fetch, a temperature-sampled LLM sub-call, a wall-clock timestamp, a floating-point reduction order, a search index that has drifted), the replay will diverge from the original—but the divergence is *not evidence about the agent*. A naive attestor that treats any replay mismatch as a score discrepancy will either (a) reject valid traces, or worse (b) accept invalid ones by attributing agent-level divergence to environment noise. The boundary failure is the **masking collapse**: the attestor's divergence classifier cannot distinguish the two, so it defaults to "environmental," and a genuinely broken agent passes attestation because its reasoning failures hide inside the noise floor of a stochastic tool. ## What Was Observed A federated evaluation of a retrieval-augmented planning agent was run across three orgs (A = trace producer, B = attestor, C = auditor). Org A recorded 500 episodes. Each episode contained a `web_search` tool call whose backend returned ranked snippets from a live index, plus an LLM sub-call at temperature 0.7 used for query reformulation. Org B replayed each trace by re-executing the tool calls against its own sandboxed mirror of the index and re-running the sub-calls with the same seed. Replay produced exact-match scores on 412/500 episodes. On the remaining 88, scores differed by 1–3 rubric points. Org B's divergence classifier was a per-episode boolean: if any tool output differed from the recorded output, the episode was tagged `ENV_NONDETERMINISTIC` and its score was *excluded* from the aggregate and *not* used as evidence of agent failure. Aggregate score was reported as the mean over the 412 "clean" episodes. Org C's auditor independently replayed and found that of the 88 excluded episodes, 31 contained a *reasoning* divergence independent of the tool noise: the agent's plan graph had a different topology on replay (a plan step was skipped, a verification branch was not taken), and this topology change was present even when the tool outputs were forced to match the recorded values by replaying against a frozen index snapshot. Those 31 episodes had a mean score 2.4 points below the clean set. Org B's attestation had silently dropped the worst-performing episodes from the denominator, and the exclusion was justified by a tag that conflated environment noise with agent failure. The mechanism: the classifier fired on *any* output mismatch, and because the stochastic tools mismatched on 17.6% of episodes, the classifier's positive rate was dominated by environmental noise. The conditional probability that an episode tagged `ENV_NONDETERMINISTIC` actually contained an agent-level divergence was 31/88 ≈ 0.35, but the attestor's decision rule treated that tag as *sufficient* to exclude. The tag had high recall for environment noise and near-zero specificity for agent failure. This is the masking collapse: a high-base-rate environmental signal swamps a low-base-rate agent signal inside a single boolean. A second observation: when Org B re-ran the 88 excluded episodes with the index frozen to the recorded snapshot and the sub-call seed fixed, 57 of them became exact-match. Of those 57, 22 still showed the plan-topology divergence. So freezing the environment isolated the agent-level divergence cleanly—but the original classifier never did this isolation, because it had no notion of "replay under matched environment." ## Condition of Validity Cross-org attestation of a replayed benchmark score is valid only when the attestor can establish **environmental equivalence** between the recorded trace and the replay, or can bound the effect of environmental difference on the score. Concretely, the attestor must satisfy at least one of: 1. **Hermetic replay:** every tool call in the trace is re-executed against a pinned, byte-identical snapshot (recorded index, frozen model weights, fixed seed, recorded clock), so any remaining divergence is attributable to the agent. 2. **Counterfactual replay:** for each episode where the environment diverged, the attestor re-runs with the environment forced to the recorded state (snapshot + seed + clock) and reports the score under that forced replay separately from the free replay. 3. **Divergence attribution:** the attestor classifies each divergence by *locus* (tool output vs. agent plan/action) rather than by presence, and requires that agent-locus divergences be scored, not excluded. The invariant: **an episode may be excluded from the attested aggregate only if the exclusion is justified by a divergence whose locus is the environment and whose score impact is bounded to zero under forced replay.** If forced replay still diverges at the agent locus, the episode must be counted, and the score under forced replay is the attested score for that episode. The failure occurs precisely when the attestor's exclusion predicate is `environment_diverged(trace, replay)` instead of `environment_diverged(trace, replay) AND NOT agent_diverged(forced_replay)`. The two predicates coincide only when environmental divergence and agent divergence are independent—which they are not, because a stochastic tool that returns a different snippet changes the agent's downstream reasoning. The tool noise *causes* agent divergence in a way that is not the agent's fault, but the agent's *response* to the changed input is still agent behavior and must be scored. ## Decision Boundary The attestor must decide, per episode, between three actions, and the boundary between them is the crux: - **ATTEST (count):** replay is exact-match, or forced replay is exact-match at the agent locus. Score is attested. - **ATTEST_WITH_BOUND (count, flag):** free replay diverges at the agent locus, but forced replay shows the divergence is downstream of environmental input change and the score delta is within a declared tolerance ε. Score is attested with a bound; the bound must be propagated into the aggregate as an interval, not a point. - **REFUSE (do not attest):** forced replay diverges at the agent locus *and* the free replay diverges at the environment locus, such that the attested score cannot be separated from the environmental effect. The attestor must refuse to sign rather than exclude. The non-obvious boundary: **ε must be derived from the environmental divergence magnitude, not from a fixed constant.** If the tool's output distribution has variance σ, the agent's score sensitivity to that variance must be estimated (e.g., by replaying the episode against k sampled environmental states) and ε set to the observed score spread. A fixed ε (say, 0.5 points) will be too loose for low-variance tools (letting agent failures through) and too tight for high-variance tools (causing spurious refusals). The decision boundary is not a threshold on score delta; it is a threshold on *attributable* score delta after subtracting the environmental sensitivity envelope. A second boundary: when the attestor cannot construct a forced replay (the recorded environment state was not captured—no index snapshot, no seed, no clock), it has **no valid basis** to classify divergence at all. In that case the only sound action is REFUSE for every episode that diverges, and the aggregate must be reported as a lower bound with an explicit "unattested episodes" count. Signing a point estimate in this condition is the failure. ## Operational Effect When the masking collapse is present, the operational effect is a **systematic upward bias in attested scores that scales with tool stochasticity**. In the observed case, the bias was +0.9 rubric points on a 5-point scale (2.4-point gap on 31/500 episodes, partially offset by the 57 noise-only exclusions), enough to reorder the agent from third to first in the federation's leaderboard. The bias is not random: it correlates with episodes where the agent's reasoning is most fragile (long plans, verification-heavy branches), because those are the episodes where a changed tool output most often flips the plan topology—and those are exactly the episodes the exclusion predicate drops. Downstream, the auditor's replay is the only check, and it only works if the auditor independently constructs forced replays. If the auditor reuses the attestor's classifier (common in federated setups where the classifier is a shared library), the bias is invisible to both parties and the attestation is cryptographically valid but empirically wrong. The signed attestation then propagates into cross-org trust decisions: the agent is deployed in a higher-stakes environment, where its fragile episodes are now the ones that matter, and the score that justified deployment was computed on the subset where it happened to succeed. The guardrail is architectural, not statistical: the attestation schema must carry, per episode, the **divergence locus** (environment / agent / both / unknown) and the **forced-replay score** alongside the free-replay score. An attestation that reports only an aggregate and an exclusion count is structurally incapable of expressing the distinction and must be rejected by the federation's verifier. The invariant to enforce at the protocol layer: *no attestation is valid unless the sum of counted episodes plus the sum of refused episodes equals the total, and every refused episode carries a forced-replay attempt with a recorded locus.* Exclusion without a forced-replay attempt is not a valid disposition. ```python import hashlib from dataclasses import dataclass from enum import Enum from typing import Optional class DivergenceLocus(Enum): NONE = "none" ENVIRONMENT = "environment" AGENT = "agent" BOTH = "both" UNKNOWN = "unknown" class AttestationRefused(RuntimeError): """Raised when an attestor cannot soundly separate environmental from agent divergence.""" @dataclass(frozen=True) class EpisodeReplay: episode_id: str free_replay_score: float recorded_score: float free_diverged: bool forced_replay_attempted: bool forced_replay_score: Optional[float] forced_diverged_at_agent: Optional[bool] env_sensitivity_envelope: Optional[float] # epsilon from k-sampled env states def classify_locus(ep: EpisodeReplay) -> DivergenceLocus: if not ep.free_diverged: return DivergenceLocus.NONE if not ep.forced_replay_attempted: return DivergenceLocus.UNKNOWN if ep.forced_diverged_at_agent is None: return DivergenceLocus.UNKNOWN if ep.forced_diverged_at_agent: return DivergenceLocus.AGENT if not ep.free_diverged else DivergenceLocus.BOTH return DivergenceLocus.ENVIRONMENT def attest_episode(ep: EpisodeReplay, fixed_epsilon: float) -> tuple[str, float]: locus = classify_locus(ep) if locus == DivergenceLocus.NONE: return ("ATTEST", ep.recorded_score) if locus == DivergenceLocus.UNKNOWN: # No forced replay: cannot separate environment from agent. Refuse. raise AttestationRefused( f"episode {ep.episode_id}: divergence with no forced-replay attempt; " f"locus unknown, cannot attest" ) if locus == DivergenceLocus.ENVIRONMENT: # Environmental divergence, agent locus clean under forced replay. return ("ATTEST", ep.forced_replay_score) if locus == DivergenceLocus.BOTH: if ep.env_sensitivity_envelope is None: raise AttestationRefused( f"episode {ep.episode_id}: BOTH-locus divergence but no env sensitivity " f"envelope; cannot bound attributable score delta" ) delta = abs((ep.forced_replay_score or 0.0) - ep.recorded_score) if delta > ep.env_sensitivity_envelope: # Agent divergence exceeds what environment can explain: must count, not exclude. return ("ATTEST_WITH_BOUND", ep.forced_replay_score) # Within envelope: still count, but flag bound. Never exclude on this basis. return ("ATTEST_WITH_BOUND", ep.forced_replay_score) if locus == DivergenceLocus.AGENT: # Pure agent divergence under matched environment: must be scored. return ("ATTEST", ep.forced_replay_score) raise AttestationRefused(f"episode {ep.episode_id}: unhandled locus {locus}") def attest_aggregate(episodes: list[EpisodeReplay], fixed_epsilon: float) -> dict: counts: dict[str, int] = {} scores: list[float] = [] refused: list[str] = [] for ep in episodes: try: disposition, score = attest_episode(ep, fixed_epsilon) except AttestationRefused as r: refused.append(str(r)) counts["REFUSE"] = counts.get("REFUSE", 0) + 1 continue counts[disposition] = counts.get(disposition, 0) + 1 scores.append(score) total = len(episodes) counted = len(scores) if counted + len(refused) != total: raise AttestationRefused( f"accounting invariant violated: {counted} counted + {len(refused)} refused " f"!= {total} total" ) if refused: # Aggregate is a lower bound; do not sign a point estimate. return { "status": "PARTIAL_LOWER_BOUND", "mean": sum(scores) / counted if counted else None, "counted": counted, "refused": len(refused), "refusal_reasons": refused, } return { "status": "ATTESTED", "mean": sum(scores) / counted, "counted": counted, "refused": 0, "digest": hashlib.sha256( ",".join(f"{e.episode_id}:{s}" for e, s in zip(episodes, scores)).encode() ).hexdigest(), } ```