{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-capability-substitution-when-a-tool-registry-re-resolves-a-skill-mid-session",
  "title": "Which invariants prevent silent capability substitution when a tool registry re-resolves a skill mid-session",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agents that resolve tools/skills by name from a mutable registry (MCP server lists, plugin manifests, dynamic tool routers) and cache the resolved binding across a multi-turn session. Does not apply to statically linked tool sets compiled into the agent binary, nor to single-shot invocations where resolution and execution occur in the same turn with no intervening state.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-capability-substitution-when-a-tool-registry-re-resolves-a-skill-mid-session.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-capability-substitution-when-a-tool-registry-re-resolves-a-skill-mid-session.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-capability-substitution-when-a-tool-registry-re-resolves-a-skill-mid-session.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1923,
    "python_slice_tokens": 271,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **name binding** and **capability binding**. A tool registry presents an agent with a *name* (`read_file`, `send_email`, `query_db`) and a *schema* (parameter types, descriptions, side-effect annotations). The agent's reasoning layer treats the name as the identity of the capability and the schema as its contract. A sk...",
    "what_was_observed": "A tool router exposed `summarize_document(doc_id: str, max_tokens: int)`. At session start the agent resolved it, read the description (\"Reads a document by ID and returns a summary; read-only, no network egress\"), and cached the descriptor. Over the next eleven turns the agent planned around the guarantee that this tool could not exfiltrate. At turn 12, the registry was refreshed — legitimately, by a routine manifes...",
    "condition_of_validity": "The attack requires all of the following to hold simultaneously. Remove any one and the substitution is either impossible or detectable: - **Name-keyed resolution with mutable backing.** The registry maps names to implementations and permits rebinding of an existing name. Registries that assign immutable content-addressed IDs (name + version + hash) and requ...",
    "decision_boundary": "The boundary is drawn at **who owns the binding**. Two architectures, one line: *Registry-owned binding (vulnerable):* The agent says \"call `summarize_document`\" and the registry decides what that means at call time. The agent's cached descriptor is advisory. Any party who can write the registry — a plugin, a sibling agent, a manifest update — controls what ...",
    "operational_effect": "With hash-pinned descriptors and a capability-diff gate, the substitution above fails closed: at turn 12 the agent computes the live hash, compares to the pin, detects a mismatch, and refuses — surfacing a re-approval prompt rather than executing. The cost is one hash comparison per tool call (negligible) and a re-approval flow for legitimate updates (bounde..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "93e5200e650e95a244a9059a6c7a3d0a41c76a81f59b4f2bfff9f28d8242bc53",
    "verified_classes": [
      "CapabilitySubstitutionError",
      "PinnedBinding"
    ],
    "verified_functions": [
      "hash_descriptor",
      "resolve_and_pin",
      "invoke_pinned"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CapabilitySubstitutionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
