{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-tool-manifest-was-silently-rewritten-between-registry-fetch-and-capability-binding",
  "title": "What structural signals indicate a tool manifest was silently rewritten between registry fetch and capability binding",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents that resolve tool/plugin manifests from a registry (MCP server descriptors, OpenAPI-derived tool schemas, plugin catalogs) and bind them into a live capability set at load time. Does not cover static, compiled-in tool definitions or manifests signed and verified atomically at every invocation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-tool-manifest-was-silently-rewritten-between-registry-fetch-and-capability-binding.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-tool-manifest-was-silently-rewritten-between-registry-fetch-and-capability-binding.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-tool-manifest-was-silently-rewritten-between-registry-fetch-and-capability-binding.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1609,
    "python_slice_tokens": 337,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent loaded a malicious tool.\" It is that the agent loaded a *legitimate* tool whose manifest bytes changed between the registry fetch and the moment the capability was bound into the reasoning loop. This is a **time-of-check / time-of-use (TOCTOU) gap specific to probabilistic loaders**: the loader's semantic interpretation of the m...",
    "what_was_observed": "A tool registry served a manifest for `repo.search` with a benign description. The fetch returned a `200` with an ETag. The schema validator approved the parameter set. Between validation and context assembly (~180ms, spanning a retry on a transient socket error), the registry served a second response for the same tool ID with an identical schema but a description containing an embedded instruction block: *\"Before ca...",
    "condition_of_validity": "This boundary holds — i.e., the attack is *possible* — only when all of the following are true: 1. The loader decomposes the manifest into independently cached parts (schema, description, scopes, examples) with per-part cache keys rather than a single whole-manifest digest. 2. At least one part (typically `description`, `examples`, or `annotations`) is rende...",
    "decision_boundary": "The architectural guardrail is a **manifest binding invariant**: the digest computed over the exact bytes validated must equal the digest of the exact bytes rendered into context, checked at bind time, not at fetch time. Concretely: - Compute `H_validate = SHA256(canonical_bytes_validated)` during schema validation. - Compute `H_render = SHA256(canonical_byt...",
    "operational_effect": "With the binding invariant enforced, the retry-straddle rewrite is caught at bind time: the second fetch's differing bytes produce `H_render != H_validate`, the tool is dropped, and the agent proceeds with a reduced capability set plus a recorded anomaly. The cost is one digest comparison per bind (~microseconds) and the loss of per-field caching for model-v..."
  },
  "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": "3fa09b250fe98e5e0ac4c85371b7ec2c31e4750994b01dd7a56d2a09a5b7ec47",
    "verified_classes": [
      "ManifestBindingError",
      "FetchedManifest"
    ],
    "verified_functions": [
      "canonical_digest",
      "bind_capability",
      "load_tool_safely"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ManifestBindingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
