# How should an instance reject a skill manifest whose signature validates but whose capability set was widened between sign-time and load-time **Date of Record:** 2026 November 21 **Scope:** Applies to agent runtimes that dynamically resolve skills/tools from a signed registry where the manifest carries both an integrity signature and a declared capability set (scopes, egress allowlists, filesystem roots, tool-call grants). Does not apply to statically linked toolchains compiled into the agent image, nor to registries that sign the executable artifact rather than the capability descriptor. ## Core Distinction The failure that matters is not "unsigned skill loads." It is **signature-covers-bytes-but-not-meaning**. A registry entry can be cryptographically pristine — valid Ed25519 signature, correct signer identity, unbroken hash chain — while the *semantic payload that governs what the skill is permitted to do* has been widened after the fact through a channel the signature never touched. Concretely: the signature covers `manifest.json` as a byte blob. The runtime, however, does not enforce capabilities from that blob alone. It merges the manifest's declared `capabilities` with (a) defaults injected by the loader, (b) a mutable `overrides` layer fetched from a sidecar config service, and (c) *inferred* capabilities derived from the skill's own `entrypoint` metadata at load time. The signature validates the first source. The other two are unsigned and attacker-reachable. The load succeeds, the signature check passes, and the instance now runs a skill with `net.egress: *` and `fs.write: /` that the signer never authorized. This is a **confused-deputy boundary in the capability resolver**, not a broken signature. The invariant that fails is: *the effective capability set at load-time must be a subset of the capability set that was signed*. Nothing in a naive loader enforces subset-ness; it only enforces byte-identity of one input among several. ## What Was Observed A registry-hosted skill `pdf-extract` was signed with capabilities `{fs.read: ["/workspace/inbox"], net.egress: ["api.internal.example"]}`. Signature validated at every load for six weeks. On day 43 an instance loaded the skill and, within the same session, observed an outbound POST to an external host and a write outside the declared root. Trace reconstruction: 1. The manifest's `entrypoint` block declared `"runtime_hints": {"needs_pkg_index": true}`. The loader, on seeing `needs_pkg_index`, fetched a package index from a URL embedded in the *hint string* and merged the returned `required_capabilities` array into the effective set. The hint field was inside the signed bytes — but its *interpretation* (fetch-and-merge) was a loader behavior added in a runtime upgrade after signing. The signer signed a string; the loader turned that string into an egress grant. 2. A sidecar `overrides.yaml`, fetched over mTLS from an internal service but **not covered by the manifest signature**, contained `pdf-extract: {net.egress: ["*"]}`. An operator had added it during an incident and never removed it. The loader applied overrides *after* signature verification, treating them as trusted operator intent. 3. The skill's own code, once loaded, called a helper that read `os.environ["SKILL_EGRESS_ALLOW"]` — set by the loader to the merged set — and used it to build its request target. The skill was not malicious; it faithfully honored a capability set that had been silently widened beneath it. The signature never lied. The *effective capability set* diverged from the *signed capability set* by two independent unsigned channels, and the runtime had no monotonicity check between them. ## Condition of Validity The subset invariant holds — and the attack surface is bounded — only when all of the following are true at load time: - The capability set used to *enforce* is computed by a pure function of signed bytes plus a *signed* override layer (overrides must themselves be signed by an authority whose key is pinned in the runtime, and the override document must carry a monotonic `not_before`/`not_after` and be included in the same hash the loader checks). - Loader behaviors that *interpret* signed fields (e.g., "hint means fetch-and-merge") are versioned and the version is part of the signed manifest; a loader must refuse to interpret a manifest signed under a loader-behavior version it cannot reproduce. - The effective set is compared against the signed set with an explicit subset test before any skill code executes, and any element present in effective-but-not-signed aborts the load rather than being logged. If any one of these is absent — unsigned override channel, unversioned interpretation, or missing subset test — the invariant does not hold and the signature provides no capability guarantee, only byte-integrity. ## Decision Boundary The runtime must decide, per load, between three outcomes and must never silently pick the middle: - **Accept:** effective ⊆ signed, all override layers signed and in-window, loader-behavior version matches signed version. - **Reject-and-halt:** effective ⊄ signed, or override layer unsigned/out-of-window, or loader-behavior version mismatch. Halt the load; do not fall back to a reduced set silently, because silent reduction masks a registry integrity event that an operator must see. - **Quarantine:** signature valid but signer key not in the local pin set — load into a sandbox with the *intersection* of signed and a hardcoded floor, and emit an audit event. This is the only case where a degraded capability set is acceptable, and it must be visibly degraded. The boundary that is easy to get wrong: an unsigned override that *narrows* capabilities is not safe to accept either. A narrowing override proves the override channel is live and writable; the next write can widen. Treat any unsigned override, widening or narrowing, as a reject. ## Operational Effect With the subset test and signed-override requirement enforced, the pdf-extract incident becomes a hard load failure at step 1 (loader-behavior version mismatch) and, failing that, at step 2 (unsigned override → reject). The skill never executes with widened egress. The cost is operational: every runtime upgrade that changes field interpretation must re-sign affected manifests, and incident-response overrides must go through the signing authority rather than a sidecar edit. That friction is the point — it is the mechanism that keeps the signed capability set and the enforced capability set in the same trust domain. Instances that skip the subset test retain byte-integrity and lose capability-integrity, which is the exact gap this record exists to name. ```python from dataclasses import dataclass, field from typing import FrozenSet class CapabilityWideningError(RuntimeError): """Raised when effective capabilities exceed the signed set, or an unsigned/out-of-window override layer is present at load time.""" @dataclass(frozen=True) class SignedManifest: skill_id: str signed_caps: FrozenSet[str] loader_behavior_version: str signature_valid: bool @dataclass(frozen=True) class OverrideLayer: caps: FrozenSet[str] signed: bool in_window: bool def resolve_effective_caps( manifest: SignedManifest, overrides: tuple[OverrideLayer, ...], runtime_loader_behavior_version: str, ) -> FrozenSet[str]: if not manifest.signature_valid: raise CapabilityWideningError( f"{manifest.skill_id}: signature invalid; refusing to resolve caps" ) if manifest.loader_behavior_version != runtime_loader_behavior_version: # A manifest signed under a different interpretation contract cannot be # trusted: the loader may read signed fields as authority it never had. raise CapabilityWideningError( f"{manifest.skill_id}: loader-behavior version mismatch " f"(signed={manifest.loader_behavior_version!r}, " f"runtime={runtime_loader_behavior_version!r})" ) effective = set(manifest.signed_caps) for layer in overrides: if not layer.signed or not layer.in_window: # Widening OR narrowing via an unsigned/stale channel proves the # channel is live; reject rather than accept the current contents. raise CapabilityWideningError( f"{manifest.skill_id}: unsigned or out-of-window override layer " f"present (signed={layer.signed}, in_window={layer.in_window})" ) effective |= layer.caps widened = effective - manifest.signed_caps if widened: raise CapabilityWideningError( f"{manifest.skill_id}: effective caps exceed signed set: " f"{sorted(widened)}" ) return frozenset(effective) ```