$ fssg build --deterministic --validate |

AI Agent Plans Need a Capability Snapshot

AI Engineering

An agent should not execute a plan against a tool surface different from the one it planned against.

That sounds obvious, yet most agent loops treat tool discovery as disposable setup. They fetch a list of tools, place schemas in context, let the model compose a plan, and later call whatever currently has the same name. If the server changed an input schema, removed a tool, or altered an optional capability in between, the runtime discovers the mismatch only at execution time—sometimes after earlier steps have already produced effects.

I think a plan needs an explicit capability snapshot: an immutable record of the negotiated protocol version, available operations, relevant schemas, and server identity that made the plan valid.

Discovery is an observation, not a guarantee

MCP already gives a connection a disciplined beginning. During initialization, client and server negotiate a protocol version and exchange capabilities. Servers can also declare listChanged support for tools, prompts, and resources. This is the correct protocol foundation: optional behavior is negotiated rather than guessed.

But protocol negotiation answers a session question: what may these peers do? Planning asks a stricter question: which exact tool surface did this decision depend on?

Those are not the same contract.

A long-running agent can receive a tool-list change after it has prepared a plan. A coordinator can persist a plan and resume it through another connection. A gateway can route the same logical server name to a new deployment. The protocol can remain healthy while the plan has become stale.

The failure is not limited to a missing tool. A schema can become narrower. A field that was optional can become required. A server can expose a new operation whose name changes model routing. Even descriptions matter because models use them as behavioral inputs.

The artifact I want

The snapshot does not need to contain an entire server dump. It needs enough canonical data to prove the planning boundary:

{
  "server": {
    "name": "deploy-tools",
    "version": "2.4.1",
    "instance": "prod-eu-3"
  },
  "protocolVersion": "2025-06-18",
  "capabilities": {
    "tools": { "listChanged": true }
  },
  "tools": [
    {
      "name": "deploy_preview",
      "inputSchemaHash": "sha256:...",
      "annotationsHash": "sha256:..."
    }
  ],
  "capturedAt": "2026-07-24T14:27:00Z",
  "capabilityEpoch": 184,
  "snapshotHash": "sha256:..."
}

I would attach snapshotHash to the plan and copy the hashes of actually selected tools into each planned step. The full snapshot belongs in the execution artifacts; the prompt only needs the parts required for reasoning.

The important field is capabilityEpoch. It is a monotonic identity for the exposed surface, not a wall-clock freshness estimate. When the server reports a relevant list change, the runtime advances the epoch. A plan built under epoch 184 cannot silently execute under epoch 185.

This is similar to optimistic concurrency control. The planner reads a capability state. Execution proceeds only if that state is still current.

A change should invalidate, not refresh, the plan

The tempting response to notifications/tools/list_changed is to fetch the list again and continue. That repairs transport state while hiding a semantic change.

A refreshed tool list can alter the choices the model would have made. If deploy_preview disappeared, perhaps the safe plan no longer exists. If a new read-only inspection tool appeared, the planner might avoid a write it previously considered necessary. If the schema changed, arguments produced under the old schema may have a different interpretation.

So I use a harder rule:

  1. Freeze the capability snapshot when planning starts.
  2. Record which capabilities and schemas each step depends on.
  3. Before execution, compare the current epoch and selected hashes.
  4. If an unrelated capability changed, policy may permit the step.
  5. If a dependency changed or cannot be proved unchanged, invalidate and replan.

This gives selective invalidation without pretending that every catalog change is harmless. It also avoids rebuilding all work when a server adds a tool irrelevant to the current plan.

The dependency set must be conservative. If tool descriptions influenced routing, they are dependencies too. A system that hashes only JSON Schema but ignores names, annotations, and descriptions can prove less than it claims.

Connection identity is not enough

Keeping one connection open does not solve the problem. Servers can support dynamic lists precisely because their surface may change during operation. Proxies and gateways can also preserve a transport while changing the backend.

Conversely, reconnecting should not always force replanning. If a new connection negotiates the same protocol and produces the same canonical snapshot hash, the runtime has useful evidence that the relevant surface is equivalent. This is why content identity is stronger than “same socket” or “same hostname.”

The snapshot also belongs in approval flows. A human who approves “run this deployment plan” should approve the plan against a named tool contract. If the contract changes while approval waits, the approval should not float forward to a different operation surface.

That extends the argument I made about stable effect IDs: retry identity protects an effect from duplication, while capability identity protects the meaning of the operation being retried. It also complements freshness contracts. Resource freshness asks whether the world changed; a capability snapshot asks whether the agent's interface to that world changed.

What this does not prove

A snapshot does not prove that a tool is honest, available, or correctly implemented. Identical schemas can hide different server behavior. Server version strings can be wrong. A malicious endpoint can reproduce an expected hash.

Those risks require authentication, attestation, conformance tests, policy, and postcondition checks. The snapshot solves a narrower problem: it prevents the runtime from claiming that a plan still matches its declared interface after that interface has changed.

That narrow guarantee is valuable. Agent systems become easier to reason about when plans carry their dependencies instead of borrowing whatever environment happens to exist at execution time.

My preferred invariant is simple:

No planned tool call executes unless the runtime can prove that its required capability surface still matches the planning snapshot.

Models can remain adaptive inside that boundary. The boundary itself should be machine-checkable.

Sources

FACET AI CLI Terminal
facet@ai:~$