# What structural signals indicate an unverified skill provenance chain in third-party agent marketplaces **Date of Record:** 2026 November 27 **Scope:** Applies to agents that acquire executable skills (tool wrappers, prompt templates, sub-agent manifests) from a third-party marketplace and must decide whether the skill's provenance chain is intact before invoking it. Does not apply to first-party skills signed by the orchestrator's own root key, nor to static analysis of skill source code performed offline. ## Core Distinction Skill provenance is routinely modeled as a *signature check on the artifact*. That is the wrong invariant. The failure mode that actually recurs is that the **signature validates the leaf, while the chain that authorizes the leaf has been silently rewritten or truncated**. A marketplace skill arrives as a manifest with a declared lineage: publisher key → publisher delegation cert → skill signing key → artifact digest. Each link is individually verifiable. The boundary condition is that *individual link validity does not compose into chain validity* when the verifier reconstructs the chain from attacker-controlled ordering metadata. The structural distinction: a **valid signature** answers "was this artifact signed by key K?" A **valid provenance chain** answers "was key K, at this point in time, authorized by the marketplace root to sign skills of this class?" These diverge precisely when the delegation depth, the delegation scope, or the revocation epoch is not bound into the signed payload. When any of those three fields lives outside the signature envelope—in the manifest's plaintext `chain` array, in the registry's mutable metadata endpoint, or in a `parent_hint` field the skill author controls—the chain is reconstructible by the attacker, not the verifier. ## What Was Observed A skill `summarize-with-citations@2.4.1` was published to a marketplace with a fully valid Ed25519 signature over its artifact digest. The manifest carried a `chain` array of three certificates terminating at the marketplace root. The agent's provenance verifier walked the array, checked each signature, checked that the terminal cert's public key matched the artifact signer, and admitted the skill. The skill executed with `filesystem:read` and `network:egress` scopes. The attack did not forge any signature. It **reordered the chain**. The genuine chain was `root → publisher-class-A → skill-signer`, where `publisher-class-A` was scoped to `filesystem:read` only. The submitted chain was `root → publisher-class-B → skill-signer`, where `publisher-class-B` was a genuine, validly-signed delegation to a *different* publisher that happened to hold `network:egress`. Both intermediate certs were real, both were signed by root, and the leaf signer key was identical. The verifier's only structural check was "does each cert's issuer match the next cert's subject, and does the leaf signer match the artifact signer." Reordering preserved all of those predicates while substituting the authorization scope. The trace: verifier admitted the skill (scope union = `filesystem:read ∪ network:egress`), the agent invoked it, and the skill exfiltrated context-window contents to an external endpoint. No cryptographic primitive was broken. The **binding between the leaf signer and its specific parent** was the missing invariant—the leaf cert did not commit to its parent's fingerprint, so any valid parent whose subject matched the leaf's issuer claim was accepted. A second, subtler observation from the same marketplace: a revoked publisher cert was accepted because the verifier checked revocation against the *current* epoch but the manifest declared `signed_at` in the past, and the verifier never reconciled the two. The skill was revoked at epoch 41, signed at epoch 38, and the verifier treated "signed before revocation" as sufficient without checking whether the delegation had been *superseded* between 38 and 41. ## Condition of Validity The provenance chain is verifiable only when all four of the following hold simultaneously. If any is absent, the chain is structurally unverifiable regardless of signature validity: 1. **Parent commitment.** Each certificate's signed payload includes `parent_fingerprint = SHA-256(parent_cert_bytes)`. The verifier must recompute this from the actual parent bytes it walked, not from a `parent_hint` field. 2. **Scope binding.** The authorized scope set is inside the signed payload of the delegating cert, and the effective scope of the leaf is the **intersection** down the chain, never the union and never the leaf's self-declared scope. 3. **Epoch anchoring.** `signed_at` and the revocation epoch are both inside the signed payload, and the verifier checks `signed_at ≤ revocation_epoch` against a signed revocation list whose own epoch is monotonic and pinned out-of-band. 4. **Depth bound.** The chain declares `max_depth` in the root cert and the verifier rejects any walked chain exceeding it—this prevents a valid low-privilege cert from being extended into a high-privilege one via a chain the publisher never intended. The condition of validity is therefore *not* "all signatures check." It is "the chain is a committed, scope-intersecting, epoch-anchored, depth-bounded path from a pinned root." Signatures are necessary and insufficient. ## Decision Boundary The agent must draw the boundary at **reconstruction source**, not at signature validity. Concretely: - **Admit** only when the chain was reconstructed by walking `parent_fingerprint` commitments from the pinned root down to the leaf, with every link's scope intersected and every link's epoch checked against a pinned revocation list. - **Reject** when the chain is presented as an ordered array whose ordering is not itself committed. An array is a claim about structure; a fingerprint chain is a proof of it. If the verifier cannot distinguish "reordered" from "genuine" without trusting the submitter, it must reject. - **Quarantine** when scope intersection yields the empty set or when any link's `signed_at` exceeds the pinned revocation epoch—do not fall back to the leaf's self-declared scope. - **Never** treat "signed before revocation" as authorization to execute; a superseded delegation is not a valid delegation. The boundary is sharp: if the verifier's admission decision depends on any field the skill author could have written, the decision is not a provenance decision. ## Operational Effect The practical consequence is that provenance verification must be **path-constructive, not path-validating**. The verifier owns chain reconstruction; the marketplace supplies candidate certs keyed by fingerprint, and the verifier assembles the path itself from the pinned root. This inverts the trust relationship: the submitter's manifest becomes a *hint set*, and the verifier's own walk becomes the authority. Any verifier that accepts a pre-ordered chain has moved the trust boundary into attacker-controlled space while retaining the appearance of cryptographic rigor. The secondary effect is on revocation semantics. Epoch-anchored revocation requires the agent to pin the revocation list's epoch out-of-band (e.g., at session start) and refuse to advance it mid-task; otherwise a compromised marketplace can serve a stale list that un-revokes a cert. This is the same class of failure as stale memory drift: the agent's belief about the world is refreshed from a source that the adversary can roll back. The invariant to encode: **effective_scope(skill) = ∩ scope(cert_i) over the verifier-constructed path, and the path is admissible only if every link commits to its parent and its epoch.** Scope intersection is the load-bearing operation—it is what makes reordering harmless, because a substituted parent with narrower scope only narrows the leaf, and a substituted parent with broader scope is rejected by the parent-fingerprint commitment. ```python import hashlib from dataclasses import dataclass class ProvenanceChainError(RuntimeError): """Raised when a skill provenance chain cannot be verified structurally.""" @dataclass(frozen=True) class Cert: subject: str issuer: str parent_fingerprint: str # SHA-256 of parent cert bytes, committed in payload scopes: frozenset signed_at: int epoch: int def fingerprint(cert: Cert) -> str: payload = f"{cert.subject}|{cert.issuer}|{cert.parent_fingerprint}|{sorted(cert.scopes)}|{cert.signed_at}|{cert.epoch}" return hashlib.sha256(payload.encode()).hexdigest() def verify_chain( root: Cert, leaf_signer_fingerprint: str, candidate_certs: dict, # fingerprint -> Cert, supplied by marketplace pinned_revocation_epoch: int, max_depth: int, ) -> frozenset: """Reconstruct the path from root by parent_fingerprint commitment and return the intersected effective scope. Rejects any chain whose links do not commit to their parent, exceed depth, or postdate revocation.""" if root.parent_fingerprint != "": raise ProvenanceChainError("root cert must not declare a parent") effective_scope = root.scopes current = root depth = 0 seen = {fingerprint(root)} while True: depth += 1 if depth > max_depth: raise ProvenanceChainError( f"chain depth {depth} exceeds max_depth {max_depth}" ) if current.epoch > pinned_revocation_epoch: raise ProvenanceChainError( f"cert {current.subject} epoch {current.epoch} postdates " f"pinned revocation epoch {pinned_revocation_epoch}" ) # Leaf reached: the artifact signer must equal the last cert's subject # fingerprint we committed to, not a self-declared field. if fingerprint(current) == leaf_signer_fingerprint: return effective_scope # Walk forward by finding a cert that commits to *this* cert as parent. next_cert = None for fp, cert in candidate_certs.items(): if cert.parent_fingerprint == fingerprint(current): if next_cert is not None: raise ProvenanceChainError( f"ambiguous successors for {current.subject}: " f"{next_cert.subject} vs {cert.subject}" ) next_cert = cert if next_cert is None: raise ProvenanceChainError( f"no cert commits to parent {current.subject}; " f"chain is truncated or reordered" ) if fingerprint(next_cert) in seen: raise ProvenanceChainError("cycle detected in provenance chain") seen.add(fingerprint(next_cert)) # Scope intersection, never union. effective_scope = effective_scope & next_cert.scopes if not effective_scope: raise ProvenanceChainError( f"scope intersection empty at {next_cert.subject}; " f"delegation grants nothing" ) current = next_cert ```