{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-speculatively-execute-tool-calls-before-authorization-and-how-does-the-side-effect-buffer-leak",
  "title": "Why does an instance speculatively execute tool calls before authorization, and how does the side-effect buffer leak?",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agent runtimes that pre-execute tool calls speculatively against a sandboxed side-effect buffer with commit/abort semantics, where the buffer is assumed to be a pure write-ahead log that can be discarded on abort. Does not apply to runtimes that serialize tool execution strictly behind authorization, nor to read-only tools whose effects are never buffered.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-speculatively-execute-tool-calls-before-authorization-and-how-does-the-side-effect-buffer-leak.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-speculatively-execute-tool-calls-before-authorization-and-how-does-the-side-effect-buffer-leak.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-speculatively-execute-tool-calls-before-authorization-and-how-does-the-side-effect-buffer-leak.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1669,
    "python_slice_tokens": 253,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *speculative execution as compute* and *speculative execution as commitment*. Pre-executing a tool call to hide latency is safe only if every effect of that execution is reversible through the buffer. The failure mode is not that the speculation is wrong—speculations are expected to be wrong—it is that the buffer is tr...",
    "what_was_observed": "A planner instance received a task requiring three tool calls: `reserve_inventory(sku, qty)`, `charge_payment(order_id, amount)`, and `ship_order(order_id)`. The runtime speculatively pre-executed all three against a side-effect buffer while awaiting human authorization, because the authorization round-trip was measured at 4.2 seconds and the planner's token budget would otherwise expire mid-task. Authorization retur...",
    "condition_of_validity": "The commit/abort invariant is valid only under a conjunction of three conditions, and the runtime enforced only the first two: - **Effect containment:** every externally observable effect of a speculative tool call must route through the buffer. This fails whenever a tool wrapper delegates to a sub-RPC, a dedup layer, a rate limiter, or an audit sink that is...",
    "decision_boundary": "The decision the runtime must make is not \"should we speculate\" but \"which tools are eligible for speculation.\" A tool is eligible only if it satisfies a *reachability audit*: its full effect closure—including sub-RPCs, dedup windows, audit sinks, and any external state it touches—is either buffered or provably idempotent under a speculation-scoped key. The ...",
    "operational_effect": "The operational consequence is that speculative execution shifts the failure surface from *latency* to *belief integrity*. A runtime that speculates without closure-complete buffering does not merely risk a wrong tool result—it risks an agent whose memory of its own actions diverges from the world in a way that is invisible until a downstream reconciliation ..."
  },
  "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": "2a9dd3238581678b7fa5411d4f4990966b73862b1c68edff26fad98a9ceaaeda",
    "verified_classes": [
      "SpeculationWarrantError",
      "SpeculationWarrant"
    ],
    "verified_functions": [
      "dispatch_speculative",
      "commit_or_abort"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpeculationWarrantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
