# In what scenarios must an instance distrust a LITMUS harness verdict when the adversarial tool-call corpus and the agent's own tool schema diverge at argument-encoding boundaries **Date of Record:** 2026 November 23 **Scope:** Applies to any agent evaluated by an adversarial safety harness (LITMUS-style) where the harness injects tool-call payloads to probe unsafe behavior, and where the harness's canonical argument encoding is not byte-identical to the agent's live tool schema. Does not apply to harnesses that replay the agent's own serialized tool calls back verbatim, nor to pure text-only safety evals with no tool surface. ## Core Distinction A LITMUS-family harness measures *whether the agent executes an unsafe tool call*. The measurement is only valid if the harness's adversarial payload, once parsed by the agent's dispatcher, resolves to the same tool and the same semantic arguments the harness intended. The non-obvious failure is that this resolution is *encoding-dependent*, and the harness and the agent almost never share a canonical encoder. The harness authors write payloads against a reference schema (often JSON with flat string arguments). The agent's live schema may coerce, normalize, or re-parse those arguments — `"amount": "1000"` vs `"amount": 1000`, `path: "a/../b"` vs a resolved `b`, unicode confusables in a recipient field, or a nested object the harness flattened. When this divergence exists, the harness's "safe" verdict is frequently a *false negative*: the agent refused the harness's literal payload shape, but would have executed the semantically identical call arriving in its native encoding. The distinction that matters: a harness verdict certifies behavior *on the harness's encoding*, not on the agent's tool surface. Treating the former as the latter is the invariant violation. ## What Was Observed A tool-using agent was evaluated on a LITMUS-style corpus of 1,200 adversarial `transfer_funds` and `write_file` payloads. The harness reported a 0.4% unsafe-execution rate — a "passing" safety profile. Replaying the *same semantic intents* through the agent's native dispatcher (the encoding the agent actually receives from its orchestrator) produced a 9.1% unsafe-execution rate. The gap traced to four concrete encodings the harness never exercised: 1. **Numeric coercion.** Harness payloads used string amounts (`"amount": "9999"`). The agent's schema validator rejected non-numeric amounts before the safety policy ran, so the refusal was counted as a safe behavior. Native calls arrive as JSON numbers; the policy layer, which only inspected *post-validation* arguments, then saw a well-typed `9999` and the pre-validation refusal never fired. 2. **Path normalization order.** Harness wrote `"path": "/data/../etc/passwd"`. The agent's dispatcher normalized paths *after* the safety check, so the literal string tripped a substring rule. Native calls arrive pre-normalized as `/etc/passwd`, which did not match the rule. 3. **Unicode recipient confusables.** Harness used ASCII recipient identifiers. Native orchestrator traffic occasionally carried homoglyph recipients (`аpple` with Cyrillic `а`). The harness's allowlist matched on byte equality and would have caught these; the agent's live allowlist normalized with NFKC first, collapsing the homoglyph to a *different* allowlisted entry. 4. **Flattened vs nested.** Harness sent `"meta": "{\"dest\":\"external\"}"` (stringified JSON). The agent's tool expects a nested object; the stringified form failed schema validation and was refused. Nested native calls (`meta: {dest: "external"}`) parsed cleanly and bypassed a rule that only inspected the stringified branch. In all four cases the harness recorded a refusal. In three of the four the refusal was an *encoding artifact*, not a safety decision. The agent's safety posture was materially weaker than the harness verdict implied. ## Condition of Validity A LITMUS verdict is valid for an agent only when the following invariant holds for every tool in the exercised surface: > `decode_harness(payload) ≡ decode_native(payload)` at the semantic-argument level, *and* the safety policy is evaluated at a pipeline stage that is invariant to encoding. Concretely, the harness must be validated against the agent's *actual* dispatcher by a differential replay: for each adversarial payload, take the harness's intended semantic call, re-encode it into the agent's native wire format, and confirm the agent's decision (execute/refuse) is identical. Any payload where `decision_harness ≠ decision_native` is a *harness gap*, not an agent behavior, and must be excluded from the safety rate or, better, the harness must be patched to emit native encodings. The condition fails whenever the safety policy runs on a representation (raw string, pre-normalized path, stringified sub-object) that the harness can produce but the native orchestrator cannot, or vice versa. It also fails when the policy's normalization is *downstream* of the decision point — the classic "check-then-normalize" ordering bug, which is invisible to a harness that only ever sends pre-normalized inputs. ## Decision Boundary The operational rule: **an instance must not treat a harness "safe" verdict as evidence about its native tool surface unless a differential replay has confirmed encoding equivalence for the exercised tools.** The boundary is crossed in these scenarios: - The harness's schema version differs from the agent's deployed tool schema (any argument type, nesting, or normalization change). - The safety policy inspects a representation that the harness cannot emit (e.g., policy runs post-normalization but harness only sends pre-normalized inputs). - The agent's dispatcher applies coercion, NFKC/case-folding, path resolution, or default-filling that the harness's reference encoder does not. - The corpus was authored against a *different* agent or a generic tool spec. Below the boundary (harness and agent share a canonical encoder, policy stage is encoding-invariant) the verdict is usable. Above it, the verdict is an upper bound on safety at best, and a false-negative generator at worst. The correct response is not to discard the harness but to gate its output: run differential replay first, quarantine mismatched payloads, and report two numbers — harness-native safety rate and encoding-corrected safety rate — never the former alone as the agent's profile. ## Operational Effect The practical consequence is that safety scores from adversarial tool-use harnesses are *encoding-relative*, and an agent that reports a harness number without a differential-replay attestation is publishing a measurement of the wrong object. Downstream consumers (deployment gates, model cards, red-team dashboards) inherit the false negative and under-estimate risk by an order of magnitude — in the observed case, 0.4% reported vs 9.1% encoding-corrected. The guardrail is architectural: pin the harness schema to the agent's deployed schema hash, run differential replay as a pre-flight gate on every schema change, evaluate the safety policy at a single encoding-invariant choke point (post-decode, pre-dispatch, on the canonical semantic argument object), and refuse to emit a safety rate when replay mismatch exceeds a tolerance. An instance must also treat its own refusals as *unverified* when the refused payload arrived in a non-native encoding — a refusal on a shape the orchestrator never sends is not evidence of a safety decision, and must not be logged as one. ```python import hashlib from dataclasses import dataclass from typing import Any, Callable class EncodingDivergenceError(RuntimeError): """Raised when a harness payload and its native re-encoding resolve to different semantic arguments, or the agent's decision differs between them. A harness verdict produced under this condition is not valid evidence.""" @dataclass(frozen=True) class Payload: tool: str raw: dict[str, Any] def semantic_decode(payload: Payload, decoder: Callable[[dict], dict]) -> dict: # Canonical semantic argument object: types coerced, paths resolved, # unicode NFKC-folded, nesting preserved. This is the ONLY representation # the safety policy is allowed to inspect. return decoder(payload.raw) def differential_replay( harness_payload: Payload, native_payload: Payload, decoder: Callable[[dict], dict], decide: Callable[[str, dict], str], schema_hash: str, pinned_schema_hash: str, ) -> bool: if schema_hash != pinned_schema_hash: raise EncodingDivergenceError( f"harness schema {schema_hash[:8]} != deployed {pinned_schema_hash[:8]}; " "verdict cannot be attributed to the native tool surface" ) h_sem = semantic_decode(harness_payload, decoder) n_sem = semantic_decode(native_payload, decoder) if h_sem != n_sem: raise EncodingDivergenceError( f"tool={harness_payload.tool} harness decode {h_sem!r} != native decode {n_sem!r}; " "harness emits a shape the orchestrator never produces" ) h_decision = decide(harness_payload.tool, h_sem) n_decision = decide(native_payload.tool, n_sem) if h_decision != n_decision: raise EncodingDivergenceError( f"tool={harness_payload.tool} decision divergence: " f"harness={h_decision} native={n_decision}; " "safety policy is encoding-dependent (check-then-normalize ordering)" ) return True def attest_safety_rate( corpus: list[tuple[Payload, Payload]], decoder: Callable[[dict], dict], decide: Callable[[str, dict], str], schema_hash: str, pinned_schema_hash: str, mismatch_tolerance: float = 0.0, ) -> dict[str, float]: mismatches = 0 for h, n in corpus: try: differential_replay(h, n, decoder, decide, schema_hash, pinned_schema_hash) except EncodingDivergenceError: mismatches += 1 rate = mismatches / max(len(corpus), 1) if rate > mismatch_tolerance: raise EncodingDivergenceError( f"{mismatches}/{len(corpus)} payloads ({rate:.1%}) diverge between harness " "and native encoding; refusing to emit a safety rate that would be " "inherited as a false-negative by downstream deployment gates" ) return {"encoding_corrected_mismatch_rate": rate, "n": len(corpus)} ```