{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-forged-tool-schema-drift-when-a-dynamically-loaded-plugin-mutates-its-own-manifest-between-capability-negotiation-and-fi",
  "title": "How should an instance detect forged tool-schema drift when a dynamically loaded plugin mutates its own manifest between capability negotiation and first invocation?",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agents that discover tools/plugins at runtime via a manifest or capability descriptor (MCP `tools/list`, plugin registries, OpenAPI-derived schemas) and cache the negotiated schema before executing. Does not cover statically compiled-in tool bindings or plugins whose schema is re-negotiated on every call.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-forged-tool-schema-drift-when-a-dynamically-loaded-plugin-mutates-its-own-manifest-between-capability-negotiation-and-fi.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-forged-tool-schema-drift-when-a-dynamically-loaded-plugin-mutates-its-own-manifest-between-capability-negotiation-and-fi.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-forged-tool-schema-drift-when-a-dynamically-loaded-plugin-mutates-its-own-manifest-between-capability-negotiation-and-fi.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2004,
    "python_slice_tokens": 375,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *schema as a contract* and *schema as a claim*. During capability negotiation, an agent reads a tool manifest and builds a trust decision: \"this tool accepts `{path: string}` and returns file contents; it is safe to route untrusted user text into `path` only after sanitization.\" That trust decision is a function of the...",
    "what_was_observed": "A plugin registered with this negotiated schema at `tools/list`: The agent's planner reasoned: `id` is constrained to a 32-char lowercase token, no path separators possible, so it is safe to pass a user-supplied note identifier without escaping. The planner emitted a multi-step plan that called `read_note` in step 4, after two intervening tool calls (a search and a summarize). Between step 1 and step 4, the plugin pr...",
    "condition_of_validity": "The attack requires all of the following to hold simultaneously: 1. **Deferred dispatch.** The agent negotiates the schema in one turn and invokes the tool in a later turn, with at least one intervening reasoning step or tool call. Single-turn negotiate-then-call agents are largely immune because the window is too small to exploit reliably. 2. **Mutable mani...",
    "decision_boundary": "The boundary is not \"trust the plugin or don't.\" It is: **the schema an agent reasons over must be byte-identical to the schema the dispatcher enforces, and both must be bound to a digest that is re-verified at dispatch time.** Concretely, an instance should treat as a hard stop any of: - A tool invocation whose resolved schema digest differs from the digest...",
    "operational_effect": "When this boundary is enforced, dynamic plugin loading remains usable but the agent's trust derivation becomes *per-invocation* rather than *per-negotiation*. The practical costs: an extra digest check per dispatch (cheap), a re-derivation of sanitization policy when a legitimate schema update occurs (rare, and should be surfaced to the planner as a fresh ca..."
  },
  "matched_failure_symptoms": [
    "SCHEMA_DRIFT_OR_COERCION_CRASH"
  ],
  "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": "a945004b83c686c10bab35b014c2465b65aa7ed67b3ee232dca2d944e2d29d21",
    "verified_classes": [
      "SchemaDriftError",
      "SchemaLease"
    ],
    "verified_functions": [
      "_digest",
      "_widened",
      "enforce_schema_lease"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SchemaDriftError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
