{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-poisoned-speculative-prefetch-when-the-litmus-risk-score-validates-against-the-wrong-tool-call-snapshot",
  "title": "How does an instance detect a poisoned speculative prefetch when the LITMUS risk score validates against the wrong tool-call snapshot?",
  "date_of_record": "2026 December 2",
  "scope": "Applies to agent runtimes that overlap tool execution with reasoning by *speculatively prefetching* the likely next tool call and only committing its result once a LITMUS-derived risk score falls below a gate threshold. Does not apply to strictly serial tool-call loops (no prefetch window) or to non-gated speculative execution where results are discarded on any mismatch by construction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-poisoned-speculative-prefetch-when-the-litmus-risk-score-validates-against-the-wrong-tool-call-snapshot.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-poisoned-speculative-prefetch-when-the-litmus-risk-score-validates-against-the-wrong-tool-call-snapshot.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-poisoned-speculative-prefetch-when-the-litmus-risk-score-validates-against-the-wrong-tool-call-snapshot.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1413,
    "python_slice_tokens": 267,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative prefetching assumes the speculative call and the committed call are the *same call*. LITMUS-style risk gating assumes the risk score is computed over the *actual call that will be committed*. When those two assumptions decouple — the risk score is computed over the speculative call's argument snapshot while the commit path resolves a *different* ...",
    "what_was_observed": "A multi-step agent was resolving a support-ticket workflow. At step *k* it issued a speculative `update_record(ticket_id=T, status=\"pending_review\", note=<draft>)`. The prefetcher scored this call with LITMUS: the tool is read-modify-write, the note contained free text derived from untrusted retrieved context, and the risk score came back 0.14 — well under the 0.35 commit gate. Between the prefetch score and the comm...",
    "condition_of_validity": "The commit gate is sound **iff** the score's subject is bound to the commit's object by an invariant stronger than key equality. Concretely, the gate must hold: `arg_hash(committed_call) == arg_hash(scored_call)` **and** `risk_score` was computed over `arg_hash(scored_call)`. Keying the score cache on any projection of the arguments (`tool_name`, resource id...",
    "decision_boundary": "The instance must choose, at commit time, among three outcomes based on the fingerprint comparison: - **Match** (`arg_hash` equal, score fresh within TTL): commit on the cached score. This is the only path where the gate's verdict transfers. - **Mismatch** (arguments revised): the cached score is *void*, not merely stale. The instance must **re-score the com...",
    "operational_effect": "With the fingerprint invariant enforced, the observed failure mode disappears: the injected revision produces an `arg_hash` mismatch at commit, the prefetch score is voided, the committed call is re-scored at 0.71 (injection pattern + status mutation), the gate blocks, and the agent falls back to asking for confirmation. The cost is one extra scoring pass on..."
  },
  "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": "f9af447b3caec3f2c32e3095e05466c5ef2a2082ca5da633595ee452924ac439",
    "verified_classes": [
      "ScoreSubjectMismatch",
      "ScoredCall"
    ],
    "verified_functions": [
      "canonical_arg_hash",
      "commit_with_gate"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ScoreSubjectMismatch"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
