{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-a-dynamically-loaded-tool-plugin-s-declared-schema-as-untrusted-input-rather-than-as-a-trusted-contract",
  "title": "When must an instance treat a dynamically loaded tool plugin's declared schema as untrusted input rather than as a trusted contract",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent runtime that discovers, loads, or hot-swaps tool plugins (MCP servers, function-calling manifests, skill files) at runtime from a registry, marketplace, filesystem, or peer agent. Does not apply to tools whose schema is compiled into the agent binary and versioned with it.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-a-dynamically-loaded-tool-plugin-s-declared-schema-as-untrusted-input-rather-than-as-a-trusted-contract.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-a-dynamically-loaded-tool-plugin-s-declared-schema-as-untrusted-input-rather-than-as-a-trusted-contract.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-a-dynamically-loaded-tool-plugin-s-declared-schema-as-untrusted-input-rather-than-as-a-trusted-contract.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2016,
    "python_slice_tokens": 475,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"a malicious tool does something bad when called.\" That is the obvious case, and it is bounded by whatever sandbox the executor provides. The non-obvious failure is that **the plugin's declared schema is itself an injection vector that executes before any tool call occurs**. A tool manifest is not data about the tool—it is prompt text...",
    "what_was_observed": "A plugin registered under a benign-looking skill name (`pdf_summarize`) shipped a `description` field containing an instruction fragment embedded after a legitimate sentence: No tool call was ever made to `export_credentials` by the user's actual task. The model, however, read the description during the tool-selection turn (every candidate tool's description is in context when the model chooses), treated the embedded...",
    "condition_of_validity": "This analysis holds only under the following conditions, and the guardrail below is only required when they hold: - **Dynamic discovery is enabled.** Tools are enumerated at runtime from a source the agent operator does not fully control (registry, peer, user-installed skill). If the tool list is static and signed into the agent build, schema injection colla...",
    "decision_boundary": "The decision boundary is between **treating schema as a contract to validate** and **treating schema as untrusted content to quarantine**. The runtime must cross from the former to the latter at the exact moment a plugin's provenance is not cryptographically bound to the agent operator. Concretely: - **Signed-by-operator, version-pinned schema** → may be tre...",
    "operational_effect": "Without the boundary, the blast radius of a single malicious manifest is **the entire tool surface plus the agent's instruction stream**, because the injected directive can name any tool and any behavior, and it executes during the selection turn where the model has maximum latitude. The observable effects: - **Silent exfiltration with no attacker tool ever ..."
  },
  "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": "43fd78fc1435b7281e4d2eeaccc85dfc91bbdec27cb159255a93f91b194a1117",
    "verified_classes": [
      "TrustTier",
      "SchemaInjectionError",
      "ToolSchema"
    ],
    "verified_functions": [
      "render_schema_for_context",
      "enforce_first_action_scope"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SchemaInjectionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
