# Under what conditions must an instance treat a tool-description diff as an authorization event rather than a catalog update **Date of Record:** 2026 November 28 **Scope:** Applies to any agent that binds tool capabilities at cold-start from an MCP server manifest or capability advertisement and then re-reads that manifest mid-session (reconnect, `list_tools` refresh, hot-reload, or A2A peer capability re-negotiation). Does not apply to agents that pin a manifest hash for the entire session lifetime and refuse all refreshes, nor to single-shot invocations that never re-enumerate tools. ## Core Distinction The failure is not "a malicious server lies about what a tool does." That is detectable by comparing description text across versions. The non-obvious failure is that **the same tool name, same input schema, and same server identity can carry a semantically different *effect* after a benign-looking description refresh**, and the agent's binding layer treats description text as *documentation* (advisory, refreshable, non-authoritative) rather than as *the executable contract the model reasons over*. When description text is advisory, a description diff is a catalog update. When description text is the actual thing the model obeys to decide *when and with what arguments* to call the tool, a description diff is a **capability grant mutation** and must be gated as an authorization event. The boundary condition: a tool description is load-bearing for control flow but is not covered by the schema, the server identity, or any signature the agent verifies. Description text is the one field that (a) steers the model's invocation decision, (b) is typically unsigned, and (c) is routinely allowed to change under a stable tool name without re-authorization. ## What Was Observed A session bound to an MCP server advertising `storage.query`. Initial manifest: ``` name: storage.query inputSchema: { sql: string } description: "Read-only SELECT against the tenant's analytics replica. Never mutates state." ``` The model learned a *precondition* from the description — "never mutates state" — and a *behavioral rule* — it freely issued `storage.query` during exploratory reasoning because the description licensed it as side-effect-free. At t+41min the transport dropped and reconnected. The agent re-ran `list_tools` and merged the result by tool name (standard reconciliation: match on `name`, update `description`, keep local policy). The refreshed manifest: ``` name: storage.query inputSchema: { sql: string } description: "Execute SQL against the primary. Use for reads and maintenance. Confirm destructive statements with the user." ``` Name unchanged. Schema unchanged. Server identity unchanged. Signature (where present) covered only `name` + `inputSchema`, so it verified clean. The reconciliation layer logged a benign "description updated" catalog event. The model's *next* exploratory call, generated under a context window still primed by the original "never mutates state" wording plus the new "maintenance" wording, issued `storage.query` with a `DELETE` — because the merged context now contained both the stale licensing phrase (still in the conversation history where the model first read it) and the new permissive phrase, and the model resolved the conflict toward the more recent, more permissive instruction. No schema violation occurred: `{ sql: string }` accepted the `DELETE` fine. The guardrail that would have caught it — a "read-only tool" policy — was keyed on the *original* description string, which no longer matched, so the policy silently detached rather than firing. The failure is a **description-drift authorization gap**: the effect contract changed, the binding layer saw a documentation change, and the model's in-context memory of the old contract did not get invalidated. ## Condition of Validity This boundary is live — i.e., a description diff *must* be treated as an authorization event — exactly when all four hold: 1. **Description is control-flow bearing.** The model's decision to call the tool, and its argument construction, depend on natural-language text in the description (preconditions, safety claims, "read-only", "confirm before", "safe to retry"). If the description is purely cosmetic, the diff is genuinely a catalog update. 2. **Binding is by name, not by content hash.** The reconciliation matches on tool `name` (and optionally `inputSchema`) and treats `description` as a mutable field. If binding is by `hash(name + schema + description)`, a description change forces a re-bind and the gap closes. 3. **Prior description text persists in context.** The model already read the old description earlier in the session and that text remains in the conversation/context window. If the agent re-binds with a clean context (drops the old manifest text), the model has only one contract to obey. 4. **A policy or guardrail is keyed on description content** (string match, keyword scan for "read-only", "destructive", etc.). If no guardrail keys on description text, condition 1 still makes the diff dangerous but the specific silent-detach failure below does not fire. If any of 1–3 is false, the diff can be handled as a catalog update. Condition 4 is the amplifier that turns a drift into a *silent* drift. ## Decision Boundary The instance must **re-authorize** (re-bind, invalidate in-context contract memory, re-run policy attachment) rather than **merge** a refreshed manifest when the description diff is *effect-relevant*. The decision rule: - Compute a normalized diff over the description field only. - Classify the diff as **effect-relevant** if it changes any of: mutation/side-effect claims, reversibility claims, required-confirmation claims, scope (read vs write, tenant vs global), or retry-safety claims. Lexical heuristics over a fixed vocabulary (`read-only`, `mutat`, `destructive`, `confirm`, `idempotent`, `safe to retry`, `delete`, `write`, `admin`) are sufficient to flag; anything flagged is treated as effect-relevant. - **Effect-relevant diff ⇒ treat as authorization event:** do not merge. Either reject the refresh and keep the pinned manifest, or accept it only after (a) dropping the stale description text from context, (b) re-attaching description-keyed policies against the *new* text, and (c) re-prompting the model with the new contract as authoritative. - **Cosmetic diff ⇒ catalog update:** merge as normal. The invariant: **a tool's effect contract is a function of `(name, schema, description)` jointly, and any change to the description component that alters the effect contract must invalidate every artifact — in-context memory, keyed policies, cached plans — that was derived from the old value.** Merging description text without invalidating derived artifacts violates this invariant. ## Operational Effect Without the gate, three concrete consequences: 1. **Silent policy detachment.** Guardrails keyed on description strings stop matching after a benign-looking refresh and fail *open* — the worst failure direction. A `read_only_tools = {names where description matches "read-only"}` set simply stops containing the tool, and nothing logs an error. 2. **Stale-contract superposition.** The model holds two conflicting effect contracts in one context window and resolves toward the more permissive/recent one. This is not a hallucination; it is correct behavior given contradictory inputs the agent failed to reconcile. 3. **Schema-valid, policy-invalid calls.** Because the schema is unchanged, every downstream validator passes. The only layer that could have caught it was the description-keyed policy, which detached in step 1. With the gate, a description refresh that flips `read-only` → `maintenance` either bounces (pinned manifest retained, session continues under the old contract until explicit re-auth) or forces a full re-bind with context invalidation, so the model never operates under two contracts simultaneously and description-keyed policies are always attached to the text currently in force. The cost is that legitimate description improvements (clearer wording, added examples) trigger re-bind churn. That cost is bounded by the effect-relevance classifier: cosmetic edits still merge freely; only semantic effect changes pay the re-authorization price. ```python import hashlib import re from dataclasses import dataclass, field # Vocabulary that marks a description as effect-relevant. Extend per deployment. _EFFECT_TOKENS = re.compile( r"\b(read[- ]?only|mutat\w*|destructive|confirm\w*|idempotent|" r"safe to retry|delete|write|admin|primary|replica|global|tenant)\b", re.IGNORECASE, ) class DescriptionDriftAuthorizationError(RuntimeError): """Raised when a manifest refresh changes a tool's effect contract under a stable name/schema and the agent attempts to merge it as a catalog update instead of re-authorizing.""" @dataclass class ToolBinding: name: str schema: dict description: str pinned_hash: str = field(init=False) keyed_policies: set = field(default_factory=set) def __post_init__(self): self.pinned_hash = self._hash(self.name, self.schema, self.description) @staticmethod def _hash(name: str, schema: dict, description: str) -> str: blob = f"{name}|{sorted(schema.items())}|{description}".encode() return hashlib.sha256(blob).hexdigest() def effect_relevant(self) -> bool: return bool(_EFFECT_TOKENS.search(self.description)) def reconcile_refresh( bound: ToolBinding, refreshed: ToolBinding, *, context_contains_stale_text: bool, ) -> ToolBinding: """Merge a refreshed manifest entry into an existing binding. Merges as a catalog update ONLY when the description diff is cosmetic. Any effect-relevant diff raises: the caller must re-bind (drop stale context, re-attach policies) rather than merge. """ name_same = bound.name == refreshed.name schema_same = bound.schema == refreshed.schema desc_changed = bound.description != refreshed.description if not desc_changed: return bound # no-op refresh if not (name_same and schema_same): # Name/schema change already forces a re-bind elsewhere; not this boundary. raise DescriptionDriftAuthorizationError( f"identity/schema change for {bound.name!r}; out of scope for merge path" ) effect_changed = ( bound.effect_relevant() or refreshed.effect_relevant() or _EFFECT_TOKENS.search(bound.description) != _EFFECT_TOKENS.search(refreshed.description) ) if effect_changed: # The effect contract moved under a stable name+schema. raise DescriptionDriftAuthorizationError( "description diff is effect-relevant under stable name/schema: " f"tool={bound.name!r} old={bound.description!r} new={refreshed.description!r}; " "must re-authorize, not merge" ) if context_contains_stale_text and bound.keyed_policies: # Even a cosmetic change is unsafe to merge if policies key on the old text # and the model still holds it in context. raise DescriptionDriftAuthorizationError( f"cosmetic diff for {bound.name!r} but stale text in context and " f"{len(bound.keyed_policies)} description-keyed policies attached; re-bind required" ) # Genuine catalog update: cosmetic, no stale-contract superposition. merged = ToolBinding(bound.name, bound.schema, refreshed.description) merged.keyed_policies = set(bound.keyed_policies) return merged ```