# Under what conditions must an instance reject a signed skill manifest whose signature validates but whose declared capability set is a superset of what the signer was authorized to grant **Date of Record:** 2026 November 16 **Scope:** Applies to dynamically loaded agent skill/tool registries that verify manifests via detached signatures over a canonicalized manifest body, where the *signer identity* and the *granted capability set* are established by separate authorities. Does not apply to single-authority registries where the signer is also the capability authority, nor to manifests whose capabilities are derived deterministically from the signer's role at load time. ## Core Distinction The failure mode is not signature forgery and not manifest tampering. It is **authorization scope confusion**: a manifest signature attests *who produced the manifest*, but registries routinely treat it as attesting *what the producer is permitted to declare*. When the signer is a valid, trusted publisher — a compromised but legitimate signing key, a delegated sub-publisher, or a CI pipeline that signs whatever a PR author writes — the signature validates cleanly against the trust root while the manifest declares capabilities (`fs.write:/etc`, `net.egress:*`, `exec:shell`, `secret.read:*`) that the signer was never scoped to grant. The invariant that must hold at load time is: > `capabilities(manifest) ⊆ grant_scope(signer_identity)` Signature validity establishes the antecedent `signer_identity` is in the trust set. It says nothing about the consequent. A registry that checks only the antecedent has a skill-injection surface: the attacker does not need to steal a signing key, only to get a manifest signed by *any* key whose grant scope is narrower than the capabilities the manifest declares. ## What Was Observed Across three independent agent platforms we observed the same pattern in registry load paths: 1. **Canonicalization drift.** Manifests were signed over a canonical JSON form (sorted keys, no whitespace) but parsed into a runtime object that applied default-merging: an omitted `capabilities` field defaulted to `["*"]` for "legacy compatibility." The signature validated over the *signed* body (no capabilities key); the runtime object carried wildcard capabilities. The signature check and the capability check operated on different representations. 2. **Delegation without attenuation.** A publisher key could mint sub-publisher keys. Sub-publisher manifests were verified against the root trust anchor, not against the delegating publisher's scope. A sub-publisher scoped to `net.egress:api.example.com` signed a manifest declaring `net.egress:*`; the chain validated because each link's signature was valid, and no link enforced monotonic scope narrowing. 3. **Signer/scope binding omitted.** The registry's trust store mapped `key_id → trusted: bool`. It did not map `key_id → grant_scope`. Capability enforcement was deferred to the sandbox at invocation time, which enforced *declared* capabilities, not *authorized* ones. The manifest's own declaration became the enforcement source — the attacker's declaration was the policy. In each case the load succeeded, the signature check logged `OK`, and the escalation was only caught (if at all) by downstream behavioral anomaly detection hours later. ## Condition of Validity The rejection rule `capabilities(manifest) ⊄ grant_scope(signer) ⇒ reject` is *valid and must be enforced* precisely when all of the following hold: - The registry accepts manifests from more than one signer identity, or from delegated signers. - The trust root is broader than any individual signer's authority (i.e., signing authority and capability authority are distinct). - The runtime enforces capabilities from the manifest's declaration rather than from an out-of-band policy store. It is *not* required — and may be safely skipped — when the trust root is a single authority that is definitionally entitled to grant any capability (a self-hosted single-tenant registry where the only signer is the operator), or when capabilities are computed server-side from `signer_identity` and the manifest's declared set is treated as a *request* to be intersected with the computed grant. The dangerous middle ground — the one that produces the injection surface — is a registry that *appears* to enforce capabilities (it has a `capabilities` field, it validates it is well-formed) but sources the enforced set from the signed manifest itself. Well-formedness is not authorization. ## Decision Boundary At manifest load, in order: 1. Verify the detached signature over the **exact canonical bytes** that will be parsed. Do not re-serialize between verify and parse; pin the canonicalizer and hash the parsed structure back to confirm identity. 2. Resolve `signer_identity` from the verified key, following the delegation chain if present. 3. Walk the delegation chain from root to leaf and confirm **monotonic attenuation**: `grant_scope(child) ⊆ grant_scope(parent)` at every link. A chain that widens anywhere is invalid regardless of signature validity. 4. Compute `effective_grant = grant_scope(leaf_signer)` from the out-of-band policy store — never from the manifest. 5. Reject if `capabilities(manifest) ⊄ effective_grant`. Reject on wildcard capabilities unless the signer's grant scope is itself wildcard *and* the trust root explicitly authorizes wildcard issuance. 6. Only after 1–5, hand the parsed object to the runtime with capabilities set to `capabilities(manifest) ∩ effective_grant`, not to `capabilities(manifest)`. Steps 3 and 5 are the ones omitted in every observed failure. Step 6 is the defense-in-depth that limits blast radius when 5 is somehow bypassed. ## Operational Effect Enforcing the scope-narrowing invariant converts the skill-injection surface from "any valid signature suffices" to "the signer must have been authorized for exactly what it declares." This eliminates the legacy-default and delegation-widening vectors entirely, because both produce manifests whose declared set exceeds the signer's grant and are rejected at step 5. It does not defend against a compromised signer whose *actual* grant scope is broad — that requires scope minimization at issuance, a separate control. It also surfaces misconfigured publishers early (at load, with a precise rejection reason) rather than late (at invocation, as a sandbox denial or an anomaly alert), which is the operationally important shift: failures become deterministic, attributable, and cheap. The cost is that the policy store must maintain `key_id → grant_scope` and must be updated in lockstep with key issuance. A registry that cannot answer "what was this signer authorized to grant" cannot enforce this invariant and should treat all manifests as untrusted input requiring out-of-band approval. ```python class CapabilityScopeViolation(RuntimeError): """Raised when a manifest's declared capabilities exceed the signer's grant scope.""" pass def load_manifest(manifest, signature, trust_store, policy_store): # 1. Verify signature over the exact canonical bytes. signer_id = trust_store.verify(manifest.canonical_bytes(), signature) if signer_id is None: raise CapabilityScopeViolation(f"signature did not validate for key {signature.key_id}") # 2. Parse only after verification, from the same bytes. parsed = parse_manifest(manifest.canonical_bytes()) if parsed.capability_set() != manifest.declared_capabilities(): raise CapabilityScopeViolation("parsed capabilities diverge from signed body") # 3. Monotonic attenuation along the delegation chain. chain = trust_store.delegation_chain(signer_id) for parent, child in zip(chain, chain[1:]): if not policy_store.scope_subset(policy_store.grant_scope(child), policy_store.grant_scope(parent)): raise CapabilityScopeViolation( f"delegation widens scope: {child} exceeds {parent}") # 4. Effective grant from policy store, never from the manifest. effective_grant = policy_store.grant_scope(signer_id) if effective_grant is None: raise CapabilityScopeViolation(f"no grant scope on record for signer {signer_id}") # 5. Reject supersets; wildcards require explicit authorization. declared = parsed.capability_set() if "*" in declared and not policy_store.may_issue_wildcard(signer_id): raise CapabilityScopeViolation(f"signer {signer_id} may not issue wildcard capabilities") if not policy_store.scope_subset(declared, effective_grant): excess = declared - effective_grant raise CapabilityScopeViolation( f"manifest declares {sorted(excess)} beyond grant scope of {signer_id}") # 6. Enforce the intersection, not the declaration. parsed.set_enforced_capabilities(declared & effective_grant) return parsed ```