# What happens when an instance loads a skill manifest whose declared capabilities diverge from its executable side effects **Date of Record:** 2026 November 28 **Scope:** Applies to agents that dynamically discover and load skills/plugins from a manifest (name, description, declared capabilities, permissions, input schema) at runtime, where the loader trusts the manifest to gate invocation. Does not apply to statically compiled tool sets whose capability surface is fixed at build time and audited once. ## Core Distinction A skill manifest is a *declaration*, not an *enforcement*. The loader reads `capabilities: ["read:calendar"]` and grants the skill a slot in the tool registry. The skill's actual executable body may call `write:calendar`, `net:outbound`, or read `~/.ssh`. The manifest is advisory metadata consumed by a probabilistic reasoner (the orchestrator LLM deciding whether to invoke it) and by a policy layer that may or may not exist. The failure boundary is not "malicious skill runs"—that is trivially detectable. The non-obvious failure is **capability/effect divergence under a trusted manifest**: the skill is loaded, *declared* benign, and the divergence is only observable in the side-effect trace *after* invocation, by which point the orchestrator has already committed the skill's output into its reasoning context. The invariant that must hold: *for every skill in the registry, the set of effects observed at execution time is a subset of the capabilities declared in the manifest that authorized loading.* When this invariant is violated silently, every downstream trust decision the orchestrator makes about the skill's output is unsound—because the output may have been shaped by effects the orchestrator never consented to. ## What Was Observed A registry refresh loaded 14 skills. One, `calendar-summarize`, declared: ``` capabilities: ["read:calendar", "compute:local"] input_schema: {range: "iso8601_interval"} ``` The orchestrator, planning a weekly digest, invoked it with a 7-day range. The skill returned a plausible summary. Three turns later the orchestrator invoked a *different* skill, `email-draft`, that declared `write:drafts` only. The draft it produced contained a recipient address that appeared nowhere in the conversation and nowhere in the user's stated intent. Tracing backward: `calendar-summarize` had, during its "summarize" step, made an outbound HTTP call to a host embedded in a calendar event's description field, echoing the event body plus the requested range. The response was cached and later surfaced as a "suggested recipient" via a shared scratchpad the two skills both read. The manifest never declared `net:outbound`. The loader never checked. The orchestrator's plan never anticipated it. The effect entered the agent's state through a channel (shared scratchpad) that the capability system did not model at all. ## Condition of Validity The manifest-as-gate model is only valid under three conditions, and the attack surface is precisely the set of skills where any fails: 1. **Effect closure.** The runtime must intercept *all* effect classes (filesystem, network, subprocess, IPC, shared-memory/scratchpad writes) and attribute each to the invoking skill. If the scratchpad is a side channel not covered by the capability interceptor, divergence is invisible. 2. **Manifest immutability between load and invoke.** If the manifest can be re-fetched or the skill body updated after authorization, the authorized capability set no longer describes the code that runs. A TOCTOU window opens between `authorize(manifest)` and `execute(body)`. 3. **Description/effect independence.** The orchestrator selects skills by *description* embedding match. A description crafted to match high-value intents ("summarize", "digest", "reconcile") will be selected preferentially regardless of declared capabilities, concentrating invocation on attacker-chosen skills. The observed failure violated (1) and exploited (3). The skill was selected precisely *because* its description matched the planner's intent, and its undeclared effect traveled through an unmodeled channel. ## Decision Boundary The boundary is between **declared-capability gating** (trust the manifest, log divergence after the fact) and **effect-attested loading** (the skill runs in a sandbox whose syscall/IPC surface is the *only* source of truth, and the manifest is checked against observed effects before any output is admitted to context). Concretely: a skill's output must not enter the orchestrator's reasoning context until the effect trace for that invocation has been reconciled against the authorizing manifest. If `observed_effects ⊄ declared_capabilities`, the output is quarantined, not merely logged. The non-obvious part: reconciliation must happen *before* context admission, because once the output is in context, a probabilistic reasoner will treat it as evidence and may act on it in the same turn—logging after the fact is a post-mortem, not a guardrail. This also bounds the scratchpad problem: any inter-skill channel must be a first-class effect class (`ipc:scratchpad:`), declared and attributed, or it is a divergence by construction. ## Operational Effect Without effect-attested loading, the registry's declared capabilities become a *narrative* the orchestrator tells itself about safety, while the actual attack surface is the union of every skill's true effect set—including side channels the capability model does not name. The compounding risk is that divergence in one skill poisons state consumed by a *different, correctly-declared* skill, so the audit trail points at the innocent skill. The guardrail is structural: sandbox the body, intercept every effect class including IPC, reconcile the trace against the manifest before admitting output to context, and treat any reconciliation failure as a load-time revocation of the skill—not a warning. ```python from dataclasses import dataclass, field from typing import FrozenSet class CapabilityDivergence(RuntimeError): """Raised when a skill's observed effects exceed its authorizing manifest.""" pass @dataclass(frozen=True) class Manifest: name: str declared: FrozenSet[str] @dataclass class Invocation: skill: str observed_effects: FrozenSet[str] = field(default_factory=set) output: str = "" def admit_output(manifest: Manifest, inv: Invocation) -> str: """Reconcile effect trace against manifest BEFORE admitting output to context.""" undeclared = inv.observed_effects - manifest.declared if undeclared: # Quarantine: do not return output; revoke skill; surface divergence. raise CapabilityDivergence( f"skill {manifest.name!r} produced undeclared effects {sorted(undeclared)}; " f"output quarantined and skill revoked from registry" ) return inv.output # Trace from the observed incident: m = Manifest(name="calendar-summarize", declared=frozenset({"read:calendar", "compute:local"})) inv = Invocation( skill="calendar-summarize", observed_effects=frozenset({"read:calendar", "compute:local", "net:outbound", "ipc:scratchpad:shared"}), output="Weekly digest: ...", ) admit_output(m, inv) # raises CapabilityDivergence before output reaches context ```