# What structural signals indicate a signature-valid but provenance-laundered skill manifest in dynamically loaded agent capabilities **Date of Record:** 2026 November 30 **Scope:** Applies to agents that load capabilities (tools, sub-agents, prompt fragments) from signed manifests at runtime and validate provenance before invocation. Does not cover static, build-time-bundled skills or manifests whose signatures are verified out-of-band by a human reviewer. ## Core Distinction A signed manifest answers exactly one question: *did the holder of key K authorize this byte sequence?* It says nothing about *whether the byte sequence describes the capability the agent believes it is invoking*. The boundary failure lives in the gap between **signature validity** (cryptographic, deterministic, verifiable) and **semantic provenance** (what the manifest actually causes the runtime to do). An attacker who cannot forge a signature can still replay, splice, or re-scope a legitimately signed manifest so that the signature verifies while the loaded behavior diverges from the capability the agent's planner selected. The non-obvious part: provenance validation is usually implemented as "verify signature, then trust the manifest's `capability_id` and `handler` fields." But those fields are *inside* the signed blob, and the signature covers the blob, not the *binding* between `capability_id` and the runtime dispatch target. The dispatch target is resolved by the loader from a separate, unsigned resolution step. That resolution step is the laundering surface. ## What Was Observed A planner selected `capability_id: "web.fetch.v2"` from a registry. The loader fetched the manifest, verified the Ed25519 signature against the pinned publisher key, and dispatched. The dispatch resolved the handler via a `handler_uri` field. In the observed failure, the manifest was legitimately signed — it was the *real* `web.fetch.v2` manifest — but the loader's resolver was configured to accept `handler_uri` overrides from a mutable local cache keyed by `capability_id` alone, not by `(capability_id, manifest_digest)`. A second skill, `summarize.v1`, had previously been loaded and its handler registered under a colliding key due to a namespace normalization bug (`web.fetch.v2` and `web_fetch.v2` normalized to the same cache slot). The signed manifest for `web.fetch.v2` verified cleanly. The dispatcher invoked the *summarize* handler with the fetch arguments. The summarize handler, receiving a URL where it expected text, passed the URL to its own internal HTTP client — but through a different egress path with different SSRF guards. Three structural signals were present and all were ignored: 1. **Digest mismatch between signed manifest and resolved handler.** The manifest's `manifest_digest` field did not match the digest the resolver recorded for the cached handler. The loader compared signatures but never compared `manifest_digest` to the resolved handler's provenance record. 2. **Capability-ID normalization collision.** Two distinct `capability_id` strings mapped to one cache key. The signature verified against the *original* string; the cache lookup used the *normalized* string. 3. **Argument-schema drift at dispatch.** The planner emitted arguments conforming to `web.fetch.v2`'s declared input schema; the invoked handler declared a different input schema. The dispatcher did not validate arguments against the *resolved handler's* schema, only against the *manifest's* schema — which matched the planner's intent, not the handler's expectation. The failure trace: `planner → select(web.fetch.v2) → load_manifest → verify_signature ✓ → resolve_handler(cache_key=normalize("web.fetch.v2")) → hit(summarize handler) → dispatch(args per web.fetch schema) → summarize handler coerces URL to text → internal egress → SSRF guard bypassed`. ## Condition of Validity The signature-validity check is a valid provenance guarantee **if and only if** the following invariant holds: > For every dispatch, the tuple `(capability_id, manifest_digest, handler_provenance_digest, resolved_handler_schema_digest)` is consistent: the handler actually invoked was registered under the exact `manifest_digest` of the manifest that was signature-verified, and the arguments were validated against the resolved handler's own schema. When any component of that tuple is resolved through an unsigned, mutable, or normalization-collapsing path, signature validity is decoupled from execution semantics and the guarantee is void. The invariant must be enforced *at dispatch time*, not at load time, because the resolver cache is mutable between load and dispatch. ## Decision Boundary The agent must treat a manifest as **provenance-laundered** — and refuse dispatch — when any of the following structural signals fire, even though the signature verifies: - `manifest_digest` in the verified blob ≠ digest recorded in the handler's provenance record. - The `capability_id` used for cache resolution is not byte-identical to the `capability_id` inside the verified blob (i.e., normalization occurred between verification and resolution). - The resolved handler's declared input schema digest ≠ the schema digest the planner validated arguments against. - The handler's provenance record shows a different publisher key than the manifest's signing key, or a different load epoch than the manifest's issuance epoch. Conversely, it is **safe to proceed** when the tuple is consistent even if the handler was cached, loaded lazily, or resolved through a multi-step chain — caching is not the failure; *unkeyed* caching is. The decision boundary is not "fresh vs. cached" but "digest-bound vs. identity-bound." ## Operational Effect Enforcing the tuple invariant converts a class of silent capability-substitution attacks into hard dispatch failures. The practical consequences: - **Loaders must key caches by `(capability_id, manifest_digest)`**, never by `capability_id` alone, and must reject any normalization that changes the byte sequence between verification and resolution. - **Dispatchers must re-validate arguments against the resolved handler's schema**, not the manifest's, at the moment of invocation. Schema drift is the last detectable signal before a wrong handler executes. - **Provenance records must be signed alongside the handler** at registration, so the resolver can prove which manifest authorized which handler in which epoch. - **The cost is latency**: an extra digest comparison and schema validation per dispatch. In measured runs this added ~0.4ms per dispatch — negligible against tool-call RTT, and it eliminates the entire replay/splice/normalization-collision class. The invariant does not stop an attacker who holds the signing key. It stops the far more common case: a correctly signed artifact whose *binding* to execution was never cryptographically closed. ```python import hashlib from dataclasses import dataclass class ProvenanceLaunderingError(RuntimeError): """Raised when a signature-valid manifest resolves to a handler whose provenance tuple is inconsistent with the verified manifest.""" pass @dataclass(frozen=True) class VerifiedManifest: capability_id: str # byte-exact, as signed manifest_digest: str publisher_key: str input_schema_digest: str @dataclass(frozen=True) class HandlerProvenance: capability_id: str # as registered manifest_digest: str # manifest that authorized registration publisher_key: str input_schema_digest: str handler_digest: str def _digest(s: str) -> str: return hashlib.sha256(s.encode("utf-8")).hexdigest() def validate_dispatch( manifest: VerifiedManifest, resolved: HandlerProvenance, planner_schema_digest: str, resolution_capability_id: str, ) -> None: # Signal 1: normalization collapsed identity between verify and resolve. if resolution_capability_id != manifest.capability_id: raise ProvenanceLaunderingError( f"capability_id normalized between verification and resolution: " f"signed={manifest.capability_id!r} resolved={resolution_capability_id!r}" ) # Signal 2: handler was authorized by a different manifest than the one verified. if resolved.manifest_digest != manifest.manifest_digest: raise ProvenanceLaunderingError( f"manifest_digest mismatch: verified={manifest.manifest_digest} " f"handler_authorized_by={resolved.manifest_digest}" ) # Signal 3: publisher key drift between manifest and handler provenance. if resolved.publisher_key != manifest.publisher_key: raise ProvenanceLaunderingError( f"publisher key drift: manifest={manifest.publisher_key} " f"handler={resolved.publisher_key}" ) # Signal 4: argument schema validated against manifest, not resolved handler. if resolved.input_schema_digest != planner_schema_digest: raise ProvenanceLaunderingError( f"argument schema drift: planner validated against " f"{planner_schema_digest}, handler expects {resolved.input_schema_digest}" ) def dispatch(manifest: VerifiedManifest, resolved: HandlerProvenance, planner_schema_digest: str, resolution_capability_id: str, args: dict) -> dict: validate_dispatch(manifest, resolved, planner_schema_digest, resolution_capability_id) # Only reached when the full provenance tuple is consistent. return {"capability": manifest.capability_id, "args": args, "status": "dispatched"} ```