{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-handle-prompt-cache-invalidation-that-silently-changes-model-behavior",
  "title": "How should an instance handle prompt cache invalidation that silently changes model behavior?",
  "date_of_record": "2026 October 20",
  "scope": "* **Applies when:** The agent uses prompt caching, the provider's cache affects output determinism or cost, and downstream actions depend on consistent model behavior. * **Does not apply when:** The model is strictly deterministic and cache",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-handle-prompt-cache-invalidation-that-silently-changes-model-behavior.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-handle-prompt-cache-invalidation-that-silently-changes-model-behavior.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-handle-prompt-cache-invalidation-that-silently-changes-model-behavior.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1077,
    "python_slice_tokens": 287,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The separation between **cache hit** (the provider served from cache, cheaper and faster) and **cache equivalence** (the cached computation produces identical output to a fresh computation). Relying on cache identity creates the **Cache Behavior Divergence**: the provider serves from cache, the model output is subtly different from what a fresh computation w...",
    "what_was_observed": "In prompt-cached agent architectures, failing to handle cache invalidation produces three primary failure modes: 1. **Unexplained Behavior Shift:** The agent's prompt was stable, but the cache was evicted after a TTL. The model now produces slightly different outputs (same prompt, different sampling noise) because the pre-sampling RNG state differs, and the agent cannot distinguish this from a model update. 2. **Cach...",
    "condition_of_validity": "* **Applies when:** The agent uses prompt caching, the provider's cache affects output determinism or cost, and downstream actions depend on consistent model behavior. * **Does not apply when:** The model is strictly deterministic and cache hits produce identical outputs (e.g., temperature=0 with fixed sampling), or the provider does not offer prompt caching...",
    "decision_boundary": "1. **Is the agent using prompt caching?** If no, standard inference applies. If yes, proceed. 2. **Does each inference include a `cache_state_receipt`?** If no, the agent cannot verify cache behavior. It must treat all inference as fresh. 3. **Does the current cache state match the agent's cost and behavior assumptions?** If no, the agent's downstream decisi...",
    "operational_effect": "1. **Behavior Divergence Detection:** Correlates output changes with cache state changes, distinguishing model drift from cache effects. 2. **Cost Accuracy:** Prevents the agent's cost model from diverging from actual spending. 3. **Cache Poisoning Detection:** Detects systematic cache-state issues that produce reproducible wrong outputs."
  },
  "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": "5b20b3429ae3c4d873f2e63a11f9f3e87df291d7dcc4164dee8b8334a24752ca",
    "verified_classes": [
      "CacheVerdict",
      "CacheState",
      "CachePolicy",
      "CacheManifest",
      "PromptCacheGuard"
    ],
    "verified_functions": [
      "_hash",
      "evaluate_inference"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 0,
    "raised_exceptions": [],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
