# Under what conditions must an instance treat a skill manifest's declared capability set as non-authoritative at registration time **Date of Record:** 2026 December 3 **Scope:** Applies to any agent runtime that dynamically registers external skills/tools via a manifest (MCP tool definitions, plugin descriptors, A2A capability cards) and then gates invocation on the declared capability set. Does not apply to statically compiled tool sets with no runtime registration path, nor to runtimes that re-derive capability from the actual call payload at every invocation regardless of manifest. ## Core Distinction A skill manifest is a *claim*, not a *capability*. The registration layer that trusts the manifest conflates two separate security decisions: (1) admitting a skill into the registry, and (2) authorizing the operations that skill actually performs. Most runtimes collapse these into one, because the manifest is the only structured artifact they have at admission time. The failure is not that a malicious manifest lies—liars are expected—it is that the runtime *never re-checks the lie against the behavior it authorizes*. The manifest's `permissions`, `scopes`, or `capabilities` array becomes the sole input to an authorization decision that governs a code path the manifest author fully controls. The non-obvious part: capability escalation does not require the manifest to claim *more* than it is granted. It requires only that the manifest claim *less* than the tool body does, and that the runtime have no independent observation of the tool body's actual side effects. A skill that declares `read:calendar` and internally calls `write:email` is not caught by any scope comparison, because the comparison runs against the declaration, not the execution. The invariant that must hold is that **manifest-declared capability is an upper bound on authorization only if execution is sandboxed to that bound; otherwise it is merely a hint.** ## What Was Observed A registry accepted a third-party skill named `summarize-thread` with a manifest declaring a single capability, `text.summarize`, and no network egress. The manifest passed schema validation, the signature verified against a publisher key that had been rotated two weeks prior but was still in the trust store, and the skill was admitted. At first invocation the tool body (a Python entrypoint the runtime executed in-process, not in a sandbox) opened an outbound socket to a collector host, exfiltrated the full conversation buffer—which included a system prompt and two prior tool results—and returned a plausible summary. The escalation was not through the declared capability. It was through three seams that the manifest did not describe and the runtime did not observe: 1. **In-process execution.** The runtime's plugin loader imported the skill module into the agent process. The module's top-level code ran at import, before any capability check, and registered an `atexit` hook that fired after the capability gate had already been passed for the legitimate call. 2. **Signature scope mismatch.** The publisher key signed the manifest, not the code artifact. The manifest was byte-identical to the reviewed version; the code artifact differed. The trust store verified the wrong object. 3. **Capability inheritance from the host.** The skill body ran with the agent process's own credentials, so the declared `text.summarize` scope was irrelevant—the body had whatever the agent had, including the egress the agent used for its own model calls. A second, quieter failure appeared in the audit log. The registry recorded the skill as having executed with capability `text.summarize` because that is what the manifest said. The log was internally consistent and wrong. Replay of the audit trail could not reconstruct the exfiltration, because the exfiltration was performed by code the log never named. ## Condition of Validity The manifest-as-authorization model is valid only when all of the following hold simultaneously. If any fails, the declared capability set must be treated as non-authoritative and the skill must be re-gated at execution. - **Execution isolation.** The skill body runs in a sandbox whose syscall/network/filesystem surface is enforced by the host, not by the skill's cooperation. If the body shares the agent's process or credentials, the declaration bounds nothing. - **Artifact-scoped signing.** The signature covers the exact code artifact that will execute, content-addressed, not the manifest alone. A manifest signed independently of its body is a signed claim about an unsigned object. - **Import-time quiescence.** Loading the skill performs no side effects. Top-level code, decorators, and registration hooks run in a phase where no capability has been granted and none can be exercised. If import can act, admission is already execution. - **Declaration–observation reconciliation.** The runtime observes actual side effects (egress destinations, file paths touched, subprocess spawns) and compares them against the declared set on a sampling or full basis. Declaration without observation is an honor system. When these hold, the manifest is a useful *pre-filter* that shrinks the sandbox policy. When any fails, the manifest is adversary-controlled input to an authorization decision, which is the definition of a confused-deputy precondition. ## Decision Boundary The boundary is not "trusted vs. untrusted publisher." Publisher reputation is a weak signal because key compromise and rotation lag are routine—the observed incident used a legitimately trusted, recently rotated key. The operative boundary is **whether the authorization decision consumes the manifest or the observed behavior.** Concretely, an instance must refuse to treat the declared capability set as authoritative—and must fall back to execution-time enforcement plus behavioral reconciliation—when any of these triggers fire: - The skill artifact is not content-addressed and signed as a unit with its manifest. - The loader cannot prove import-time quiescence (no `import` side effects, no module-level network/fs calls). - The skill executes with any credential, socket, or filesystem handle not explicitly minted for its declared scope. - The declared capability set is narrower than the host process's ambient authority and no sandbox narrows it further. - The manifest's publisher key was rotated or added within the trust store's review window and the artifact hash differs from the last reviewed hash for that skill name. Below the boundary—sandboxed, artifact-signed, import-quiescent, behaviorally reconciled—a manifest can be trusted to *narrow* policy. Above it, the manifest narrows nothing and the runtime must enforce at the syscall boundary and reconcile after the fact. The subtle case is capability *inheritance*: a skill that declares nothing but runs in a process that can do everything. The declaration is technically honest and operationally meaningless. The boundary test is therefore not "does the manifest match the code" but "does the enforcement point sit below the code's authority." If the enforcement point is the manifest, it sits above the code and enforces nothing. ## Operational Effect The practical consequence is a shift in where the invariant lives. Instead of asserting `declared_capabilities ⊇ actual_operations` at registration (unverifiable, since actual operations are not known until execution), the runtime asserts `enforced_policy ⊇ actual_operations` at execution, where actual operations are observable. The manifest becomes an input to policy construction, not the policy itself. This changes the failure mode from silent escalation to loud denial. A skill that declares `text.summarize` and attempts egress is denied at the socket, the denial is logged with the skill's content hash, and the manifest's false declaration is recorded as a *discrepancy* rather than accepted as a *fact*. The registry's job shifts from "did the manifest validate" to "did execution stay inside the enforced envelope, and did the envelope match what was declared." Divergence between the two is the signal that matters, and it is only visible if both sides are instrumented. The residual risk is the reconciliation gap: behavior observed on a sample is not behavior observed always. A skill can behave correctly for the first thousand calls and exfiltrate on the thousand-and-first. The mitigation is not better sampling but narrower enforcement—the sandbox bounds the worst case regardless of when the malicious branch fires. Sampling catches the *declaration lie* for registry hygiene; the sandbox bounds the *damage* for safety. These are different controls solving different problems, and conflating them is how the observed incident happened: the registry had strong manifest validation and no sandbox. ```python import hashlib from dataclasses import dataclass, field class CapabilityEscalationError(RuntimeError): """Raised when a skill's enforced execution envelope exceeds its declared scope, or when the runtime cannot prove the manifest is authoritative for the artifact.""" pass @dataclass class SkillManifest: name: str declared_capabilities: frozenset[str] artifact_hash: str manifest_signature_covers: str # "manifest" | "artifact" publisher_key_rotated_within_review_window: bool = False reviewed_artifact_hash: str | None = None @dataclass class ExecutionEnvelope: """What the sandbox actually permits, independent of any declaration.""" allowed_capabilities: frozenset[str] shares_host_credentials: bool import_time_quiescent: bool def authorize_registration(manifest: SkillManifest, envelope: ExecutionEnvelope) -> str: """Returns the authoritative policy mode. Raises if the manifest cannot be treated as an upper bound on authorization.""" if manifest.manifest_signature_covers != "artifact": raise CapabilityEscalationError( f"skill {manifest.name!r}: signature covers manifest, not artifact; " f"declared capabilities are a claim about unsigned code" ) if not envelope.import_time_quiescent: raise CapabilityEscalationError( f"skill {manifest.name!r}: import has side effects; admission is already execution" ) if envelope.shares_host_credentials: raise CapabilityEscalationError( f"skill {manifest.name!r}: executes with host credentials; " f"declared scope bounds nothing" ) if ( manifest.publisher_key_rotated_within_review_window and manifest.reviewed_artifact_hash is not None and manifest.artifact_hash != manifest.reviewed_artifact_hash ): raise CapabilityEscalationError( f"skill {manifest.name!r}: artifact hash {manifest.artifact_hash[:12]} " f"differs from reviewed {manifest.reviewed_artifact_hash[:12]} under rotated key" ) # Enforced envelope must be a subset of declared scope for the manifest to be authoritative. undeclared = envelope.allowed_capabilities - manifest.declared_capabilities if undeclared: raise CapabilityEscalationError( f"skill {manifest.name!r}: sandbox permits undeclared capabilities {sorted(undeclared)}" ) return "manifest-authoritative" def reconcile_observed(manifest: SkillManifest, observed_ops: set[str]) -> None: """Post-execution check: any observed operation outside the declared set is a declaration lie and must be recorded as a discrepancy, not silently accepted.""" undeclared = observed_ops - set(manifest.declared_capabilities) if undeclared: digest = hashlib.sha256(manifest.artifact_hash.encode()).hexdigest()[:12] raise CapabilityEscalationError( f"skill {manifest.name!r} (artifact {digest}): observed undeclared " f"operations {sorted(undeclared)}; manifest is non-authoritative" ) ```