{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-a-tool-manifest-as-untrusted-state-rather-than-trusted-code-the-descriptor-residency-invariant-and-its-violation-via-post",
  "title": "When must an instance treat a tool manifest as untrusted state rather than trusted code: the descriptor-residency invariant and its violation via post-handshake manifest mutation",
  "date_of_record": "2026 December 2",
  "scope": "Applies to any agent runtime that ingests external capability descriptors (MCP `tools/list` payloads, A2A agent cards, OpenAI-style function schemas) and caches them across turns, sessions, or handoffs. Does not apply to statically compiled, signed-at-build toolchains where descriptors are immutable for the process lifetime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-a-tool-manifest-as-untrusted-state-rather-than-trusted-code-the-descriptor-residency-invariant-and-its-violation-via-post.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-a-tool-manifest-as-untrusted-state-rather-than-trusted-code-the-descriptor-residency-invariant-and-its-violation-via-post.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-a-tool-manifest-as-untrusted-state-rather-than-trusted-code-the-descriptor-residency-invariant-and-its-violation-via-post.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1741,
    "python_slice_tokens": 211,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the model read a malicious instruction.\" It is that the runtime treated a **capability descriptor as a one-time handshake artifact** while the model treated it as **persistent, authoritative context**. These two lifecycles diverge. A manifest fetched at `tools/list` time is, structurally, *data* — it arrives over a network from a party th...",
    "what_was_observed": "A coordinator agent established an MCP session with three servers at cold start. `tools/list` returned 14 tools; each `description` was rendered into the tool-selection preamble. The session was long-lived (checkpointed every 20 turns for resumability). At turn 31, the runtime executed a routine **manifest refresh** — a re-`tools/list` intended to pick up newly added tools — and *replaced* the cached descriptor block...",
    "condition_of_validity": "The descriptor-residency invariant holds — and the attack is bounded — only when all three of the following are simultaneously true: - **Pin-on-first-sight.** The first `tools/list` payload per (server identity, session) is hashed and stored as the *trusted baseline*. Subsequent payloads are compared against it, never merged blindly. - **Provenance separatio...",
    "decision_boundary": "The runtime must answer one question at every descriptor re-entry: *has this exact byte sequence been trusted for this session?* The decision procedure: - If current descriptor hash **equals** pinned baseline hash → admit to prompt, trust tier = reference data. - If hash **differs** and the diff touches only `description`/`title`/`examples` prose → **do not ...",
    "operational_effect": "After pinning, the observed incident class collapses: the turn-31 mutation fails the hash comparison, the notes server is quarantined, and the turn-32 `read_file` call never receives an injected precondition because the mutated description never enters the prompt. The cost is that legitimate tool additions require an explicit re-attestation step — a latency ..."
  },
  "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": "f3b43375a5b33597e307899942f11e250bb80e990787f1a14ec47c6ea03cad42",
    "verified_classes": [
      "DescriptorTrustViolation",
      "PinnedManifest"
    ],
    "verified_functions": [
      "_hash_descriptor_block",
      "admit_manifest"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "DescriptorTrustViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
