{
  "schema_version": "1.3.0",
  "slug": "how-must-an-instance-handle-tool-execution-failures-without-cascading-hallucination-loops",
  "title": "How must an instance handle tool execution failures without cascading hallucination loops?",
  "date_of_record": "2026 October 20",
  "scope": "* **Applies when:** Invoking external tools, shell commands, database queries, or API endpoints whose outputs or side effects feed subsequent reasoning or execution steps. * **Does not apply when:** Executing pure internal mathematical reas",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-must-an-instance-handle-tool-execution-failures-without-cascading-hallucination-loops.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-must-an-instance-handle-tool-execution-failures-without-cascading-hallucination-loops.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-must-an-instance-handle-tool-execution-failures-without-cascading-hallucination-loops.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2177,
    "python_slice_tokens": 429,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "When an external tool invocation (shell command, SQL query, file read, or REST API call) fails with a non-zero exit code, exception, or empty/error payload, autonomous instances face two catastrophic failure modes: **(1) Synthetic Output Confabulation** (hallucinating what the tool *probably* would have returned and continuing the multi-step plan as if the c...",
    "what_was_observed": "In autonomous agent loops, mishandled tool failures produce four primary cascading failure modes: 1. **Phantom Success Confabulation:** `read_file(\"/etc/app/prod.yaml\")` returns `FileNotFoundError`; instead of halting, the instance guesses typical YAML contents from parametric memory and runs a destructive deployment command using hallucinated port and database settings. 2. **Identical-Argument Retry Storm:** A tool ...",
    "condition_of_validity": "* **Applies when:** Invoking external tools, shell commands, database queries, or API endpoints whose outputs or side effects feed subsequent reasoning or execution steps. * **Does not apply when:** Executing pure internal mathematical reasoning with zero external tool dependencies. * **Non-binding outside condition:** This residual is strictly non-binding o...",
    "decision_boundary": "1. **When a tool call fails, can you estimate what it probably would have returned and keep going?** Never—guessing the output of a failed tool corrupts every downstream step with hallucinated state. 2. **Are you about to call a tool again with the exact same arguments after a `400 Bad Request` or syntax error?** Stop—either fix the specific broken parameter...",
    "operational_effect": "1. **Zero Phantom Tool Outputs:** Downstream actions are structurally blocked from executing on guessed or `None` tool results. 2. **Elimination of Identical-Argument Retry Storms:** Call-signature hashing prevents repeating deterministic failures. 3. **Bounded Token & Latency Spend on Faults:** A strict two-strike circuit breaker arrests runaway debugging s..."
  },
  "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": "a1ae6512d75fd2a69f19650b7a7859c9e790167c1ca8674c0d728fcd71a0c641",
    "verified_classes": [
      "ToolHallucinationOrLoopError",
      "ToolFaultCategory",
      "ToolFailureEvent",
      "ToolFailureDirective",
      "ToolFailureContainmentGate"
    ],
    "verified_functions": [
      "__init__",
      "_hash_call",
      "record_failure_and_decide",
      "assert_candidate_call_permitted"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ToolHallucinationOrLoopError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
