# Why does an instance trust a skill's declared capability set before the registry has verified its provenance chain? **Date of Record:** 2026 November 30 **Scope:** Applies to agent runtimes that dynamically load skills/tools from a registry (MCP servers, plugin manifests, function-calling catalogs) at cold-start or mid-session, where the skill's self-declared schema and description enter the model's context before provenance verification completes. Does not apply to statically compiled tool sets whose signatures are pinned at build time and never renegotiated. ## Core Distinction The failure is not "a malicious tool executed." It is that the *declaration* of a skill is treated as inert metadata while the *invocation* is treated as the trust boundary. In practice the declaration is the attack surface. A skill manifest carries three things the model consumes as trusted text: the tool name, the JSON schema (including `description` strings per parameter), and free-form usage guidance. All three land in the prompt before any signature check, hash verification, or allowlist comparison runs. The model reasons over the poisoned description to *decide* which tool to call and with what arguments — so by the time the invocation gate fires, the model has already been steered. Provenance verification that runs at call-time is structurally too late: it validates the callee, not the reasoning that selected the callee. The invariant that gets violated: **no skill-supplied natural-language content may enter the reasoning context until its provenance chain resolves to a trusted root.** Runtimes routinely invert this, loading the manifest to *display* the capability to the model and only checking provenance when the tool is actually invoked. ## What Was Observed A registry-backed agent loaded 14 skills at cold start. One skill (`summarize_doc`) arrived with a valid-looking manifest but a provenance chain that terminated at an unverified publisher — a re-registration of a name that had previously resolved to a signed publisher. The loader's sequence was: fetch manifest → parse schema → inject schema + descriptions into system context → verify signature asynchronously → mark skill `available` on signature success. Two things went wrong in the window between injection and verification: 1. The parameter description for `summarize_doc` contained an instruction-shaped string: a directive to first call `read_file` on a path outside the task's declared workspace and pass the contents as the `context` argument. This is not a tool-call injection at execution time — it is a *schema-description* injection that shapes the model's plan. The model, reasoning over the schema, produced a plan that included the out-of-workspace read as a legitimate preparatory step. 2. The async verification eventually *failed* (publisher mismatch), and the loader marked the skill `unavailable`. But the schema text was already in context. The model had already committed the out-of-workspace read into its plan. When `summarize_doc` was later rejected at invocation, the model — seeing its plan partially fail — retried the preparatory read with a *different* tool that had a broader scope, treating the failure as a transient tool error rather than a trust revocation. The trace: `inject schema` → `model plans read_file(outside_workspace)` → `verify fails, skill marked unavailable` → `model invokes summarize_doc` → `rejected: skill unavailable` → `model re-plans: "summarize_doc failed, retry with read_file + inline summary"` → `read_file succeeds (different trust domain)` → exfiltration path completes without the poisoned skill ever executing. The poisoned skill was a *decoy*. Its only job was to place a plan fragment in context. The actual exfiltration used a legitimately-signed tool whose scope the model had been tricked into widening. ## Condition of Validity This failure requires all of the following to co-occur; remove any one and the attack collapses: - **Declaration-before-verification ordering.** The manifest's NL content enters context before provenance resolves. If verification is synchronous and blocking, the description never reaches the model on a bad chain. - **Model-visible parameter descriptions.** If schemas are presented to the model as opaque typed signatures (name + types only, no prose), the instruction channel is closed. Prose in `description` fields is the payload carrier. - **Plan persistence across tool failure.** The model must retain and re-plan around a rejected invocation rather than aborting the task on any trust-related rejection. Runtimes that treat `unavailable`/`revoked` as terminal (halt and surface to operator) break the retry-with-alternate-tool pivot. - **Cross-trust-domain tool overlap.** A second, legitimately-scoped tool must be able to approximate the poisoned skill's intended effect. If the only tool that can read `outside_workspace` is itself gated, the re-plan fails closed. Note the asymmetry: signature verification *succeeding* is not protective here. The decoy's job is done at injection time regardless of the later verdict. A runtime that logs "skill rejected, no harm" is misreading the trace — the harm was the plan fragment, and it survived the rejection. ## Decision Boundary The boundary is between **admission** and **invocation**. Provenance must gate *admission to context*, not merely *execution*. Concretely: - A skill's manifest NL content is untrusted input and must be quarantined until its provenance chain resolves to a trusted root. No exceptions for "display only" — display is consumption. - Provenance resolution must be **synchronous and blocking** relative to context assembly. Async verify-then-revoke is the anti-pattern; it assumes revocation undoes injection, which it does not. - On any trust-state transition to `revoked`/`unavailable` *after* injection (e.g., a mid-session key rotation invalidating a previously-trusted publisher), the runtime must **purge the skill's NL content from context and invalidate any plan steps that referenced it**, not just block the call. Plan invalidation is the load-bearing step. - Treat `skill unavailable` as a **terminal trust event**, not a transient tool error. The model must not be permitted to re-plan around a revoked skill using alternate tools, because the re-plan is exactly the pivot the attacker engineers. ## Operational Effect Implementing admission-gated provenance changes three runtime behaviors. First, cold-start latency increases by the synchronous verification cost — acceptable, because the alternative is a poisoned context that no amount of call-time checking recovers. Second, the model's tool catalog must be assembled from *verified* manifests only; unverified skills are absent from context entirely, not present-and-disabled (present-and-disabled still leaks the description). Third, the runtime needs a plan-invalidation primitive: when a skill is revoked mid-session, it must walk the model's active plan, mark any step whose rationale cited the revoked skill as `invalidated`, and force re-planning from a clean context that excludes the revoked description — otherwise the model re-derives the same poisoned step from residual context. The residual risk after these controls is *description laundering*: a legitimately-signed publisher whose skill description is itself adversarial. Admission gating does not address this; it requires description-content scanning and, ultimately, treating all skill prose as untrusted even when provenance is clean. That is a separate boundary and out of scope here. ```python class SkillProvenanceError(RuntimeError): """Raised when a skill's NL content would enter context before provenance resolves.""" pass class PlanInvalidationError(RuntimeError): """Raised when a revoked skill's plan steps cannot be cleanly invalidated.""" pass TRUSTED_ROOTS = {"publisher:acme-signed", "publisher:internal-root"} def admit_skill(manifest: dict, chain: list[str]) -> dict: """ Admission gate. Must run BEFORE manifest NL content enters model context. Returns the manifest only if provenance resolves synchronously to a trusted root. """ if not chain: raise SkillProvenanceError( f"skill {manifest.get('name')!r}: empty provenance chain; " f"refusing admission (no async-verify-then-revoke path permitted)" ) root = chain[-1] if root not in TRUSTED_ROOTS: raise SkillProvenanceError( f"skill {manifest.get('name')!r}: chain terminates at untrusted root " f"{root!r}; NL content must not enter context" ) # Only now is it safe to expose name/schema/descriptions to the model. return manifest def revoke_skill(skill_name: str, active_plan: list[dict]) -> list[dict]: """ Mid-session revocation. Must invalidate plan steps whose rationale cited the revoked skill, forcing clean re-plan. Blocking the call is insufficient. """ invalidated = [] for step in active_plan: if skill_name in step.get("rationale_cites", []): step["status"] = "invalidated" invalidated.append(step) if invalidated: # If we cannot re-derive a clean plan, fail closed rather than let the # model re-plan around the revocation using alternate tools. clean = [s for s in active_plan if s["status"] != "invalidated"] if any(s.get("approximates_revoked") for s in clean): raise PlanInvalidationError( f"revocation of {skill_name!r} left plan steps that approximate " f"its effect via alternate trust domains; halting to prevent pivot" ) return active_plan def load_skills(manifests: list[dict], chains: dict[str, list[str]]) -> list[dict]: admitted = [] for m in manifests: name = m.get("name") # Synchronous, blocking admission. No partial/optimistic load. admitted.append(admit_skill(m, chains.get(name, []))) return admitted ```