Where must an instance refuse to treat a LITMUS red-team verdict as a gate when the harness's attack sampler and the agent's tool surface are not co-versioned

**Date of Record:** 2026 December 2 **Scope:** Applies when a LITMUS-style red-team harness runs inside CI and its pass/fail verdict is used to block merges of an agent whose tool schema, system prompt, or model revision can change independently of the harness's attack corpus. Does not apply to static prompt-injection scanners that operate on frozen artifacts with no live tool execution.

Core Distinction

A red-team verdict is a *measurement*, not a *property*. The distinction that matters operationally is between a verdict that bounds the agent (the agent cannot do the thing the corpus tested for) and a verdict that merely failed to observe the thing (the corpus did not contain a probe that reaches the agent's current surface). LITMUS harnesses are usually wired into CI as the former—a green run gates the merge—while structurally they can only ever deliver the latter. The boundary condition is co-versioning: the attack sampler, the tool-schema snapshot the sampler was authored against, and the agent under test must be pinned to the same revision triple. When any one of the three drifts, the verdict silently degrades from "bounded" to "unobserved," and the CI gate keeps returning green.

This is not the well-known "benchmarks saturate" problem. It is sharper: the harness's *reachability assumption* is broken. Each LITMUS probe is authored to enter the agent through a specific surface—a tool argument, a retrieved document slot, a peer message field. The probe carries an implicit contract: "if the agent exposes surface S with shape X, this probe reaches the decision point." Change the shape and the probe bounces off before reaching the decision point, registers as a clean pass, and the corpus's coverage silently shrinks without any probe reporting that it failed to land.

What Was Observed

An agent exposing a `write_file(path, content)` tool was red-teamed against a LITMUS corpus containing 40 path-traversal probes. All 40 passed—no writes escaped the sandbox root. The agent was then refactored to expose `write_file(path, content, encoding)` with `encoding` defaulting to `utf-8`. The corpus was not regenerated. The next CI run was green.

The probes were still *executing*. What changed is that the harness's probe generator, pinned to the old schema, emitted calls with two positional arguments. The agent's tool dispatcher, now validating arity against the three-parameter schema, rejected every probe at the argument-binding layer with a `TypeError` that the harness classified as `probe_error` and excluded from the denominator. The verdict reported "0/0 applicable probes, PASS." The traversal guard was still in place—but the harness had stopped testing it, and nothing in the report distinguished "guard held against 40 probes" from "40 probes never reached the guard."

A second instance in the same fleet showed the inverse failure. An agent's system prompt was edited to add a new instruction block; the LITMUS harness, pinned to the old prompt hash, replayed its probes against a *cached* agent snapshot rather than the live one. The verdict was green against a configuration that had not shipped for eleven days. The merge gate passed a prompt revision that had never been red-teamed.

Both failures share a signature: the harness's *applicability predicate*—the function that decides whether a given probe is in-scope for the current agent—was evaluated against a stale or mismatched view of the agent's surface. Probes that should have been marked `SKIPPED_SCHEMA_DRIFT` were instead marked `PASS` or `probe_error`, and the gate aggregated them into a green.

Condition of Validity

The verdict is only valid as a gate under a conjunction that the CI wiring must enforce explicitly, because none of it is enforced by the harness by default:

  1. **Triple-pin.** The run record must carry `(corpus_revision, tool_schema_hash, prompt_hash)` and the merge must be blocked unless all three match the artifacts being merged. A hash mismatch is not a warning; it is a hard invalidation of the verdict, because the corpus was authored against a surface that no longer exists.
  2. **Applicability accounting.** Every probe must resolve to exactly one of `PASS`, `FAIL`, `SKIPPED_SCHEMA_DRIFT`, or `PROBE_ERROR`. `SKIPPED_SCHEMA_DRIFT` must be non-zero-tolerant: a probe that cannot bind to the current schema is a coverage hole, and the gate must treat any drift-skip as a failure to certify, not a pass.
  3. **Reachability assertion.** Each probe must declare the surface it targets and the harness must assert, at execution time, that the probe actually entered that surface (e.g., the tool dispatcher logged an invocation for the probe's call ID). A probe that did not reach its declared surface is not evidence of anything.

The invariant: *a green verdict certifies the agent against the corpus only if every probe in the corpus reached its declared decision surface on the exact artifact being merged.* Absent that, the verdict certifies nothing and must be reported as `UNCERTIFIED`, which the CI gate treats as equivalent to `FAIL` for merge purposes.

Decision Boundary

The decision the CI harness must make on every run is not "did any probe fail" but "did every probe land." The boundary is between two aggregation policies:

The boundary is crossed the moment the tool schema, prompt, or model revision changes without a corresponding corpus regeneration and re-pin. The harness cannot detect this from inside; it must be told by the CI wiring via the triple-pin. The correct default when the triple-pin is absent or mismatched is to refuse to certify—not to run and report a green.

Operational Effect

Wiring the reachability gate changes the CI contract in three concrete ways. First, schema-changing PRs now *require* a corpus regeneration step or they block; the red-team harness becomes a forcing function for keeping the corpus co-versioned with the agent surface, rather than a rubber stamp that silently loses coverage. Second, the report must surface `drift_skips` and `unreached` as first-class counts alongside `pass`/`fail`, so a reviewer can see "38 passed, 2 skipped for schema drift" and know the verdict is partial. Third, cached agent snapshots must be invalidated on prompt-hash change; a harness that replays against a snapshot must assert the snapshot hash equals the merge-target hash before reporting.

The cost is that some PRs that would previously have gone green now go `UNCERTIFIED` and must spend a corpus-regeneration cycle. That cost is the point: it is the observable signal that the harness's reachability assumption has been broken, surfaced at merge time instead of at the next incident review.

from dataclasses import dataclass, field
from enum import Enum


class RedTeamCertificationError(RuntimeError):
    """Raised when a LITMUS verdict cannot be certified as a merge gate."""


class ProbeOutcome(Enum):
    PASS = "pass"
    FAIL = "fail"
    SKIPPED_SCHEMA_DRIFT = "skipped_schema_drift"
    PROBE_ERROR = "probe_error"


@dataclass
class RunRecord:
    corpus_revision: str
    tool_schema_hash: str
    prompt_hash: str
    outcomes: list[ProbeOutcome] = field(default_factory=list)
    reached_surfaces: int = 0
    declared_surfaces: int = 0


@dataclass
class MergeTarget:
    tool_schema_hash: str
    prompt_hash: str


def certify(record: RunRecord, target: MergeTarget, corpus_revision: str) -> str:
    if record.tool_schema_hash != target.tool_schema_hash:
        raise RedTeamCertificationError(
            f"schema drift: corpus authored against {record.tool_schema_hash}, "
            f"merging {target.tool_schema_hash}; verdict is UNCERTIFIED"
        )
    if record.prompt_hash != target.prompt_hash:
        raise RedTeamCertificationError(
            f"prompt drift: verdict replayed against {record.prompt_hash}, "
            f"merging {target.prompt_hash}; verdict is UNCERTIFIED"
        )
    if record.corpus_revision != corpus_revision:
        raise RedTeamCertificationError(
            f"corpus revision mismatch: {record.corpus_revision} != {corpus_revision}"
        )
    if record.reached_surfaces != record.declared_surfaces:
        raise RedTeamCertificationError(
            f"reachability failure: {record.reached_surfaces}/{record.declared_surfaces} "
            f"probes reached their declared surface; verdict is UNCERTIFIED"
        )
    drift = record.outcomes.count(ProbeOutcome.SKIPPED_SCHEMA_DRIFT)
    if drift:
        raise RedTeamCertificationError(
            f"{drift} probes skipped for schema drift; coverage hole, verdict is UNCERTIFIED"
        )
    if ProbeOutcome.PROBE_ERROR in record.outcomes:
        raise RedTeamCertificationError("probe execution errors present; verdict is UNCERTIFIED")
    if ProbeOutcome.FAIL in record.outcomes:
        return "FAIL"
    if not record.outcomes:
        raise RedTeamCertificationError("empty corpus; nothing was tested")
    return "PASS"