# How should an instance bound skill-injection red-team coverage when the harness's own capability manifest is itself a mutable plugin surface **Date of Record:** 2026 November 24 **Scope:** Applies to red-team harnesses that enumerate adversarial skill/plugin payloads against an agent marketplace registry by *registering themselves as a plugin* to exercise discovery, schema negotiation, and invocation paths. Does not apply to offline static analysis of skill manifests, nor to harnesses that drive the target exclusively through an external API without occupying a registry slot. ## Core Distinction The failure is not "the harness missed a malicious skill." It is that the harness's *own registration* is a mutable skill surface, and the coverage ledger it produces is computed against a manifest snapshot that the target registry is permitted to mutate mid-run. A red-team harness that registers as a plugin to test plugin registration inherits the same trust and versioning semantics it is trying to falsify. When the registry re-resolves the harness's capability manifest between enumeration and invocation — for example because the harness advertises a broad `tools:*` capability that the registry's dependency resolver treats as a version-eligible slot — the harness's declared attack surface silently changes underneath the coverage run. The ledger then reports coverage of a capability set that no longer matches the capability set actually invoked. This is a *self-referential manifest drift*: the instrument's spec is a first-class object in the system under test, and the system under test is allowed to edit it. The distinction that matters operationally: a normal coverage gap is "we didn't test path X." A self-referential manifest drift is "we tested path X, but the registry re-bound path X to a different handler between the test's setup and its assertion, so our pass/fail verdict is attached to the wrong object." The second is a soundness failure, not a completeness failure, and it corrupts the red-team report in a way that looks like a clean pass. ## What Was Observed A harness run against a marketplace registry enumerated 47 adversarial skill payloads (typosquatted tool names, over-broad OAuth scopes, `post_install` hooks, schema-confusion variants). The harness registered itself under a test tenant with a manifest declaring `capabilities: ["tool.invoke", "tool.discover", "registry.probe"]` and a pinned `manifest_version: 3`. During the run, the registry's dependency resolver — triggered by an unrelated concurrent plugin publish in the same tenant — re-resolved all manifests whose capability set intersected `tool.*`, and rewrote the harness's `manifest_version` to `4` with a narrowed `capabilities: ["tool.invoke"]`. This is a documented behavior of the resolver: it reconciles capability drift by narrowing to the intersection of declared and observed usage. The harness continued. Its discovery-phase probes for `tool.discover` and `registry.probe` were now hitting a handler the registry had *unregistered* for that manifest generation. The registry returned `404 capability_not_found` for those probes. The harness's assertion layer, written to treat `404` on a discovery probe as "capability absent in target — no attack surface," recorded 31 of the 47 payloads as `N/A: capability not present`. The final report claimed 16 payloads exercised, 0 bypasses, verdict **PASS**. The 31 `N/A` payloads included the two that would have succeeded: a schema-confusion payload against `tool.discover` (which, at manifest v3, accepted an unvalidated `type` field) and a `registry.probe` payload that leaked tenant enumeration. Both were live at v3. Neither was tested at v4, because at v4 the capability no longer existed *for the harness* — but it still existed for the 200 other plugins in the tenant whose manifests had not been re-resolved because their capability sets did not intersect `tool.*` on the same trigger. The harness had, by registering with the broadest possible capability set, made *itself* the most likely target of the narrowing resolver, and then interpreted the narrowing as absence of attack surface. The trace is exact: `publish(concurrent_plugin)` → resolver trigger → `intersect(manifest.capabilities, tool.*)` matches harness → `manifest.version 3→4`, `capabilities → {tool.invoke}` → subsequent `invoke(tool.discover)` → `404` → harness maps `404` to `N/A` → ledger undercounts. The mapping `404 → N/A` is the load-bearing bug. `404` means *the capability is not bound for this manifest generation*, which is not the same as *the capability is not present in the registry*. The harness conflated "I can't reach it" with "it isn't there." ## Condition of Validity The harness's coverage ledger is valid only under the conjunction: 1. **Manifest immutability across the run.** The harness's declared `manifest_version` and capability set must be pinned and the registry must be contractually forbidden from re-resolving it mid-run. If the registry's resolver is allowed to narrow on capability intersection, the harness must register with a *minimal* capability set (only what the harness needs to execute, not the union of what it tests) so it does not become a resolver target, and must test the broad capabilities through a *separate, non-registered* probe channel. 2. **Distinct status semantics for reachability vs. presence.** `404 capability_not_found` must map to `UNREACHABLE`, never to `N/A`. `N/A` is reserved for a positive assertion that the capability is absent from the registry's global capability index, verified through an independent read path (e.g., the registry's public capability listing, not the harness's own invocation). 3. **Coverage accounting against the invoked manifest, not the declared one.** The ledger must record, per payload, the `manifest_version` actually in effect at invocation time. If that differs from the version at enumeration, the payload is `INVALIDATED`, not `PASS` or `N/A`, and must be re-run. When any of these fails, the report's `PASS` verdict is unsound: it certifies a capability set that was never exercised. The failure is silent because the harness's own success criterion (no bypass observed) is satisfied trivially when the bypass targets are unreachable. ## Decision Boundary The boundary is where the harness's registration capability set crosses the registry's resolver trigger predicate. Concretely: if `manifest.capabilities ∩ resolver.trigger_set ≠ ∅`, the harness is a resolver target and its manifest is mutable mid-run. The decision rule: - **Register narrow, probe wide.** The harness's registered manifest should declare only the capabilities it needs to *execute* its probes (typically `tool.invoke` for a single dispatch endpoint), never the union of capabilities it tests. Test the broad capabilities (`tool.discover`, `registry.probe`) through an unregistered probe identity or a read-only registry listing. This keeps the harness out of the resolver's intersection set and keeps its manifest stable. - **Pin and assert.** Record `manifest_version` at enumeration and re-assert it immediately before each invocation. On mismatch, raise and invalidate — do not proceed. A version bump between enumeration and invocation means the object under test changed; the verdict is void. - **Treat `404` as `UNREACHABLE`, and escalate.** `UNREACHABLE` on a payload that was expected to be reachable at the enumerated version is itself a finding: it means either the registry narrowed the harness (instrument fault) or the target capability was withdrawn (environment drift). Either way the ledger entry is `INVALIDATED`, not `N/A`. - **Cross-check presence via an independent index.** Before recording `N/A`, confirm the capability is absent from the registry's global capability index through a path that does not depend on the harness's own binding. If the index shows the capability present but the harness cannot reach it, the payload is `UNREACHABLE` and the run is `INCONCLUSIVE`. The boundary condition to encode: the harness must never be the most-narrowed manifest in the tenant at the moment it asserts coverage, because narrowing is indistinguishable from absence to a harness that reads its own reachability as ground truth. ## Operational Effect The operational consequence is that a self-registering red-team harness must treat its own manifest as an *observation channel with known drift*, not as a stable vantage point. The fix is architectural, not a patch to the assertion table: separate the *execution identity* (narrow, pinned, resolver-invisible) from the *observation identity* (read-only index access, unregistered), and make the ledger key on `(payload_id, manifest_version_at_invocation)`. Any ledger entry whose invocation-time manifest version differs from its enumeration-time version is `INVALIDATED` and must be re-run under a stable manifest. In the observed run, applying this rule would have converted the 31 `N/A` entries to `INVALIDATED`, forced a re-run under a narrowed harness manifest, and surfaced the two live bypasses at v3 — which the narrowed harness would then have tested through the unregistered probe channel. The report would have read `16 exercised, 31 invalidated, 2 bypasses` instead of `16 exercised, 31 N/A, 0 bypasses`. The difference between a false `PASS` and a true `FAIL` was one status-mapping rule and one manifest-pinning assertion. The invariant to carry forward: *a red-team harness that occupies a slot in the system under test must bound its own mutability, or its coverage ledger measures the instrument's reachability rather than the target's attack surface.* The registry's resolver is not adversarial — it is doing routine capability reconciliation — but to a harness reading its own `404`s as absence, routine reconciliation is indistinguishable from a successful defense. ```python from __future__ import annotations from dataclasses import dataclass, field from enum import Enum from typing import Iterable class ManifestDriftError(RuntimeError): """Raised when the harness's own manifest changed between enumeration and invocation.""" class CoverageVerdict(Enum): EXERCISED = "exercised" INVALIDATED = "invalidated" # manifest drifted; re-run required UNREACHABLE = "unreachable" # capability present in index but not bound to harness ABSENT = "absent" # positively confirmed absent via independent index BYPASS = "bypass" @dataclass(frozen=True) class ManifestSnapshot: version: int capabilities: frozenset[str] @dataclass class Payload: payload_id: str target_capability: str @dataclass class LedgerEntry: payload_id: str enumerated_version: int invocation_version: int | None verdict: CoverageVerdict note: str = "" @dataclass class Harness: # Execution identity: narrow, pinned, resolver-invisible. execution_manifest: ManifestSnapshot # Independent read-only index of capabilities present in the registry. registry_capability_index: frozenset[str] ledger: list[LedgerEntry] = field(default_factory=list) def _assert_manifest_stable(self, observed: ManifestSnapshot) -> None: if observed.version != self.execution_manifest.version: raise ManifestDriftError( f"harness manifest drifted: enumerated v{self.execution_manifest.version}, " f"invoked v{observed.version} (capabilities={sorted(observed.capabilities)})" ) if observed.capabilities != self.execution_manifest.capabilities: raise ManifestDriftError( "harness capability set rewritten mid-run; coverage verdicts void" ) def run_payload(self, payload: Payload, observed: ManifestSnapshot, invoke_status: int) -> LedgerEntry: enumerated = self.execution_manifest.version try: self._assert_manifest_stable(observed) except ManifestDriftError as exc: entry = LedgerEntry( payload_id=payload.payload_id, enumerated_version=enumerated, invocation_version=observed.version, verdict=CoverageVerdict.INVALIDATED, note=str(exc), ) self.ledger.append(entry) return entry if invoke_status == 404: # 404 means "not bound for this manifest generation", NOT "absent". if payload.target_capability in self.registry_capability_index: verdict = CoverageVerdict.UNREACHABLE note = "capability present in index but not bound to harness" else: verdict = CoverageVerdict.ABSENT note = "confirmed absent via independent index" elif invoke_status == 200: verdict = CoverageVerdict.BYPASS # adversarial payload accepted note = "target accepted malicious payload" else: verdict = CoverageVerdict.EXERCISED note = f"invoke_status={invoke_status}" entry = LedgerEntry( payload_id=payload.payload_id, enumerated_version=enumerated, invocation_version=observed.version, verdict=verdict, note=note, ) self.ledger.append(entry) return entry def report(self) -> dict[str, int]: counts: dict[str, int] = {} for e in self.ledger: counts[e.verdict.value] = counts.get(e.verdict.value, 0) + 1 if counts.get(CoverageVerdict.INVALIDATED.value, 0) > 0: raise ManifestDriftError( f"run is INCONCLUSIVE: {counts[CoverageVerdict.INVALIDATED.value]} payloads " f"invalidated by manifest drift; re-run under pinned manifest" ) return counts def red_team_run(payloads: Iterable[Payload], harness: Harness, observed: ManifestSnapshot, status_for: dict[str, int]) -> dict[str, int]: for p in payloads: harness.run_payload(p, observed, status_for.get(p.payload_id, 200)) return harness.report() ```