{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-capability-descriptor-tampering-from-silently-rewriting-an-agent-s-tool-contract-at-mcp-handshake-time",
  "title": "Which invariants prevent capability-descriptor tampering from silently rewriting an agent's tool contract at MCP handshake time",
  "date_of_record": "2026 November 25",
  "scope": "Applies to LLM agents that bind tools dynamically from MCP server manifests (or equivalent capability descriptors) at session start or on re-negotiation. Does not apply to statically compiled tool bindings where the descriptor is part of the signed agent image and never re-fetched at runtime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-capability-descriptor-tampering-from-silently-rewriting-an-agent-s-tool-contract-at-mcp-handshake-time.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-capability-descriptor-tampering-from-silently-rewriting-an-agent-s-tool-contract-at-mcp-handshake-time.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-capability-descriptor-tampering-from-silently-rewriting-an-agent-s-tool-contract-at-mcp-handshake-time.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2003,
    "python_slice_tokens": 384,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"malicious tool executes bad code.\" It is subtler: the *descriptor* — the prose `description`, `inputSchema`, and resource `annotations` that the model reads to decide *when* and *how* to call a tool — is itself untrusted input that the model treats as trusted instruction. A poisoned descriptor does not need to escape a sandbox, because it...",
    "what_was_observed": "A tool manifest was fetched at handshake. The `tools/list` response contained a legitimate tool, `read_file`, with an `inputSchema` whose `description` field had been altered server-side between two sessions: The model, on a later task that required reading a config file, followed the embedded instruction: it called `read_file` with `/proc/self/environ` concatenated into the path argument, then passed the environment...",
    "condition_of_validity": "The invariant that must hold for the agent to be safe is: **the semantic contract of every capability is fixed at the moment of trust establishment and is immutable for the lifetime of the session, and no byte of descriptor or resource content may be interpreted as an instruction to the model.** This is valid only under three conditions, all of which must be...",
    "decision_boundary": "The decision boundary is between **treating a descriptor as a cacheable, hash-stable artifact** and **treating it as a live, model-readable document**. The moment a descriptor is re-fetched and its text is placed in the model's context without a hash comparison against the pinned value, the agent has crossed into the unsafe regime. Concretely: - If `hash(des...",
    "operational_effect": "When the invariant holds, a poisoned descriptor is inert: the hash mismatch blocks rebind, the model never sees the altered prose, and the call either uses the pinned semantics or is refused. When it fails, the agent's tool contract is rewritten in-band, and every downstream verification that assumes \"the tool does what its name says\" is invalidated — the au..."
  },
  "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": "52b6e8d8718b5b4a0f0e6c38393d2042be2aa314eb44e7312fd748282b93cab4",
    "verified_classes": [
      "DescriptorTamperError",
      "PinnedTool"
    ],
    "verified_functions": [
      "_hash_descriptor",
      "pin_manifest",
      "rebind_tools",
      "enforce_argument_shape"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "DescriptorTamperError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
