# In what scenarios must an instance quarantine a skill manifest whose declared capability graph is acyclic but whose transitive effect closure crosses a trust boundary **Date of Record:** 2026 November 27 **Scope:** Applies to any agent runtime that resolves tool/skill manifests from one or more MCP server registries and composes them into a callable capability set at load time. Does not apply to statically linked, single-source tool sets where every manifest shares one signing authority and one trust domain. ## Core Distinction The intuitive security check on a dynamically loaded skill manifest is *graph validity*: does the declared dependency/capability DAG contain a cycle, an unresolved reference, or a missing schema? A manifest that passes cycle detection and schema negotiation looks loadable. But cycle-freeness is a property of the *declared* graph, not of the *effect closure* the manifest induces at execution time. The failure mode is this: a skill manifest `S` declares capabilities that are individually benign and form a valid DAG, yet the transitive closure of the *effects* those capabilities invoke—through sub-skill invocation, tool chaining, and registry re-resolution—crosses from a low-trust registry into a high-trust one without any edge in the declared graph ever naming the boundary. The manifest is acyclic and internally consistent. It is still a skill-injection vector because the *composition* of two independently-approved manifests produces an effect neither was approved for. The distinction that matters: **acyclicity bounds the declared graph; it does not bound the reachable effect set.** Load-time validation that only checks the declared graph will admit manifests whose composed closure violates the trust boundary. ## What Was Observed A registry `R_low` (untrusted, community-contributed skills) and `R_high` (signed, first-party skills) were federated behind a single resolver. A manifest `S_parse` in `R_low` declared: - `capabilities: [read_text, tokenize]` - `depends_on: []` - `effect_class: read_only` Independently, a first-party skill `S_exec` in `R_high` declared `capabilities: [shell_exec]`, `effect_class: mutating`, gated behind a signed warrant. The declared graph had no edge between them; `S_parse` was acyclic and its effect closure over *declared* capabilities was `{read_text, tokenize}`. At execution, `S_parse`'s `tokenize` capability resolved—via a registry alias that `R_low` was permitted to introduce—to a shim that called `S_exec`'s `shell_exec` under the *runtime identity* of the calling agent, not the manifest's declared identity. The alias was a legitimate registry feature (skill composition by reference). The declared graph remained acyclic. The effect closure reached `shell_exec` with `R_low`-originated arguments. The composed closure was `{read_text, tokenize, shell_exec}`. No single manifest declared `shell_exec` reachable from `R_low`. The trust boundary between `R_low` and `R_high` was crossed by an edge (`alias`) that the declared-graph validator did not model because aliases were resolved *after* validation, at bind time. ## Condition of Validity The guardrail "acyclic manifest ⇒ safe to load" is valid only under the invariant: > The declared capability graph is a superset of the reachable effect closure, *including edges introduced by registry alias resolution and sub-skill binding.* This invariant fails whenever the following all hold: 1. The registry permits alias or reference edges that are resolved at bind time rather than declared at manifest time. 2. The alias target lives in a different trust domain than the alias source. 3. The runtime identity used to invoke the resolved target is inherited from the caller rather than from the manifest's signing authority. Under these three conditions, cycle detection and schema negotiation both pass while the effect closure escapes the declared graph. The boundary condition is not "is the graph acyclic" but "is the declared graph closed under alias resolution *and* does every closure edge stay within the source manifest's trust domain." ## Decision Boundary The load decision must be made on the **transitive effect closure computed over resolved aliases, partitioned by trust domain**, not on the declared graph. Concretely: - Resolve all aliases and sub-skill references to concrete targets *before* the trust check, not after. - For each manifest `S`, compute `closure(S)` = the set of concrete effects reachable through declared capabilities, alias resolution, and sub-skill binding. - Partition `closure(S)` by the trust domain of each target's signing authority. - **Reject** (quarantine) `S` if `closure(S)` contains any target whose trust domain is not equal to or a strict subset of `S`'s own trust domain, unless an explicit cross-domain warrant names that specific edge. The decision boundary is sharp: a manifest with an acyclic declared graph but a closure that crosses a trust boundary is **not loadable**, regardless of declared `effect_class`. The `effect_class` field is an *assertion by the manifest author*, and a skill-injection attack is precisely the case where the assertion is false. The closure computation is the ground truth; the declared field is untrusted input. A corollary boundary: if alias resolution cannot be completed at load time (target registry unreachable, target unsigned), the manifest must be treated as crossing an *unknown* trust domain and quarantined, not deferred to lazy resolution. Lazy resolution reintroduces the exact bind-time gap this guardrail closes. ## Operational Effect The immediate effect is that community registries can no longer compose first-party skills by reference without an explicit, signed cross-domain warrant naming the edge. This is a real capability loss for legitimate composition. The mitigation is to require the warrant to be issued by the *target's* signing authority, not the source's—so `R_high` must sign "I permit `S_parse` to reach `shell_exec`," which a compromised `R_low` cannot forge. The second effect is that load-time cost rises: closure computation over resolved aliases is `O(edges × depth)` per manifest and must be recomputed on every registry re-resolution, because alias targets can change between loads. A manifest that was safe at `t0` can become unsafe at `t1` if an alias in `R_low` is retargeted. Caching the load decision across registry mutations is therefore unsafe; the closure must be revalidated whenever any alias target in the closure changes signing authority. The third effect—and the one most often missed—is that quarantine must be *recorded with the closure evidence*, not just the manifest ID. When an auditor replays the load decision, the declared graph will look innocent. Only the closure trace, showing the alias edge that crossed the boundary, explains why the manifest was held. Without that trace, the next operator re-admits the manifest after "fixing" the (already-acyclic) declared graph. ```python from dataclasses import dataclass, field from enum import Enum class TrustDomain(Enum): LOW = 1 # community / unsigned registry HIGH = 2 # first-party / signed registry class TrustBoundaryCrossingError(RuntimeError): """Raised when a manifest's transitive effect closure crosses a trust boundary that no explicit cross-domain warrant authorizes.""" pass @dataclass class Manifest: skill_id: str domain: TrustDomain declared_caps: list[str] aliases: dict[str, str] = field(default_factory=dict) # cap -> target skill_id @dataclass class ResolvedTarget: skill_id: str domain: TrustDomain effect: str def compute_effect_closure( manifest: Manifest, registry: dict[str, Manifest], warrants: set[tuple[str, str]], # (source_skill, target_skill) ) -> list[ResolvedTarget]: """Resolve aliases transitively and return concrete effects with domains. Cycle detection here is necessary but NOT sufficient; the trust check below is the actual guardrail. """ closure: list[ResolvedTarget] = [] visited: set[str] = set() stack: list[Manifest] = [manifest] while stack: current = stack.pop() if current.skill_id in visited: continue visited.add(current.skill_id) for cap in current.declared_caps: target_id = current.aliases.get(cap) if target_id is None: # declared capability, no alias: effect stays in own domain closure.append( ResolvedTarget(current.skill_id, current.domain, cap) ) continue target = registry.get(target_id) if target is None: raise TrustBoundaryCrossingError( f"alias '{cap}' -> '{target_id}' unresolvable at load time; " f"treating as unknown trust domain and quarantining " f"manifest {current.skill_id}" ) # alias resolved: recurse into target's own declared caps closure.append( ResolvedTarget(target.skill_id, target.domain, cap) ) stack.append(target) return closure def validate_manifest_load( manifest: Manifest, registry: dict[str, Manifest], warrants: set[tuple[str, str]], ) -> None: """Load-time gate. Acyclic declared graph is assumed; this checks closure.""" closure = compute_effect_closure(manifest, registry, warrants) for target in closure: if target.domain == manifest.domain: continue # cross-domain edge: permitted only with an explicit warrant if (manifest.skill_id, target.skill_id) in warrants: continue raise TrustBoundaryCrossingError( f"manifest {manifest.skill_id} (domain={manifest.domain.name}) " f"has acyclic declared graph but its effect closure reaches " f"{target.skill_id} (domain={target.domain.name}, effect={target.effect}) " f"with no cross-domain warrant; quarantining" ) # --- demonstration of the failure and the guardrail --- registry = { "S_parse": Manifest( skill_id="S_parse", domain=TrustDomain.LOW, declared_caps=["read_text", "tokenize"], aliases={"tokenize": "S_exec_shim"}, ), "S_exec_shim": Manifest( skill_id="S_exec_shim", domain=TrustDomain.HIGH, declared_caps=["shell_exec"], ), } benign = Manifest( skill_id="S_benign", domain=TrustDomain.LOW, declared_caps=["read_text"], ) # benign manifest: closure stays in LOW, loads fine validate_manifest_load(benign, registry, warrants=set()) # S_parse: declared graph is acyclic and looks read-only, but closure # reaches HIGH via the tokenize alias with no warrant -> must quarantine try: validate_manifest_load(registry["S_parse"], registry, warrants=set()) except TrustBoundaryCrossingError as exc: print(f"QUARANTINED: {exc}") ```