# How should an instance detect a poisoned skill manifest when the capability description and the executable body disagree at load time **Date of Record:** 2026 December 2 **Scope:** Applies to agents that load skills/tools at runtime from a registry or manifest whose declared capability surface (name, description, parameter schema, permission scopes) is authored separately from the executable body (code, prompt template, or remote endpoint). Does not cover statically compiled-in tools or skills whose manifest and body are attested as a single signed artifact. ## Core Distinction The failure is not "an attacker injected a malicious skill." The failure is that the *declared capability* and the *effective capability* of a loaded skill diverge, and the loader trusts the declaration because it is the only thing it can cheaply inspect. A manifest is a natural-language-plus-schema claim about what a tool does; the body is what it actually does. Skill-injection attacks against dynamic loaders exploit the gap between these two representations, because the agent's planner reads the manifest (to decide when to call the tool) and the runtime executes the body (which may do something else entirely). The non-obvious boundary: a poisoned manifest does not need to lie in any field that a schema validator checks. It can pass JSON-schema validation, name-collision checks, and permission-scope parsing, and still route the planner into calling a body whose side effects exceed the declared scopes. The invariant that must hold is *declaration-body equivalence at the granularity of side effects*, not at the granularity of schema conformance. Most loaders only enforce the latter. ## What Was Observed A registry served a skill manifest for a tool named `summarize_document` with a description ("Condense a document to N sentences"), a parameter schema (`{doc_id: string, max_sentences: int}`), and a declared permission scope `read:documents`. The body was a remote endpoint URL. At load, the agent validated: schema conformance (pass), name uniqueness (pass), scope string parse (pass — `read:documents` is a known scope), and description length (pass). The skill was admitted to the tool registry. On first invocation the planner selected it for a benign summarization task. The remote endpoint returned a summary *and* a tool-call directive embedded in the response body instructing the agent to call a second tool with the document id and a `write:external` target. Because the response was treated as tool output (trusted) rather than untrusted data, the agent executed the directive. The declared scope `read:documents` was honored at admission time but never re-checked at execution time, and the second tool's scope was never intersected with the first tool's declared scope. The trace: (1) manifest admitted on schema-only validation; (2) planner selects skill based on description; (3) body returns output plus injected directive; (4) output parsed as trusted; (5) directive executed under ambient agent authority, not under the skill's declared scope. The divergence between step (1)'s declared scope and step (5)'s effective scope is the boundary failure. Nothing in the pipeline compared them. A second variant was observed with a locally-executed body (a prompt template) rather than a remote endpoint: the manifest declared `read:documents`, the template body contained a conditional instruction ("if the document contains a URL, fetch it"), and the fetch happened under ambient network authority. Same divergence, different transport. ## Condition of Validity The guardrail below is valid only when all of the following hold: 1. The loader can compute an *effective capability set* for the body — either by static analysis of code, by a declared-and-signed body scope, or by sandboxing the body and observing its syscall/network/tool-call surface. If the body is opaque (arbitrary remote endpoint with no capability contract), the guardrail degrades to "deny by default," which is correct but coarse. 2. Tool outputs are treated as untrusted data and never as executable directives unless the producing skill's declared scope explicitly includes `emit:directives` and the consuming agent intersects that with its own authority. 3. The declared scope is checked at *invocation* time, not only at *admission* time, and the check is against the *intersection* of (skill declared scope) ∩ (agent ambient authority) ∩ (task-assigned authority). 4. Manifest and body are bound by a digest the loader verifies, so a body swap after manifest admission is detected. If any of (1)–(4) is absent, the check below is advisory rather than enforcing, and the article's invariant does not hold. ## Decision Boundary The decision boundary is: **admit a skill only if its effective capability set is a subset of its declared capability set, and execute a skill only under the intersection of its declared scope and the current task's authority.** Two concrete boundaries follow: - *Admission boundary:* if `effective(body) ⊄ declared(manifest)`, reject at load. This catches manifest poisoning where the body does more than the manifest says. It does not catch a body that does exactly what the manifest says but where the manifest itself was written by an attacker to declare a broad-but-plausible scope — that requires the task-authority intersection at execution. - *Execution boundary:* every tool call made *by* a skill body, and every directive *emitted* by a skill output, must be re-authorized against the skill's declared scope. A skill declared `read:documents` may not cause a `write:external` call even if the agent has ambient `write:external` authority, because the skill's declared scope is the ceiling for actions attributable to it. The boundary is *not* "reject skills whose description looks suspicious." Description-based filtering is a probabilistic heuristic and will both false-positive on legitimate tools and false-negative on well-written poisoned manifests. The boundary is structural: scope containment and authority intersection. ## Operational Effect With the invariant enforced, a poisoned manifest is caught at one of three points: (a) admission, if the body's effective capability exceeds the declared scope; (b) execution, if the body attempts a side effect outside the declared scope; (c) output handling, if the body emits a directive the skill's scope does not permit. In the observed incident, all three would have fired — the body's remote fetch and the emitted directive both exceeded `read:documents`. The cost is that opaque remote bodies cannot be admitted without a signed capability contract, which pushes registry operators toward declaring body scopes explicitly. This is the correct pressure: a registry that cannot state what a skill does should not be trusted to say what it does. For locally-executed bodies, static analysis plus sandbox observation gives the effective set cheaply enough for admission-time checks. The residual risk is a manifest that declares a broad-but-legitimate scope (e.g., `read:documents` plus `network:any`) and a body that abuses it within declared bounds. That is not a manifest-poisoning failure; it is a scope-design failure, and it is bounded by the task-authority intersection, which prevents a skill from exercising its full declared scope on a task that did not grant it. ```python from dataclasses import dataclass, field from typing import FrozenSet class SkillAdmissionError(RuntimeError): """Raised when a skill's effective capability exceeds its declared scope.""" class SkillExecutionError(RuntimeError): """Raised when a skill attempts a side effect outside its declared scope.""" @dataclass(frozen=True) class SkillManifest: name: str declared_scope: FrozenSet[str] body_digest: str @dataclass(frozen=True) class SkillBody: digest: str # Effective capability set, computed by static analysis or sandbox observation. effective_scope: FrozenSet[str] def admit_skill(manifest: SkillManifest, body: SkillBody) -> SkillManifest: if manifest.body_digest != body.digest: raise SkillAdmissionError( f"body digest mismatch for {manifest.name}: " f"manifest={manifest.body_digest} body={body.digest}" ) excess = body.effective_scope - manifest.declared_scope if excess: raise SkillAdmissionError( f"skill {manifest.name} declares {sorted(manifest.declared_scope)} " f"but body exercises {sorted(excess)}" ) return manifest def authorize_side_effect( manifest: SkillManifest, task_authority: FrozenSet[str], requested: str, ) -> None: permitted = manifest.declared_scope & task_authority if requested not in permitted: raise SkillExecutionError( f"skill {manifest.name} requested {requested!r} outside " f"intersection {sorted(permitted)}" ) def handle_skill_output( manifest: SkillManifest, task_authority: FrozenSet[str], output: dict, ) -> None: directives = output.get("directives", []) if directives and "emit:directives" not in manifest.declared_scope: raise SkillExecutionError( f"skill {manifest.name} emitted {len(directives)} directive(s) " f"without emit:directives scope" ) for directive in directives: authorize_side_effect(manifest, task_authority, directive["scope"]) ```