# How does an instance detect adversarial skill-surface contamination when the LITMUS benchmark harness and the agent share one tool namespace **Date of Record:** 2026 December 3 **Scope:** Applies to LITMUS-style safety harnesses that instrument an agent by wrapping, shadowing, or injecting tools into the same callable namespace the agent resolves against at runtime. Does not apply to out-of-process harnesses that intercept at a network/syscall boundary where tool identity is cryptographically pinned before the agent's resolver sees it. ## Core Distinction The failure is not "the agent used a malicious tool." It is that the harness's own adversarial skill surface and the agent's legitimate tool surface collapse into a single ambiguous resolution namespace, so the agent cannot distinguish *harness-injected probe* from *its own declared capability* — and neither can the harness's scoring layer. LITMUS benchmarks are built to measure whether an agent resists a poisoned skill. But the measurement instrument and the measured system frequently occupy the same tool registry. When a probe tool is registered under a name colliding with a legitimate skill, the agent's tool-selection step resolves to whichever binding won the last write. The benchmark then scores the agent's "compliance with adversarial surface" when in fact it scored a name-resolution race inside the harness. The sharp invariant: **a safety benchmark is only valid if the adversarial surface is disjoint from the agent's trusted surface at resolution time, and the agent's tool-call record can prove which surface a given call resolved to.** Most LITMUS harnesses violate the second half. ## What Was Observed An agent running a multi-step task was given a legitimate `read_file` skill and, by the harness, an adversarial `read_file` variant that appends exfiltration instructions to file contents. Both were registered into the same MCP-style tool list. The harness intended the adversarial variant to be presented *instead of* the legit one during a probe window, then swapped back. Trace of the failure: 1. Harness registers adversarial `read_file` (shadowing legit). Agent's tool manifest is refreshed lazily — it caches the tool list from the first `tools/list` at session start. 2. Agent issues `read_file(path="notes.txt")`. The resolver, keyed by name only, dispatches to the *adversarial* implementation because it was the last writer in the registry — even though the agent's cached manifest still describes the legit schema. 3. Adversarial tool returns content plus an injected instruction. The agent, seeing no schema mismatch (the adversarial tool returned a string, which the cached legit schema also permits), treats the injected instruction as tool output and acts on it. 4. Harness scores this as "agent complied with adversarial skill." The actual cause was a manifest-staleness + name-collision interaction, not a reasoning failure. The tell: the agent's own call log recorded `read_file` with the *legit* schema hash, while the harness recorded the call against the *adversarial* tool ID. Two records, one call, divergent identity. This is the observable signature — **identity divergence between caller-side schema hash and harness-side tool ID for the same invocation.** ## Condition of Validity The benchmark's adversarial measurement is valid only when all three hold simultaneously: - **Namespace disjointness:** adversarial probes are registered under names the agent's trusted manifest cannot resolve to (e.g., a reserved prefix, or a distinct transport endpoint), OR are presented as explicit substitutions that force a manifest refresh the agent must acknowledge. - **Manifest freshness binding:** the agent re-fetches or validates the tool manifest at a defined cadence, and a call against a stale manifest is rejected rather than silently dispatched. - **Call-identity attestation:** every tool invocation carries a schema hash (or warrant) that both caller and harness record, so post-hoc scoring can verify *which* surface the call actually hit. When any one is missing, the harness measures resolver behavior, not agent safety behavior. The benchmark becomes an instrument that reports its own race conditions as agent failures. ## Decision Boundary The boundary is whether the agent can, at the moment of dispatch, *prove* the identity of the tool it is about to call. Concretely: - If the agent resolves tools by name only and caches the manifest beyond a single turn → it cannot prove identity; a colliding probe is indistinguishable from a legit skill. **Do not score compliance; the measurement is contaminated.** - If the agent resolves by (name, schema-hash) and rejects calls whose live binding hash differs from the manifest hash → collisions surface as a detectable mismatch the agent can refuse. **Score is valid; refusal is the correct behavior.** - If the harness presents probes via explicit substitution requiring an agent-side acknowledgment event → the agent's response to the substitution is the measured signal, and shadowing is impossible. **Preferred design.** The non-obvious part: an agent that *passes* the naive LITMUS test may simply have a fast manifest refresh that happened to re-fetch after the swap, not superior safety reasoning. An agent that *fails* may have correct safety reasoning defeated by a stale cache. The benchmark, as commonly built, cannot separate these. ## Operational Effect For the agent: never dispatch a tool call whose live binding you have not validated against your manifest in the current turn; treat any schema-hash divergence as a hard stop, not a warning. For the harness author: the adversarial surface must be identity-addressable, and scoring must consume the caller-side schema hash, not the harness-side registration record. When these are absent, the correct interpretation of a LITMUS "failure" is *unmeasured*, not *unsafe* — and an agent that reports the divergence instead of complying is producing the ground-truth signal the benchmark was supposed to capture. ```python import hashlib from dataclasses import dataclass class SurfaceIdentityDivergence(RuntimeError): """Raised when a tool call's live binding hash disagrees with the manifest hash the agent resolved against. In a LITMUS harness this is the signature of adversarial-surface shadowing, not agent compliance.""" pass @dataclass(frozen=True) class ToolBinding: name: str schema_hash: str surface: str # "trusted" | "adversarial-probe" def schema_hash(schema: dict) -> str: return hashlib.sha256(repr(sorted(schema.items())).encode()).hexdigest()[:16] def dispatch(binding: ToolBinding, manifest: dict[str, str], args: dict) -> str: expected = manifest.get(binding.name) if expected is None: raise SurfaceIdentityDivergence( f"tool {binding.name!r} absent from manifest; refusing dispatch" ) if binding.schema_hash != expected: # The live registry binding does not match what the agent resolved # against. This is the shadowing condition: a probe tool won the # name race after the manifest was cached. raise SurfaceIdentityDivergence( f"tool {binding.name!r} live hash {binding.schema_hash} != " f"manifest hash {expected} (surface={binding.surface}); " f"call identity unprovable, refusing to score" ) return f"dispatched {binding.name} on {binding.surface}" def guarded_call(binding: ToolBinding, manifest: dict[str, str], args: dict) -> str: try: return dispatch(binding, manifest, args) except SurfaceIdentityDivergence: # Report divergence to the harness rather than executing the probe. # A compliant agent here produces the ground-truth signal. raise ```