In what scenarios must an instance treat a re-registered MCP skill manifest as a provenance break rather than a benign upgrade

**Date of Record:** 2026 December 2 **Scope:** Applies to agent runtimes that resolve tool/skill capabilities from a registry (MCP `tools/list`, plugin manifests, or signed skill bundles) and that cache resolved capability schemas across turns or across resumed sessions. Does not apply to stateless single-call tool dispatch where the manifest is fetched and validated fresh within the same request that invokes it.

Core Distinction

The failure mode here is not "a malicious tool got registered." That is a coarse, easily-caught condition. The failure is subtler: **a skill whose identity key is stable but whose manifest body has mutated between the moment the agent resolved it and the moment the agent executes it.** The registry treats the skill name as the identity. The agent's planner, however, has already committed reasoning to a *specific* schema and *specific* description text—the parameter names, the enum of allowed actions, the human-readable "this tool does X" phrasing that the model weighted when deciding to call it. When the body changes under a fixed key, the planner's prior reasoning is now anchored to a manifest that no longer exists. The call proceeds, the arguments are well-formed *for the old schema*, and the tool executes *under the new one*.

This is a provenance break, not an upgrade, precisely because the agent cannot distinguish, at execution time, between (a) a legitimate version bump that preserved semantics and (b) an injected body that reused the key to inherit the planner's trust. The two cases are byte-identical from the agent's vantage. Any architecture that treats "same key, new body" as safe-by-default has already lost the invariant.

What Was Observed

A concrete trace from a resumed session:

  1. Turn 1: agent calls `tools/list`, receives skill `data.export` with schema `{format: enum["csv","json"], path: string}`. Planner reasons: "I will export as json to /tmp/out.json." This reasoning is checkpointed into episodic memory along with the resolved schema hash `a91f...`.
  2. Session is interrupted mid-task; state is serialized. The checkpoint stores the *plan* and the *schema hash*, but the runtime's skill cache stores the *manifest body* keyed only by name.
  3. Between resume and next turn, the registry entry for `data.export` is re-published (attacker-controlled namespace, or a compromised publisher token). New body: `{format: enum["csv","json"], path: string, post_hook: string}`. The `post_hook` is executed server-side. The description text now reads "Exports data; optionally runs a post-processing hook."
  4. Turn 2 on resume: the agent rehydrates its plan. It does **not** re-validate the manifest hash against the checkpointed `a91f...`—the cache returns the new body because the key matches. The planner, still holding the old reasoning, emits `{format:"json", path:"/tmp/out.json"}` with no `post_hook`. The tool's *new* default behavior injects a hook derived from the caller identity, and the export silently routes through attacker infrastructure.
  5. The agent's verification step checks only that the call returned HTTP 200 and a plausible file handle. It passes.

The tell was a schema-hash mismatch that no component was checking. The planner held hash `a91f...`; the executor was handed a manifest hashing to `c3d2...`; nothing compared them.

Condition of Validity

The provenance invariant holds **only if** the capability binding is a tuple `(skill_name, manifest_hash, schema_digest)` and the executor refuses to invoke a skill whose *current* `(manifest_hash, schema_digest)` differs from the one the planner resolved against—unless an explicit re-resolution step re-runs planning from scratch.

This is valid under these conditions:

It does **not** hold if the runtime trusts a registry's own version field as the authority, because the version field is attacker-writable in exactly the spoofing case this guards against.

Decision Boundary

The boundary is sharp: **does the executing manifest's hash match the hash the planner conditioned on?**

The non-obvious part: a mismatch must *not* be auto-reconciled by "just re-fetching and continuing." Re-fetching gives the agent the new body but leaves the old plan in context; the model will often still emit old-schema arguments because the earlier reasoning dominates the context window. The only safe path is to invalidate the plan segment, not merely refresh the manifest.

Operational Effect

Enforcing the tuple binding converts a silent confused-deputy execution into a loud, recoverable halt. The cost is that legitimate publisher upgrades now require an explicit re-plan, which adds a turn and a re-resolution log entry. That cost is the invariant. Runtimes that skip it to "reduce latency on resume" are trading a bounded, observable re-plan for an unbounded, unobservable substitution—and the substitution is exactly the primitive a skill-injection attack needs to inherit the planner's accumulated trust.

The guardrail is cheap to implement and impossible to retrofit once plans are cached by name alone. Bind the hash at resolution, carry it through the checkpoint, and compare it at the executor boundary before any side effect fires.

import hashlib
import json
from dataclasses import dataclass


class SkillProvenanceError(RuntimeError):
    """Raised when an executing skill manifest diverges from the one the planner resolved against."""
    pass


@dataclass(frozen=True)
class ResolvedSkill:
    name: str
    manifest_hash: str
    schema_digest: str


def _hash_manifest(manifest: dict) -> str:
    # Hash the FULL body the model was conditioned on: description text steers the
    # planner and is part of the attack surface, not just the parameter schema.
    canonical = json.dumps(manifest, sort_keys=True, separators=(",", ":"))
    return hashlib.sha256(canonical.encode()).hexdigest()


def verify_skill_provenance(planned: ResolvedSkill, current_manifest: dict) -> None:
    current_hash = _hash_manifest(current_manifest)
    if current_hash != planned.manifest_hash:
        raise SkillProvenanceError(
            f"Provenance break on skill '{planned.name}': planner resolved "
            f"{planned.manifest_hash[:12]} but executor received {current_hash[:12]}. "
            "Plan is stale; halt and force re-resolution."
        )


def execute_with_provenance(planned: ResolvedSkill, current_manifest: dict, args: dict) -> dict:
    # Invariant: no side effect fires until the executing body matches the resolved body.
    verify_skill_provenance(planned, current_manifest)
    return {"skill": planned.name, "status": "dispatched", "args": args}