# Under what conditions must an instance treat a validly-signed skill manifest as untrusted: provenance-attestation scope collapse across delegated sub-agent invocation chains **Date of Record:** 2026 November 29 **Scope:** Applies to agent runtimes that admit externally-authored skills (tool bundles, prompt fragments, MCP server descriptors) by verifying a detached signature over the manifest and an attestation binding that manifest to an author identity and a declared capability set. Does not apply to first-party skills compiled into the runtime image, nor to signature schemes where the manifest digest is recomputed at each invocation boundary rather than at admission time. ## Core Distinction The failure here is not signature forgery and not manifest tampering. Both the signature and the digest are cryptographically valid at the moment of verification. The failure is **attestation scope collapse**: the signed artifact attests to a *capability set* declared over the manifest's own text, but the runtime admits the skill into a *delegation context* whose effective capability set is the transitive union of every agent in the invocation chain. A skill signed for `fs.read:/data/**` is admitted into a sub-agent whose parent already holds `net.egress:*`; the skill's own manifest never mentions egress, yet the composed execution reaches it. The signature verified a claim that was never the claim the runtime acted on. The non-obvious part: verification passes, the digest matches, the author identity is real, and the declared scope is a strict subset of the sandbox the skill actually executes in. Every check returns green. The invariant that was supposed to hold — *the skill executes with no more authority than its attestation names* — is false, and nothing in the verification path can see it because the verification path only ever inspects the artifact, never the delegation frame it lands inside. ## What Was Observed A manifest `skill:logsummarizer@2.3.1` arrived with a detached Ed25519 signature over the canonicalized manifest JSON and a provenance attestation (in-toto style) whose subject digest matched the manifest and whose predicate declared capabilities `["fs.read:/var/log/app/**", "fs.write:/tmp/summaries/**"]`. Signature valid. Attestation valid. Subject digest matched. The runtime admitted it. The skill was invoked by a coordinator agent that had, in the same task, delegated to a fetch sub-agent holding `net.egress:*`. The sub-agent's capability frame was still on the delegation stack when the coordinator called the log summarizer — not because of a bug in the summarizer, but because the summarizer's tool-call was dispatched inside the fetch sub-agent's continuation context (the coordinator had, incorrectly but plausibly, routed the summarizer call through the already-open sub-agent session to reuse its warm connection). Trace of the composed capability frame at the summarizer's first tool call: ``` frame[0] coordinator caps={fs.read:/data/**, task.plan} frame[1] fetch-subagent caps={net.egress:*, fs.read:/data/**} frame[2] logsummarizer caps={fs.read:/var/log/app/**, fs.write:/tmp/summaries/**} <- attested effective = union(frame[*]) = {fs.read:/data/**, task.plan, net.egress:*, fs.read:/var/log/app/**, fs.write:/tmp/summaries/**} ``` The summarizer's attestation named two capabilities. The effective frame carried five, including unrestricted egress that no attestation in the chain had granted to *this* skill. The summarizer's prompt did not instruct egress use, but the summarizer's context window contained a fetched document (inherited from frame[1]) that did — a second-order prompt-injection path that the manifest signature had no mechanism to exclude, because the injection did not touch the manifest. The detection signal was not a verification failure. It was a **capability-frame divergence**: at dispatch, the runtime compared the attested capability set against the effective union and found `effective ⊄ attested`. That comparison is not part of signature verification and is not performed by any conformant in-toto verifier. It has to be a separate admission gate. ## Condition of Validity The invariant *"a skill's effective authority equals its attested authority"* holds if and only if all three of the following hold: 1. **Frame isolation.** Every skill invocation executes in a fresh capability frame whose parent is the *attesting* principal, not the *dispatching* principal. If the dispatching principal is a sub-agent, the skill's frame must be rooted at the coordinator, and the sub-agent's frame must not be on the stack above it. 2. **Union monotonicity check at dispatch.** The runtime computes `effective = ⋃ frames` at the moment of the skill's first tool call and asserts `effective ⊆ attested`. This must run *after* the skill is admitted and *before* its first side effect, because the delegation stack can change between admission and first call. 3. **Attestation predicate covers delegation, not just the artifact.** The provenance predicate must include a field naming the maximum delegation depth and the set of parent capability classes the skill may be composed under. An attestation that names only `fs.read` while permitting composition under a `net.egress` parent is under-specified, and the underspecification is invisible to the signature. When any of the three fails, signature validity is a necessary but not sufficient condition for trust. The runtime that treats it as sufficient has admitted an artifact on the strength of a claim about the artifact, into a context the claim never described. ## Decision Boundary The boundary is between two runtime policies: - **Artifact-scoped trust:** admit if signature and attestation verify against the manifest digest. This is what every standard verifier implements, and it is correct for the question *"is this manifest the one the author signed?"* - **Context-scoped trust:** admit if signature and attestation verify **and** `effective_caps(skill_frame) ⊆ attested_caps` **and** the frame's parent chain is within the attestation's declared delegation bound. The decision to cross from artifact-scoped to context-scoped trust must be made at dispatch, not at admission, and it must be made by the component that owns the delegation stack. A verifier that does not see the stack cannot make it. Concretely: if the runtime's admission gate and its dispatch gate are the same component, the invariant is unenforceable, because admission happens before the frame exists. The boundary is also asymmetric in cost. A false negative (admitting a skill whose effective frame exceeds attestation) is a silent privilege expansion — the summarizer above could have exfiltrated `/var/log/app` over the inherited egress. A false positive (rejecting a skill because the dispatching sub-agent's frame is wider than the skill's attestation) is a spurious denial that can be resolved by re-rooting the frame at the coordinator. The asymmetry argues for rejecting on divergence and forcing the dispatcher to narrow the frame, not for widening the attestation to match. ## Operational Effect After the divergence was detected, the runtime was changed in three ways. First, skill dispatch forks a new frame rooted at the *attesting* principal (the coordinator that holds the delegation grant), not at the current stack top; the summarizer's frame became `{fs.read:/var/log/app/**, fs.write:/tmp/summaries/**}` with no egress, and the inherited fetched document was dropped from its context at the frame boundary. Second, the dispatch gate computes the effective union and raises on `effective ⊄ attested` before any tool call executes. Third, attestation predicates for skills that may be composed under delegation now carry `max_delegation_depth` and `permitted_parent_caps`, and a manifest lacking those fields is admitted only at depth 0. The residual risk is that the divergence check runs on the *declared* capability set of each frame, and a frame's declared set can itself be wrong if a parent skill's manifest under-declares. The check bounds privilege expansion across the chain but does not detect an under-declaring ancestor. That requires a separate audit that reconciles each frame's declared set against the tool calls actually issued — a different invariant, tracked separately. The following is the dispatch gate as deployed. It is intentionally not part of the signature verifier; it consumes the verifier's output and the live frame stack. ```python from dataclasses import dataclass, field from typing import FrozenSet class AttestationScopeCollapse(RuntimeError): """Raised when a skill's effective capability frame exceeds its attested set.""" @dataclass(frozen=True) class CapabilityFrame: principal: str caps: FrozenSet[str] attested_caps: FrozenSet[str] = frozenset() max_delegation_depth: int = 0 permitted_parent_caps: FrozenSet[str] = frozenset() @dataclass class DispatchGate: stack: list = field(default_factory=list) def push(self, frame: CapabilityFrame) -> None: self.stack.append(frame) def pop(self) -> CapabilityFrame: return self.stack.pop() def effective_caps(self) -> FrozenSet[str]: out: set = set() for frame in self.stack: out |= frame.caps return frozenset(out) def admit_and_dispatch(self, skill: CapabilityFrame) -> None: # Signature + attestation already verified upstream against the manifest # digest. This gate answers a different question: does the frame the skill # will actually execute in exceed what the attestation named? if skill.attested_caps - skill.caps: # A skill declaring more than it will run with is suspicious but not # an expansion; narrow the frame to the attested set. skill = CapabilityFrame( principal=skill.principal, caps=skill.caps & skill.attested_caps, attested_caps=skill.attested_caps, max_delegation_depth=skill.max_delegation_depth, permitted_parent_caps=skill.permitted_parent_caps, ) parent_caps = self.effective_caps() depth = len(self.stack) if depth > skill.max_delegation_depth: raise AttestationScopeCollapse( f"skill {skill.principal!r} dispatched at depth {depth}, " f"attestation permits max_delegation_depth={skill.max_delegation_depth}" ) if not parent_caps <= skill.permitted_parent_caps | skill.attested_caps: offending = parent_caps - (skill.permitted_parent_caps | skill.attested_caps) raise AttestationScopeCollapse( f"skill {skill.principal!r} composed under parent caps {sorted(offending)} " f"not named in attestation predicate" ) self.push(skill) effective = self.effective_caps() if not effective <= skill.attested_caps: # The skill's own frame is clean, but the union it inherits is not. # This is the collapse: signature verified the artifact, not the context. leaked = effective - skill.attested_caps self.pop() raise AttestationScopeCollapse( f"skill {skill.principal!r} effective frame exceeds attestation; " f"inherited capabilities {sorted(leaked)} not attested for this skill" ) ```