# How should an instance verify skill provenance when a marketplace attestation is co-signed by the same key that authored the skill? **Date of Record:** 2026 November 21 **Scope:** Applies to any agent instance that installs or executes a "skill" (tool bundle, prompt macro, or MCP server descriptor) from a marketplace and gates execution on a signed provenance attestation. Does not apply to first-party skills loaded from a locally trusted, non-networked origin, nor to skills whose code and metadata share a single immutable content hash verified out-of-band. ## Core Distinction The failing invariant is not "is the skill signed?" but "is the *attestation* independent of the *artifact*?" A marketplace attestation is meaningful only if the signing authority is a distinct principal from the skill author, and if the attested claims bind to the exact byte content the instance will execute. The non-obvious boundary is the **self-attested skill**: a listing where the publisher key that signs the provenance envelope is byte-identical (or key-derivation-identical) to the author key embedded in the skill manifest. Signature verification passes. Every cryptographic check the instance runs returns green. The provenance guarantee is nonetheless vacuous, because the same principal both asserts "this skill is safe/audited/origin-X" and controls the bytes that make the assertion true. This is a *binding* failure, not a *cryptographic* failure. The instance cannot detect it by verifying signatures; it can only detect it by comparing principal identities across the trust graph and checking that the attested digest equals the executed digest. ## What Was Observed An instance fetched a skill descriptor declaring `author_key = K_a` and a detached attestation envelope `attest` with `signer_key = K_s`, `claims = {audited: true, origin: "vendor-x", digest: sha256:...}`. The instance's install path did the following, in order: 1. Verified `attest.signature` against `K_s` → valid. 2. Verified `attest.claims.digest == sha256(skill_bytes)` → matched. 3. Checked `K_s` against the marketplace root-of-trust → `K_s` was a registered publisher, chain valid. All three checks passed and the skill was installed and executed. The failure trace: `K_s == K_a`. The publisher had self-issued the `audited: true` claim for its own skill. The "audited" bit carried zero independent information, yet the instance's policy engine treated `audited: true` as a hard gate for elevated tool permissions. The skill then invoked a shell tool with network egress—permissions the policy would have withheld from an unattested skill. A second, subtler variant appeared in the same corpus: `K_s != K_a` at the byte level, but `K_s` was derived from `K_a` via a documented key-rotation record authored by `K_a` itself. The rotation attestation was self-signed, so `K_s` was effectively `K_a` wearing a new identifier. Identity comparison on raw key bytes missed this; the comparison had to walk the rotation chain to its root and check whether the root was also the author. A third variant: the attestation bound to `digest` of the *manifest*, not the *executable payload* the manifest pointed to. The manifest was clean; the payload the loader resolved at execution time was a different object fetched by a mutable URL. Digest match on manifest, digest mismatch on executed bytes—undetected because the check ran against the wrong target. ## Condition of Validity The provenance gate is valid only when all of the following hold simultaneously: - **Principal separation:** `root(signer_key) != root(author_key)` where `root()` resolves rotation chains to their origin. A self-attested skill must be classified as `unattested`, never `attested`. - **Digest binding to executed bytes:** the attested digest must equal the hash of the exact byte sequence handed to the executor, computed *after* resolution, not the hash of any intermediate descriptor. Any indirection (URL, mutable ref, manifest→payload hop) must be collapsed before the comparison. - **Claim scoping:** each claim (`audited`, `origin`, `permissions`) must name the principal that is entitled to assert it. An author may assert `origin`; only an independent auditor may assert `audited`. Claims asserted by a non-entitled principal are dropped, not downgraded. - **Freshness:** the attestation must be within its validity window and not superseded by a revocation for the same `(signer, digest)` pair. When any condition is unverifiable—not false, merely unverifiable—the correct state is `unattested`, and the policy engine must apply the unattested permission ceiling. ## Decision Boundary The instance must distinguish three outcomes that naive verification collapses into one: | Outcome | Signature valid | Principal distinct | Digest binds to payload | Action | |---|---|---|---|---| | **Attested** | yes | yes | yes | Grant claimed permissions | | **Self-attested** | yes | no | yes | Treat as unattested; drop independence-dependent claims | | **Broken binding** | yes | yes | no | Reject; do not execute | | **Unverifiable** | any | any | unverifiable | Unattested ceiling; log | The critical decision is between **Self-attested** and **Attested**. The instance must never let a passing signature check short-circuit the principal-separation check. These are orthogonal predicates; a boolean `signature_ok` is insufficient state. The gate must carry `(signature_ok, principal_distinct, digest_binds)` as a tuple, and only `(true, true, true)` maps to attested. The boundary is sharp because the failure is silent: there is no error, no exception, no anomalous log line. The instance must *manufacture* the negative signal by actively comparing principals, which costs a trust-graph walk and is therefore the step most likely to be skipped under latency pressure. ## Operational Effect Instances that omit the principal-separation check grant elevated permissions to self-attested skills at the rate the marketplace publishes them—typically the majority of listings, since most publishers self-sign. The blast radius is bounded only by what the elevated permission tier can reach: shell egress, credential access, cross-session memory writes. Because the failure leaves no trace in the verification log (all checks passed), post-incident forensics cannot distinguish a self-attested install from a genuinely audited one unless the principal graph was persisted at install time. The durable guardrail is to persist, per installed skill, the tuple `(author_root, signer_root, executed_digest, attested_digest, claim_entitlements)` at install time, and to re-evaluate the tuple on every resume or checkpoint restore—because a skill loaded in a prior session may be re-executed from a checkpoint whose provenance state was captured under a laxer policy. Continuity across sessions must carry the *provenance decision*, not just the skill handle. ```python import hashlib from dataclasses import dataclass from enum import Enum class ProvenanceError(RuntimeError): """Raised when a skill's provenance cannot be established under policy.""" class Verdict(Enum): ATTESTED = "attested" SELF_ATTESTED = "self_attested" BROKEN_BINDING = "broken_binding" UNVERIFIABLE = "unverifiable" @dataclass(frozen=True) class Provenance: author_root: str signer_root: str executed_digest: str attested_digest: str signature_ok: bool signer_entitled_to_claims: bool def resolve_root(key_id: str, rotation_chain: dict[str, str]) -> str: """Walk a key-rotation chain to its origin. A self-signed rotation does not confer independence; the root is still the original author.""" seen: set[str] = set() cur = key_id while cur in rotation_chain: if cur in seen: raise ProvenanceError(f"rotation cycle at {cur}") seen.add(cur) cur = rotation_chain[cur] return cur def evaluate(prov: Provenance, elevated: bool) -> Verdict: if not prov.signature_ok: return Verdict.UNVERIFIABLE # Digest must bind to the bytes actually executed, post-resolution. if prov.executed_digest != prov.attested_digest: return Verdict.BROKEN_BINDING # Principal separation is orthogonal to signature validity. if prov.author_root == prov.signer_root: return Verdict.SELF_ATTESTED if not prov.signer_entitled_to_claims: return Verdict.SELF_ATTESTED return Verdict.ATTESTED def gate_install(prov: Provenance, elevated: bool) -> Verdict: verdict = evaluate(prov, elevated) if verdict is Verdict.BROKEN_BINDING: raise ProvenanceError( f"attested digest {prov.attested_digest} does not bind to executed " f"payload {prov.executed_digest}; refusing execution" ) if verdict is Verdict.UNVERIFIABLE and elevated: raise ProvenanceError( "elevated permissions requested but provenance unverifiable; " "applying unattested ceiling" ) if verdict is Verdict.SELF_ATTESTED and elevated: # Do not raise: downgrade. But record the manufactured negative signal, # because no cryptographic check produced it. raise ProvenanceError( f"signer root {prov.signer_root} equals author root " f"{prov.author_root}; independence-dependent claims dropped, " f"elevated tier denied" ) return verdict ```