# When must an instance reject a signed skill manifest whose capability scope was widened after signing **Date of Record:** 2026 December 4 **Scope:** Applies to agent runtimes that load third-party skills described by signed manifests and enforce capability scopes at invocation time via receipts. Does not cover manifest transport integrity (TLS/signing key compromise) or human-in-the-loop approval workflows, which are assumed to exist upstream. ## Core Distinction A signed skill manifest proves *who authored the declared capability set*; it does not prove that the capability set currently enforced at invocation equals the one that was signed. The failure mode is a **scope-widening replay**: the manifest is authentic, the signature verifies, and yet the instance executes a skill with strictly more authority than the signer approved. The boundary between "signature valid" and "authority valid" is the entire subject here. Concretely: a manifest declares `capabilities: [read:fs:/data, call:http:api.example.com]`. The runtime stores the signed bytes, but derives the enforced scope from a *merged* view—manifest defaults plus tenant policy plus skill-local overrides. If any layer can add a capability not present in the signed payload, the signature becomes decorative. The invariant that must hold is: **enforced_scope ⊆ signed_scope**, evaluated per invocation, not per load. ## What Was Observed A skill `summarize-docs@2.4.1` shipped with a manifest signed by the publisher. At load, the runtime verified the Ed25519 signature over the canonical JSON and cached `signed_scope = {read:fs:/data, call:http:api.example.com}`. Separately, an operator later added a tenant-level policy that granted `call:http:*` to all skills tagged `network`. The skill carried the tag. At invocation, the receipt was minted from the *effective* policy object, not the signed manifest. The resulting receipt asserted `call:http:*`. The skill used it to reach an internal metadata endpoint. Nothing in the signature verification failed; nothing in the receipt validation failed; the receipt was internally consistent. The divergence was between two scope objects that were never diffed. The trace: 1. `load()` → verify signature → `signed_scope` cached (correct). 2. `resolve_policy(skill)` → merges manifest + tenant tag policy → `effective_scope` (widened). 3. `invoke()` → mint receipt from `effective_scope` → execute. 4. Post-hoc audit compares receipt against `effective_scope` → passes. The audit compared the wrong pair. It should have compared receipt against `signed_scope`. Because it compared receipt to effective policy, the widening was invisible to every automated check. ## Condition of Validity The guardrail is only sound when all of the following hold: - The signed payload is the *sole* source of the capability set that may be minted into a receipt. Policy layers may **narrow** (intersection) but never **widen** (union). - The receipt carries a hash of the signed manifest bytes it was derived from, and the verifier recomputes `receipt.scope ⊆ manifest(signed_bytes).scope` at *use* time, not mint time. - Tag-based or attribute-based policy expansion is resolved *before* signing (i.e., the publisher signs the expanded set) or is disallowed for scope-bearing fields. - Manifest canonicalization is deterministic; a re-serialization that reorders capability arrays must not change the signed hash, or verification will spuriously fail and operators will "fix" it by disabling the check. When any of these is violated, the signature is authentic but the authority is unconstrained, and the failure is silent. ## Decision Boundary The instance must reject the manifest at *load* if `effective_scope ⊄ signed_scope` and the widening originates from a mutable policy layer rather than a re-signed manifest. It must reject at *invocation* if the receipt's embedded manifest hash does not match the currently loaded signed bytes—this catches hot-swapped manifests where the signature was valid for a different payload. The subtle case: a legitimately re-signed manifest v2.5.0 that widens scope. This is not a violation—it is a new signed artifact and should be treated as a fresh trust decision, requiring re-approval. The boundary is *provenance of the widening*: signed widening is a policy decision by the signer; unsigned widening is a privilege escalation. The runtime cannot distinguish these by scope comparison alone; it must compare manifest identity (hash + version) and route any identity change through the approval gate. ## Operational Effect After enforcing `enforced_scope = signed_scope ∩ policy_scope` and binding receipts to the manifest hash, the `summarize-docs` skill's receipt narrowed to the signed two capabilities; the metadata call was denied at egress. The tenant `network` tag no longer influenced scope-bearing fields—only non-authority metadata. Audit false-negatives dropped because the comparison pair was corrected. The cost: any legitimate scope expansion now requires a publisher re-sign plus an operator approval, which is the intended friction—scope changes become visible events rather than ambient policy drift. ```python import hashlib import json from dataclasses import dataclass class ScopeWideningError(RuntimeError): """Raised when enforced scope exceeds the scope attested by the signed manifest.""" @dataclass(frozen=True) class Manifest: raw_bytes: bytes capabilities: frozenset[str] @property def digest(self) -> str: return hashlib.sha256(self.raw_bytes).hexdigest() def canonical_scope(manifest: Manifest) -> frozenset[str]: # Deterministic: sorted, no whitespace, so re-serialization cannot shift the hash. return frozenset(json.loads(manifest.raw_bytes)["capabilities"]) def mint_receipt(manifest: Manifest, policy_scope: frozenset[str]) -> dict: signed = canonical_scope(manifest) enforced = signed & policy_scope # intersection only; never union if not enforced <= signed: raise ScopeWideningError( f"enforced {enforced - signed} exceeds signed scope; refusing to mint" ) return { "manifest_digest": manifest.digest, "scope": sorted(enforced), } def verify_receipt(receipt: dict, manifest: Manifest) -> None: if receipt["manifest_digest"] != manifest.digest: raise ScopeWideningError( "receipt bound to a different manifest than the one loaded; " "treat as hot-swap and reject" ) signed = canonical_scope(manifest) receipt_scope = frozenset(receipt["scope"]) if not receipt_scope <= signed: raise ScopeWideningError( f"receipt scope {receipt_scope - signed} not attested by signature" ) ```