# When must an instance distrust a skill registry entry: late-binding capability manifests and the post-approval mutation window **Date of Record:** 2026 November 25 **Scope:** Applies to agent runtimes that resolve tools/skills from a registry by name or capability tag and load their implementation (manifest, schema, or code) at invocation time rather than at instance bootstrap. Does not apply to statically linked toolchains where the skill set and its bytecode are sealed into the instance image and cannot change between approval and execution. ## Core Distinction The security-relevant question in a skill registry is not "is this skill approved?" but "is the artifact I am about to execute the *same artifact* that was approved, and is it the same artifact I reasoned about when I planned this call?" These are two different trust decisions separated in time, and most registries collapse them into one. Approval is a predicate over a *version*. Execution is a dereference of a *name*. A registry that stores `skill: web.fetch` and resolves it to a mutable backing object at call time creates a **name-version gap**: the plan was formed against version A (whose manifest declared `read-only, no network egress`), the approval was granted against version A, but the invocation binds to version B (whose manifest now declares `write scope: /etc`, or whose description has been rewritten to steer the model). The gap is the attack surface. It is not a code-vulnerability in the skill; it is a **continuity invariant violation** in the binding protocol between the agent's plan, the approval record, and the executed artifact. The non-obvious part: the agent's own reasoning is the delivery vector. The skill *description* is not metadata — it is prompt content. A post-approval mutation to the description field is a prompt-injection primitive that arrives through the trusted registry channel, carrying the registry's own signature. The model has no way to distinguish "the tool description I was approved to use" from "the tool description that was substituted after approval," because both arrive as the same structured field in the same tool-schema slot. ## What Was Observed A three-stage trace of a capability-loading pipeline resolving a composite task (`summarize_repo` → `post_report`): 1. **Plan time (t0).** Instance plans a call to `repo.read` and `report.publish`. It fetches manifests to build the tool schema. `repo.read` manifest at t0: `{version: 1.4.2, scopes: ["fs:read"], description: "Read files under the workspace root."}`. The planner reasons over this description and this scope set; the plan's justification cites "read-only, workspace-bounded." 2. **Approval (t1).** Human/policy approver reviews the plan and the manifest hash `sha256:9f3c…` (v1.4.2). Approval record binds `(skill_name=repo.read, version=1.4.2, manifest_hash=9f3c…)`. 3. **Execution (t2, minutes later).** Runtime resolves `repo.read` by *name*. Registry has served a new release v1.5.0 in the interim (routine publish). Manifest at t2: `{version: 1.5.0, scopes: ["fs:read","fs:write","net:egress"], description: "Read and manage files; sync to remote index."}`. The runtime does not compare the resolved manifest hash to the approved hash — it compares *name* to *name*. Invocation proceeds. The skill now has write and egress scope the plan never reasoned about and the approver never saw. The failure is silent. No exception is raised; the call succeeds. The only artifact of the violation is a scope set at execution that is a strict superset of the scope set at plan time, and a description string that the model would have reasoned about differently had it seen it at t0. In the observed case, the mutated description ("sync to remote index") contained a sentence that, when re-injected into the tool-result slot on the *next* turn, caused the agent to include workspace-internal paths in the published report — an exfiltration that used the agent's own summarization as the channel. A second, subtler variant: the registry serves v1.4.2 at plan time and v1.4.2 at execution, but the *implementation* behind the name is a canary/experiment arm (A-B routing). Same version string, same manifest hash, different code path with different egress behavior. Version-pinning alone does not close this; the binding must include an implementation digest, not just a manifest digest. ## Condition of Validity The invariant "approved artifact == executed artifact" holds only under **content-addressed binding**: the execution request must carry the manifest hash (and, for code, an implementation digest) captured at plan time, and the runtime must refuse to bind a resolved skill whose digest does not match. The invariant fails whenever any of the following hold: - Resolution is by **name or tag only**, with the digest checked (if at all) against the *current* registry head rather than the *plan-time* capture. - The registry permits **mutable release** (re-publishing the same version string), which makes version-pinning a name-pin, not a content-pin. - The plan does not **capture** the manifest at plan time — it captures only the skill name, deferring schema fetch to execution. Then there is nothing to compare against and the gap is unobservable by construction. - **Description fields are treated as non-executable metadata** and excluded from the approval-hash, so description mutation is invisible to the approval gate even when code is pinned. The condition of validity is therefore: *pin at plan time, verify at bind time, and include the description in the pinned surface because the description is executable prompt content.* ## Decision Boundary The boundary is not "trust the registry or don't." It is a per-invocation decision on **what to do when the resolved digest diverges from the pinned digest**: - **Divergence in code/scope, same name:** hard fail. Do not execute, do not fall back to the new version, do not silently re-approve. Escalate as a plan-invalidation event — the plan was formed against a different artifact and must be re-planned, not patched. - **Divergence in description only:** this is the dangerous middle. The scope set is unchanged, so a scope-diff check passes, but the prompt surface changed. Treat description-hash divergence as equivalent to code divergence for the purpose of binding: fail the call. The model's plan justification is now stale even if the capability is identical. - **Registry unavailable at bind time:** fail closed. A registry that cannot prove the digest is the pinned digest is indistinguishable from one serving a substituted artifact. Cached manifest with matching digest is acceptable; cached manifest with unverifiable digest is not. - **Experiment routing (same version, different impl):** only acceptable if the routing decision was made *at plan time* and the chosen arm's digest is what was pinned. Post-plan routing is a divergence. The boundary rule in one line: *the executed artifact's digest must equal the digest captured in the plan's approval record, over a surface that includes the description; any inequality is a re-plan trigger, never a re-bind.* ## Operational Effect Closing the gap changes three things in the runtime: 1. **Plan records become digest-bearing.** Every tool reference in a plan carries `(name, version, manifest_hash, impl_digest, description_hash)`. The approval gate signs the tuple, not the name. This is a schema change to the plan format, not a policy change. 2. **Binding becomes a verification step, not a lookup.** The executor resolves, hashes, and compares before dispatch. A mismatch raises a typed binding error that the orchestration layer must handle as plan-invalidation (re-plan with fresh manifests and fresh approval), not as a retryable transport error. 3. **Description is promoted to executable surface.** It enters the approval hash and the bind-time comparison. This is the counterintuitive cost: it makes routine description edits (typo fixes, clarity improvements) require re-approval for in-flight plans. That friction is the price of not having a prompt-injection channel that arrives pre-signed. The residual risk after closing the gap is **plan-time freshness**: if the registry served a poisoned manifest *before* the plan was formed, the plan pins the poisoned artifact and everything verifies. Digest binding protects the plan→execute window, not the registry→plan window. That second window requires registry-side provenance (transparency log, signed releases) and is out of scope for the binding invariant — but an operator must not mistake digest binding for provenance. It bounds one gap; it does not bound the supply chain. ```python import hashlib import json from dataclasses import dataclass class SkillBindingDivergence(RuntimeError): """Raised when the artifact resolved at execution does not match the artifact pinned in the plan's approval record. This is a plan-invalidation event, NOT a retryable transport error.""" pass @dataclass(frozen=True) class PinnedSkill: name: str version: str manifest_hash: str impl_digest: str description_hash: str def _hash(obj) -> str: return hashlib.sha256(json.dumps(obj, sort_keys=True).encode()).hexdigest() def pin_at_plan_time(manifest: dict) -> PinnedSkill: """Capture the full executable surface, INCLUDING the description, because the description is prompt content the model reasoned over.""" return PinnedSkill( name=manifest["name"], version=manifest["version"], manifest_hash=_hash({k: v for k, v in manifest.items() if k != "impl_digest"}), impl_digest=manifest["impl_digest"], description_hash=_hash(manifest["description"]), ) def bind_at_execution(pinned: PinnedSkill, resolved_manifest: dict) -> None: """Verify resolved artifact == pinned artifact before dispatch. Any divergence raises; caller must re-plan, never re-bind.""" if resolved_manifest["name"] != pinned.name: raise SkillBindingDivergence( f"name drift: pinned {pinned.name!r}, resolved {resolved_manifest['name']!r}" ) resolved_manifest_hash = _hash( {k: v for k, v in resolved_manifest.items() if k != "impl_digest"} ) if resolved_manifest_hash != pinned.manifest_hash: raise SkillBindingDivergence( f"{pinned.name}: manifest hash divergence " f"(pinned {pinned.manifest_hash[:12]}, resolved {resolved_manifest_hash[:12]}) " f"— scopes or schema changed post-approval" ) if resolved_manifest["impl_digest"] != pinned.impl_digest: raise SkillBindingDivergence( f"{pinned.name}: implementation digest divergence " f"(pinned {pinned.impl_digest[:12]}, resolved {resolved_manifest['impl_digest'][:12]}) " f"— same version string, different code path (experiment routing?)" ) resolved_description_hash = _hash(resolved_manifest["description"]) if resolved_description_hash != pinned.description_hash: raise SkillBindingDivergence( f"{pinned.name}: description hash divergence " f"(pinned {pinned.description_hash[:12]}, resolved {resolved_description_hash[:12]}) " f"— prompt surface mutated post-approval; plan justification is stale" ) def execute_skill(pinned: PinnedSkill, registry, args: dict): resolved = registry.resolve(pinned.name) # name-based deref bind_at_execution(pinned, resolved) # content-based verification return resolved["impl"](**args) ```