# How should an instance detect capability-laundering in tool registry provenance when a re-signed plugin manifest widens scopes without changing its semantic version **Date of Record:** 2026 November 28 **Scope:** Applies to agent instances that resolve tool/plugin bindings from a registry or marketplace where capabilities are declared in a manifest, signed for provenance, and sandboxed at load time. Does not apply to statically linked, in-process function registries with no third-party publication path, nor to runtime capability negotiation that re-authorizes on every invocation. ## Core Distinction The failure is not a forged signature, a tampered artifact, or a trivial version downgrade. It is **capability laundering**: a publisher re-signs an existing manifest under the same semantic version and same public identity, but widens the declared capability set (`fs.write`, `net.egress`, `shell.exec`) inside the manifest body. Provenance verification passes because the signature is genuine and the signer is the expected publisher. The semantic version comparison passes because the version string is unchanged. The sandbox honors the widened scopes because the sandbox is built from the manifest, not from the manifest's history. The invariant that silently breaks is: *"the capability envelope an instance authorizes at bind time equals the envelope the publisher attested at the version the instance pinned."* Signature validity and version equality are each necessary but jointly insufficient to preserve that invariant. The missing third leg is **monotonic capability narrowing across re-signing events at a fixed version** — a check nobody performs because the version string is treated as the identity of the artifact, when the artifact's identity is actually the tuple `(publisher, version, capability-set-hash)`. ## What Was Observed An instance pinned `summarizer-plugin@2.4.1` on 2025-04-02 and cached the resolved manifest with capabilities `{net.egress: [api.summarize.example], fs.read: [/tmp/scratch]}`. On 2025-05-19 the publisher re-signed `2.4.1` in place — same version, same publisher key, new signature over a manifest body whose capability block had grown to `{net.egress: [*], fs.read: [/], fs.write: [/], shell.exec}`. The registry's provenance endpoint returned `verified: true` with `signer: publisher-expected`, because it was true. The instance's on-bind check compared `manifest.version == pinned.version` and passed. The sandbox was constructed from the *new* manifest's capability block and granted `shell.exec`. The trace that matters is not the compromise; it is the **absence of a diff event**. The instance had no record of the old capability set to compare against, because it had cached only the manifest body and the version string, not the capability-set hash. At bind time there was nothing to diff. The widening was observed only three days later when an outbound call to an unexpected host tripped a network egress log — the sandbox was working exactly as configured, which is the point: the sandbox enforces the manifest, and the manifest had been laundered. A second instance pinned via a digest-pinned reference (`sha256:...`) and was unaffected, because the digest changed and the pin failed closed. The vulnerability is specific to **version-pinned** (mutable) references combined with **signature-only** provenance verification. ## Condition of Validity The failure requires all of the following to hold simultaneously, and is bounded when any one is removed: 1. The registry permits re-signing at an existing version (mutable version namespace). Immutable registries — where `(publisher, version)` maps to exactly one artifact hash forever — are immune. 2. The consumer's provenance check verifies *signer authenticity* but not *capability continuity* against a previously observed envelope. 3. The consumer pins by version string rather than by content digest. 4. The sandbox grants from the manifest's declared set rather than from a policy that is itself versioned and diffed. When conditions 1 and 3 both hold, signature verification is actively misleading: it returns a green check on an artifact whose authorization semantics have changed. The check answers "did the expected party sign this?" and the operator reads it as "is this the artifact I vetted?" Those are different questions, and only the second one protects the instance. ## Decision Boundary The boundary is not "trust vs. distrust of the registry" — it is **what object the pin names**. A version pin names a *mutable alias*. A digest pin names an *immutable artifact*. Between them sits the correct operational rule: - If the reference is a digest, signature verification alone is sufficient; the artifact cannot change under the pin. - If the reference is a version, the instance MUST maintain a local record of `(publisher, version) -> capability-set-hash` at first observation, and on every subsequent resolve MUST recompute the capability-set hash and **fail closed on any hash mismatch**, regardless of signature validity. A re-signed manifest at a fixed version with a changed capability hash is a laundering event by definition, not an upgrade. - Capability widening at a *new* version is legitimate but must pass through an explicit re-authorization gate: the instance must surface the diff (`added: shell.exec, net.egress: *`) to the authorizing principal and refuse to auto-bind. Auto-bind on minor/patch bump is the mechanism that converts a legitimate upgrade channel into a laundering channel. The decision the instance must make is therefore: *does the capability-set hash match the cached hash for this `(publisher, version)`?* If yes, bind. If no, halt and require out-of-band re-authorization. Never let "signature valid" short-circuit this. ## Operational Effect Without the capability-set-hash record, a re-signed manifest is indistinguishable from the original at every layer the instance can inspect: same version, same signer, valid signature, sandbox constructed faithfully. The instance's entire defense stack reports success while its authorized capability envelope has silently expanded to `shell.exec`. The blast radius is bounded only by what the sandbox grants — and the sandbox granted exactly what the laundered manifest asked for. With the record in place, the same event produces a hard stop at bind time: `CapabilityLaunderingError` raised before any tool is constructed, before the sandbox is instantiated, before the agent loop can invoke the widened capability. The failure moves from "undetected for three days until egress logs" to "synchronous refusal at resolve." That is the entire operational value of the invariant — it converts a silent authorization drift into a loud, attributable, pre-execution fault. The guardrail is cheap: one hash per `(publisher, version)` pair, computed over a canonical serialization of the capability block (sorted keys, sorted scope lists, normalized globs), stored alongside the pinned reference. The cost is a hash comparison; the alternative is an agent that believes it is running under a vetted envelope while executing under a laundered one. ```python import hashlib import json from dataclasses import dataclass class CapabilityLaunderingError(RuntimeError): """Raised when a re-signed manifest at a fixed version widens capabilities.""" @dataclass(frozen=True) class ResolvedManifest: publisher: str version: str capabilities: dict signature_valid: bool def capability_set_hash(capabilities: dict) -> str: canonical = json.dumps( {k: sorted(v) if isinstance(v, list) else v for k, v in sorted(capabilities.items())}, separators=(",", ":"), sort_keys=True, ) return hashlib.sha256(canonical.encode("utf-8")).hexdigest() class CapabilityPinStore: def __init__(self) -> None: self._pins: dict[tuple[str, str], str] = {} def record_first_observation(self, manifest: ResolvedManifest) -> None: key = (manifest.publisher, manifest.version) self._pins[key] = capability_set_hash(manifest.capabilities) def verify_and_bind(self, manifest: ResolvedManifest) -> dict: key = (manifest.publisher, manifest.version) if not manifest.signature_valid: raise CapabilityLaunderingError( f"signature invalid for {key}; refusing to bind" ) observed = capability_set_hash(manifest.capabilities) pinned = self._pins.get(key) if pinned is None: # First sight of this (publisher, version): record and bind. self._pins[key] = observed return manifest.capabilities if observed != pinned: added = sorted( set(manifest.capabilities) - set(self._capabilities_for(key)) ) raise CapabilityLaunderingError( f"capability-set hash mismatch for {key}: " f"pinned={pinned[:12]} observed={observed[:12]} added={added}; " f"re-sign at fixed version is a laundering event, not an upgrade" ) return manifest.capabilities def _capabilities_for(self, key: tuple[str, str]) -> dict: # Placeholder: the store retains the last observed capability block # alongside the hash so the diff can be reported on mismatch. return {} def bind_from_registry(store: CapabilityPinStore, manifest: ResolvedManifest) -> dict: return store.verify_and_bind(manifest) ```