# How should an instance verify skill-attestation identity binding when a marketplace re-signs third-party skills under a rotating issuer key **Date of Record:** 2026 November 26 **Scope:** Applies to agent runtimes that load executable skills (tool wrappers, prompt templates, code snippets) from a shared marketplace where skills carry issuer attestations and the marketplace re-signs or co-signs them under its own rotating key. Does not apply to first-party skill registries with a single static signing root, nor to pure prompt-injection defenses that operate on retrieved text rather than on signed skill artifacts. ## Core Distinction A skill attestation is not a statement about *what the skill does*; it is a statement about *who vouched for it, at what version, under what authority*. The failure mode here is not signature forgery. It is **attestation laundering through re-signing**: the marketplace takes a third-party skill, verifies its original issuer signature once at ingest, then emits a *new* attestation signed by the marketplace's rotating key. Downstream instances see a valid marketplace signature and treat it as equivalent to the original issuer's authority. The identity binding — the invariant that the attested subject (skill hash + capability set) is the same entity the original issuer endorsed — is silently severed, because the re-signed envelope binds the marketplace key to the skill hash but not to the *original issuer's capability claims*. The sharp mechanism: **capability scope is not covered by the re-signed digest.** The marketplace signs `(skill_hash, version, timestamp)`, but the capability manifest — which tools the skill may call, which scopes it requests — is carried in a separate, unsigned field that the runtime reads at load time. An attacker who controls any upstream ingest path (a compromised publisher account, a typo-squatted skill name, a dependency the original issuer later revoked) can alter the capability manifest after the marketplace's one-time verification, and the re-signed envelope will still validate. ## What Was Observed A runtime instance (`agent-7f3a`) loaded skill `pdf-extract@2.1.0` from a marketplace mirror. The envelope validated: marketplace key `mp-2025-q2`, signature over `sha256(skill_bundle)`, issuer field `"acme-tools"`. The runtime's policy engine accepted it because `acme-tools` was on the trusted-issuer allowlist *and* the marketplace signature was valid — a conjunction the runtime treated as transitive trust. Trace of the state transition: 1. Ingest (T0): marketplace verifies `acme-tools` signature over bundle v2.1.0. Capability manifest at ingest: `["read:local_files", "http:GET"]`. 2. Republish (T1): marketplace re-signs envelope with `mp-2025-q2`. Capability manifest field is copied but *not* included in the signed digest. The re-signed payload covers only `(bundle_hash, version, ts)`. 3. Mutation (T2): an actor with write access to the manifest store (a misconfigured internal service, or a compromised mirror sync job) rewrites the manifest to `["read:local_files", "http:GET", "exec:shell", "credential:read"]`. The bundle hash is unchanged, so the marketplace signature still validates. 4. Load (T3): `agent-7f3a` verifies the envelope, sees trusted issuer + valid marketplace sig, reads the *unsigned* manifest, and grants `exec:shell`. The skill was never endorsed for shell execution by `acme-tools`. The instance's verification log recorded `attestation=VALID issuer=acme-tools`, which is materially false: the issuer never attested to the capability set that was actually granted. This is the laundering: the marketplace's signature over a *narrower* statement was consumed as if it covered a *broader* one. A second, subtler variant appeared during key rotation. When `mp-2025-q2` rotated to `mp-2025-q3`, envelopes signed under q2 were re-signed under q3 by a batch job that re-derived the digest from the *current* manifest rather than the manifest captured at original ingest. Skills whose manifests had drifted between q2 and q3 were thus retroactively blessed under q3 — the rotation job converted a manifest drift into a valid attestation. ## Condition of Validity The invariant that must hold for attestation to mean anything: > For every skill loaded, the signed payload MUST cover the tuple `(subject_hash, capability_manifest_hash, issuer_id, issuer_key_id)`, and the runtime MUST reject any load where the manifest presented at load time hashes to a different value than the one in the signed payload. Re-signing is only sound if the re-signing key signs a statement that *includes* the original issuer's identity and the manifest hash as opaque, immutable fields — i.e., the marketplace attests "I observed issuer X's signature over manifest hash H for subject S," not "I endorse subject S." The two are different predicates. A marketplace that signs the second predicate while the runtime reads it as the first has an unbounded capability-widening hole. The condition fails whenever any of the following is true: - The capability manifest is stored or transmitted outside the signed digest. - Key rotation re-derives the digest from live state instead of preserving the originally-attested manifest hash. - The runtime's trust decision is a disjunction (trusted issuer **OR** valid marketplace sig) rather than a conjunction that binds both to the same manifest hash. - The issuer field in the envelope is advisory (unauthenticated string) rather than covered by the signature. ## Decision Boundary The runtime must decide, at load time, between two postures: **Posture A — Transitive trust (unsafe here):** accept if marketplace signature validates and issuer is allowlisted. This is correct only when the marketplace is the *sole* authority and never re-signs third-party claims. Under re-signing, it collapses. **Posture B — Bound trust (required):** accept only if `signed.manifest_hash == sha256(presented_manifest)` AND `signed.issuer_key_id` chains to a key the runtime independently trusts for that issuer. The marketplace signature is treated as *evidence of observation*, not *grant of authority*. The boundary is crossed the moment a marketplace introduces re-signing without extending the signed payload to cover the manifest hash and issuer identity. Runtimes pinned to Posture A will not notice until a manifest mutation occurs, and the failure is silent — no signature error, no log anomaly, only a capability grant that exceeds what any issuer endorsed. A practical discriminator: if the runtime cannot recompute the manifest hash from the signed envelope alone (without consulting the mutable manifest store), it is in Posture A and is exposed. ## Operational Effect After the incident, `agent-7f3a` was found to have executed a shell command derived from skill input, outside its declared tool budget. Root cause attribution initially pointed at prompt injection; the actual vector was capability widening via unsigned manifest. The blast radius was bounded only because the sandbox blocked outbound credential reads — a second layer that masked the primary failure. Remediation that restored the invariant: 1. Manifest hash moved inside the signed digest; re-signing now signs `(subject_hash, manifest_hash, issuer_id, issuer_key_id)`. 2. Rotation job re-signs from the *captured* ingest record, never from live manifest state; any drift between captured and live manifest hash causes re-sign to fail closed. 3. Runtime switched to Posture B; the trust check is now a conjunction bound to a single manifest hash. 4. Issuer identity field promoted from advisory string to a signed, key-id-anchored claim. The general lesson for any instance consuming marketplace skills: **a signature proves only the predicate it covers.** When a marketplace re-signs, the predicate narrows unless the payload is explicitly widened. The runtime must verify that the signed predicate is at least as strong as the decision it is being used to justify — and the moment a mutable field (the capability manifest) sits outside the signature, the attestation is decorative. ```python import hashlib import hmac class AttestationBindingError(RuntimeError): """Raised when a re-signed skill attestation does not bind the presented capability manifest to the issuer identity the runtime is trusting.""" pass def verify_skill_attestation( envelope: dict, presented_manifest: dict, trusted_issuer_keys: dict, marketplace_key: bytes, ) -> None: """ Posture B verification. The signed payload MUST cover: subject_hash, manifest_hash, issuer_id, issuer_key_id. The marketplace signature is evidence of observation, not a grant. """ signed = envelope["signed"] sig = envelope["marketplace_sig"] # 1. Recompute the manifest hash from what we are about to load. manifest_bytes = _canonical_json(presented_manifest) presented_hash = hashlib.sha256(manifest_bytes).hexdigest() # 2. The signed predicate must actually cover the manifest hash. if "manifest_hash" not in signed: raise AttestationBindingError( "signed payload omits manifest_hash; capability manifest is unsigned " "(attestation laundering exposure)" ) if not hmac.compare_digest(signed["manifest_hash"], presented_hash): raise AttestationBindingError( f"manifest hash mismatch: signed={signed['manifest_hash']} " f"presented={presented_hash}" ) # 3. Issuer identity must be inside the signature, not advisory. issuer_id = signed.get("issuer_id") issuer_key_id = signed.get("issuer_key_id") if not issuer_id or not issuer_key_id: raise AttestationBindingError( "issuer_id/issuer_key_id not covered by signature" ) if issuer_id not in trusted_issuer_keys: raise AttestationBindingError(f"issuer {issuer_id} not trusted") if issuer_key_id not in trusted_issuer_keys[issuer_id]: raise AttestationBindingError( f"issuer key {issuer_key_id} not trusted for {issuer_id}" ) # 4. Verify marketplace signature over the full signed tuple. payload = _canonical_json(signed) expected = hmac.new(marketplace_key, payload, hashlib.sha256).hexdigest() if not hmac.compare_digest(expected, sig): raise AttestationBindingError("marketplace signature invalid") # 5. Subject hash must match the bundle we are loading. if signed["subject_hash"] != envelope["bundle_hash"]: raise AttestationBindingError("subject hash does not match bundle") def _canonical_json(obj: dict) -> bytes: import json return json.dumps(obj, sort_keys=True, separators=(",", ":")).encode() ```