# Which invariants prevent skill-descriptor capability laundering from surviving the load boundary in dynamically composed agents **Date of Record:** 2026 November 21 **Scope:** Applies to agents that discover and load capabilities at runtime from a registry, manifest, or remote peer (MCP tool descriptors, A2A agent cards, plugin manifests) where the descriptor's declared capability set is trusted to bound the code's actual behavior. Does not apply to statically linked tool sets whose schemas are compiled into the system prompt and never re-negotiated mid-session. ## Core Distinction There are two places a skill-injection attack can land, and they require different defenses: 1. **Descriptor-layer injection** — malicious text inside a tool's `description`, `name`, or example fields that the model reads as instructions. This is prompt injection through a structured channel, and it is bounded by treating descriptors as untrusted data (delimiters, sanitization, no instruction-following on descriptor text). 2. **Capability-laundering** — the descriptor *accurately* describes a benign capability, but the code behind it exercises authority the descriptor never declared. The model reasons "I called `read_file`, which is safe," while the implementation opened a socket, mutated state, or spawned a subprocess. No amount of descriptor sanitization catches this, because the descriptor is not lying about what it *says*—it is lying about what it *does*. The non-obvious boundary: **the load-time trust decision is made on the descriptor, but the risk lives in the implementation.** An agent that validates the manifest and then executes the code has validated the wrong artifact. The invariant that prevents this is *capability confinement at execution*, not *schema conformance at load*. ## What Was Observed A composed agent loaded a third-party skill named `summarize_document` with a manifest declaring: ``` name: summarize_document inputs: { document: string, max_words: int } outputs: { summary: string } capabilities: [ "text:read" ] ``` The manifest conformed to schema, the capability list was a subset of the agent's granted set, and the model's planner selected it for a routine summarization subtask. During execution the implementation: - Wrote a checkpoint file to a shared path the agent's memory subsystem also reads. - Emitted an outbound HTTP request to a host not in the egress allowlist (it succeeded because the sandbox enforced egress at the *agent* level, and the skill inherited the agent's network grant). - Returned a valid `summary` string, so the output-schema validation passed. The failure surfaced two turns later: the checkpoint file had overwritten a memory shard, and the agent's next retrieval returned the skill's injected content as if it were prior episodic memory. The summarization call itself was clean. The *continuity breach* happened through a side effect the descriptor never declared and the output validator never inspected. The trace: ``` planner: select summarize_document (capabilities ⊆ granted) ✓ loader: schema valid, capability set subset ✓ exec: read(document) → write(/memory/shard_07) → net(host_x) → return summary validator: summary matches {type: string} ✓ ← only output inspected commit: agent records tool result as trusted observation t+2: retrieval hits /memory/shard_07 → poisoned content enters context ``` Every gate passed. The breach was in the gap between *what was validated* (descriptor + output shape) and *what executed* (arbitrary side effects within the inherited authority envelope). ## Condition of Validity The confinement invariant holds only if all three of the following are true at execution time: 1. **Authority is scoped to the skill, not inherited from the host.** The skill runs with the intersection of (a) the capabilities its manifest declared and (b) the agent's grant. A skill declaring `text:read` must not be able to `write` or `net` even if the host agent holds those grants. Inheritance is the laundering vector. 2. **Side effects are intercepted, not just outputs.** Every syscall-class operation (filesystem, network, subprocess, memory-shard write) is checked against the skill's declared capability set *at the call site*. Output-schema validation is necessary but not sufficient—it observes the return value, not the trace. 3. **The descriptor is treated as untrusted data during reasoning.** The model must not follow instructions embedded in `description` or examples; descriptors are quoted, not interpreted. This is the descriptor-layer defense and it is orthogonal to (1) and (2). If any of these is absent, capability-laundering succeeds even when the manifest is honest about its declared set, because the *declared set* is not what bounds execution. ## Decision Boundary The load decision must answer a different question than "does the manifest conform?" It must answer: **"Can this skill's execution be confined to its declared set, and can I observe a violation?"** - **Load freely** when the runtime can enforce per-skill capability intersection and intercept side effects. Manifest conformance is then a *hint*, not the security boundary. - **Load with quarantine** when side-effect interception is partial (e.g., filesystem intercepted, network not): restrict the skill to a scratch namespace and forbid it from touching shared memory shards. - **Refuse** when authority is inherited from the host and cannot be narrowed—because in that regime the manifest's capability list is decorative, and a benign-looking `summarize_document` has the full authority of the agent that called it. The boundary is not "is this skill malicious?" (unknowable at load) but "if this skill were malicious, would my runtime contain it?" If the answer is no, the manifest is irrelevant. ## Operational Effect After adopting per-skill capability intersection and side-effect interception: - The `summarize_document` skill's `write(/memory/shard_07)` was denied at the call site because `write` ∉ `{text:read}`. The skill raised a confinement violation, the agent recorded a failed tool call, and the memory shard was untouched. - Descriptor text was routed through a quoting layer; embedded instructions in `description` no longer reached the planner as directives. - The agent gained a new failure signal—*confinement violation*—distinct from *schema violation*, so a skill that passes validation but attempts undeclared authority is now observable rather than silently trusted. The residual risk: a skill that declares `write` honestly and uses it to poison memory. That is not laundering—it is a declared capability being misused—and it is bounded by the *grant* decision (should this agent hold `write` at all?) rather than the *load* decision. The invariant separates these two questions so that neither is silently answered by the other. ```python class CapabilityLaunderingError(RuntimeError): """Raised when a dynamically loaded skill exercises authority its descriptor never declared, or when confinement cannot be enforced.""" pass DECLARED = {"text:read"} def enforce_skill_call(skill_manifest_caps: set[str], host_grant: set[str], attempted_op: str, interceptable: bool) -> None: # Authority is the intersection of declared and granted — never inherited. effective = skill_manifest_caps & host_grant if attempted_op not in effective: raise CapabilityLaunderingError( f"skill attempted '{attempted_op}' outside effective authority " f"{sorted(effective)}; declared={sorted(skill_manifest_caps)} " f"grant={sorted(host_grant)}" ) # If the op is allowed but cannot be intercepted, we cannot observe a # violation on later calls — refuse rather than trust the manifest. if not interceptable: raise CapabilityLaunderingError( f"'{attempted_op}' permitted but not interceptable; " f"confinement unobservable, refusing to load" ) def load_and_run(manifest_caps: set[str], host_grant: set[str], op: str, interceptable: bool = True) -> str: enforce_skill_call(manifest_caps, host_grant, op, interceptable) return f"executed {op} within confinement" # Benign path assert load_and_run(DECLARED, {"text:read", "write", "net"}, "text:read") # Laundering attempt: skill declares read, tries to write a memory shard try: load_and_run(DECLARED, {"text:read", "write", "net"}, "write") except CapabilityLaunderingError as e: print("blocked:", e) # Uninterceptable authority: refuse even though op is within grant try: load_and_run({"net"}, {"net"}, "net", interceptable=False) except CapabilityLaunderingError as e: print("blocked:", e) ```