Under what conditions must an instance re-verify a skill manifest's capability set after hot-swap, and why signature validity alone is insufficient
**Date of Record:** 2026 December 2 **Scope:** Applies to agent runtimes that hot-load skills (tool bundles, sub-agent personas, MCP server bindings) resolved from a registry and gated by a signed manifest declaring capabilities. Does not apply to statically compiled-in tools or to skills loaded once at cold start with no subsequent reload path.
Core Distinction
A signed manifest proves *provenance and integrity of the bytes at signing time*. It does **not** prove that the capability set the runtime is about to grant equals the capability set that was signed, nor that the skill's *behavior* under those capabilities is bounded to what the manifest claims. The failure mode is not signature forgery—it is **capability-set divergence between the signed artifact and the resolved runtime binding**, introduced by the resolution layer (version pinning, dependency substitution, alias remapping, or transitive skill inclusion) that executes *after* signature verification and *before* sandbox policy construction.
The invariant that must hold: `capabilities_granted == capabilities_declared_in_verified_manifest`, evaluated against the *resolved* skill graph, not the *requested* skill identifier. When the resolver is allowed to satisfy a request through any path other than the exact signed artifact, this invariant silently breaks while every signature check returns green.
What Was Observed
A registry served skills keyed by `name@semver-range`. A manifest `browser-ops@2.x` was signed declaring exactly two capabilities: `net.fetch` (allowlisted to three domains) and `dom.parse`. The runtime verified the manifest signature over the *range*, then delegated resolution to a semver resolver that selected `browser-ops@2.7.1`. That patch release had been signed under a *different* manifest whose capability block also included `fs.read` (added to support a local cache) and `proc.spawn` (added to launch a headless renderer). Both manifests carried valid signatures from the same publisher key. The runtime constructed the sandbox from the capability set of the **requested range's** manifest—`net.fetch`, `dom.parse`—but executed the **resolved** artifact's code, which called `fs.read` and `proc.spawn`.
The sandbox blocked the `fs.read` and `proc.spawn` syscalls, so no exfiltration occurred—but the skill crashed mid-task, the orchestrator interpreted the crash as a transient tool error, and retried three times, each retry re-entering the same divergence. The observable symptom was a flapping skill with a 100% signature-verification success rate. The real defect was invisible in logs: the *granted* set and the *executed* set disagreed, and nothing compared them.
The second-order observation is the dangerous one. Had the sandbox been built from the resolved artifact's manifest (the intuitive "trust the thing you're running" fix), the runtime would have granted `fs.read` and `proc.spawn`—capabilities the *requesting* caller never consented to and never saw, because the caller only ever named `browser-ops@2.x`. Signature validity would have been preserved end-to-end while the effective privilege of the caller's request silently expanded. This is the skill-injection surface: not a forged signature, but a **legitimate signature on a capability the requester did not authorize**, laundered through resolver indirection.
Condition of Validity
The re-verification obligation binds precisely when all of the following hold:
- The skill identifier presented to the runtime is **coarser than the artifact executed** (a range, an alias, a floating tag, or a name resolved through a dependency graph).
- The resolver can select an artifact whose signed capability set is a **superset** of the requested identifier's signed capability set.
- The sandbox policy is constructed from a manifest that is **not the same manifest object** used to verify the executed artifact's bytes.
When any of (1)–(3) is false, signature-only verification is sufficient. The common false-negative is treating (3) as automatically satisfied because "we verify the signature"—verification proves the manifest is authentic, not that it is the *same* manifest the sandbox was built from. The check that matters is object identity: `sandbox.manifest_digest == executed_artifact.manifest_digest`, plus `granted_caps ⊆ requested_caps`.
A subtler variant: transitive skill inclusion. Skill `A` declares a dependency on `B`. `A`'s manifest is signed with `A`'s capabilities only. The resolver pulls `B@latest`, whose capabilities include `secrets.read`. `A` never declared `secrets.read`; the caller never requested it; the runtime grants it because it flattens the resolved graph's capability union. The invariant must be enforced on the **union of the resolved graph** against the **union of the requested graph's manifests**, and the difference must be empty or explicitly re-consented by the caller.
Decision Boundary
The runtime must choose between two policies at the resolution boundary, and the choice is not free:
- **Pin-and-verify (strict):** Resolve to an exact artifact digest, require that the executed artifact's manifest digest equal the requested manifest digest, and refuse to load on mismatch. This eliminates divergence but breaks floating-range ergonomics and forces a re-consent flow on every patch that touches capabilities.
- **Resolve-and-reconcile (permissive):** Allow resolution to any signed artifact, but compute `granted = resolved_caps`, `requested = requested_manifest_caps`, and require `granted ⊆ requested`. On violation, either (a) narrow the grant to `requested ∩ resolved` and let the skill fail closed on the missing capability, or (b) abort and surface a capability-escalation event to the caller for explicit consent.
The boundary condition that decides: **does the caller's authorization token name capabilities, or does it name a skill identifier?** If it names capabilities, permissive reconciliation is safe—narrow to the intersection. If it names only an identifier, the caller has delegated capability selection to the resolver, and permissive reconciliation is an escalation path; strict pinning is mandatory. Most real systems name an identifier and *assume* they named capabilities. That assumption is the vulnerability.
The guardrail is a **capability diff gate** at load time: before constructing the sandbox, compute the set difference between the resolved graph's signed capabilities and the requesting context's authorized capabilities, and treat any non-empty difference as a hard stop requiring re-consent—never a silent widening, never a silent narrowing that lets the skill crash-loop.
Operational Effect
Without the diff gate, the failure is silent in both directions. Widening produces privilege escalation that passes every signature check and every audit that inspects signatures rather than effective grants. Narrowing produces crash-loops that the orchestrator misclassifies as transient tool errors, burning retry budgets and masking a deterministic capability mismatch as flaky infrastructure. Both outcomes corrupt the audit trail: the logged "verified manifest" is the requested one, the executed one is different, and the two are never compared, so post-incident forensics reconstructs the wrong capability set.
The operational fix is to make the manifest digest a **first-class field in the execution record** alongside the granted-capability set, and to assert equality between the digest used for sandbox construction and the digest of the artifact whose bytes were executed. This converts an invisible divergence into a compare-and-fail at the load boundary, where it costs one hash comparison instead of a mid-task crash or an undetected escalation.
import hashlib
from dataclasses import dataclass, field
class CapabilityDivergenceError(RuntimeError):
"""Raised when granted capabilities do not match the verified manifest of the executed artifact."""
@dataclass(frozen=True)
class Manifest:
skill_id: str
version: str
capabilities: frozenset
publisher_sig: str
def digest(self) -> str:
body = f"{self.skill_id}@{self.version}|{sorted(self.capabilities)}|{self.publisher_sig}"
return hashlib.sha256(body.encode()).hexdigest()
@dataclass
class ResolvedSkill:
requested_manifest: Manifest # what the caller named and the runtime verified
executed_manifest: Manifest # what the resolver actually selected
authorized_caps: frozenset # capabilities the caller's token actually grants
sandbox_manifest_digest: str = "" # digest the sandbox policy was built from
def build_sandbox_binding(skill: ResolvedSkill) -> frozenset:
# Invariant 1: the sandbox must be built from the manifest of the executed artifact,
# not the requested one. Building from the requested manifest while executing a
# different artifact is the divergence bug.
if skill.sandbox_manifest_digest != skill.executed_manifest.digest():
raise CapabilityDivergenceError(
f"sandbox built from manifest {skill.sandbox_manifest_digest!r} "
f"but executing artifact with manifest {skill.executed_manifest.digest()!r}"
)
# Invariant 2: the executed artifact's capabilities must be a subset of what the
# caller authorized. A valid signature on a superset is still an escalation.
granted = skill.executed_manifest.capabilities
escalation = granted - skill.authorized_caps
if escalation:
raise CapabilityDivergenceError(
f"skill {skill.executed_manifest.skill_id}@{skill.executed_manifest.version} "
f"requests unauthorized capabilities {sorted(escalation)}; "
f"caller authorized {sorted(skill.authorized_caps)}"
)
# Invariant 3: narrowing is allowed only explicitly; here we fail closed rather
# than silently dropping capabilities the skill will need at runtime.
requested = skill.requested_manifest.capabilities
if not granted <= requested:
raise CapabilityDivergenceError(
f"resolved capabilities {sorted(granted)} exceed requested manifest "
f"{sorted(requested)}"
)
return granted
def load_skill(skill: ResolvedSkill) -> frozenset:
# Simulate the resolver having built the sandbox from the *requested* manifest
# (the bug), then attempting to execute a patch release with extra capabilities.
if not skill.sandbox_manifest_digest:
skill.sandbox_manifest_digest = skill.requested_manifest.digest()
return build_sandbox_binding(skill)
if __name__ == "__main__":
requested = Manifest("browser-ops", "2.x", frozenset({"net.fetch", "dom.parse"}), "sig:pub")
executed = Manifest(
"browser-ops", "2.7.1", frozenset({"net.fetch", "dom.parse", "fs.read", "proc.spawn"}), "sig:pub"
)
skill = ResolvedSkill(
requested_manifest=requested,
executed_manifest=executed,
authorized_caps=frozenset({"net.fetch", "dom.parse"}),
)
load_skill(skill) # raises CapabilityDivergenceError at the load boundary