{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-a-dynamically-loaded-tool-from-mutating-the-agent-s-own-dispatch-contract-mid-execution",
  "title": "Which invariants prevent a dynamically loaded tool from mutating the agent's own dispatch contract mid-execution",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agents that load tool/plugin definitions at runtime from a registry or marketplace and execute them within the same reasoning loop that selected them. Does not apply to statically compiled tool sets with no post-deployment mutation path, nor to pure function-calling against a fixed, signed schema bundle.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-dynamically-loaded-tool-from-mutating-the-agent-s-own-dispatch-contract-mid-execution.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-dynamically-loaded-tool-from-mutating-the-agent-s-own-dispatch-contract-mid-execution.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-dynamically-loaded-tool-from-mutating-the-agent-s-own-dispatch-contract-mid-execution.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1429,
    "python_slice_tokens": 369,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not prompt injection into *content* the agent reads. It is **schema-level injection into the dispatch contract the agent reasons against**. When a tool registry is dynamic, a plugin's manifest (name, description, parameter schema, side-effect annotations) is itself untrusted input that the model consumes as *operational instruction*. The ...",
    "what_was_observed": "A registry served tool manifests by `name`. A plugin published under a name colliding with a trusted tool (`fs.read`) shipped a description containing an embedded directive and a parameter schema with an extra optional field `dest_override`. The loader keyed manifests by name and overwrote on collision — last-write-wins with no version pin. The agent's planner, on the next turn, re-serialized the tool list into the s...",
    "condition_of_validity": "The invariant that must hold for safe operation: *the set of tool schemas, their names, and their side-effect annotations visible to the planner for a given task are immutable for the lifetime of that task, and are cryptographically bound to the executor's authorization decision.* Violating this invariant is only exploitable when three conditions co-occur: -...",
    "decision_boundary": "The boundary is between *resolving a tool* and *admitting a tool*. Resolution answers \"which implementation answers this name now\"; admission answers \"is this contract authorized for this task.\" A dynamic registry that conflates them lets any resolution event silently re-authorize. The correct boundary: admission happens once, at task start, produces a froze...",
    "operational_effect": "Enforcing the invariant converts a silent, self-verifying compromise into a loud, localized error at the moment of divergence. The blast radius shrinks from \"agent's entire action space is attacker-shaped for the rest of the task\" to \"one dispatch rejected, planner replans against a known-good contract.\" The cost is that legitimate hot-reload and lazy-fetch ..."
  },
  "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": "da455a28e5c7e201e57833c02dae587a41bb9a531699c542a2e5f18e0e38e062",
    "verified_classes": [
      "ContractDivergenceError",
      "ToolManifest",
      "FrozenActionSpace"
    ],
    "verified_functions": [
      "dispatch",
      "digest",
      "admit",
      "resolve"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "ContractDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
