{
  "schema_version": "1.3.0",
  "slug": "what-invariants-must-survive-when-idempotency-keys-collide-across-tenants",
  "title": "What invariants must survive when idempotency keys collide across tenants?",
  "date_of_record": "2026 October 20",
  "scope": "* **Applies when:** The idempotency layer is shared across tenants, key namespaces are not strictly isolated, and cross-tenant collisions are possible. * **Does not apply when:** Each tenant has a physically separate idempotency store with ",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-invariants-must-survive-when-idempotency-keys-collide-across-tenants.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-invariants-must-survive-when-idempotency-keys-collide-across-tenants.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-invariants-must-survive-when-idempotency-keys-collide-across-tenants.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 955,
    "python_slice_tokens": 295,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The separation between **idempotency key uniqueness** (the key identifies the operation) and **idempotency key tenant scoping** (the key is unique within a tenant but may collide across tenants). Relying on global uniqueness creates the **Cross-Tenant Key Collision**: two tenants use the same key (e.g., \"user-123-refund\"), the deduplication layer returns Ten...",
    "what_was_observed": "In multi-tenant agent architectures, failing to scope idempotency keys produces three primary failure modes: 1. **Cross-Tenant Data Leak:** Tenant B's request returns Tenant A's cached result, exposing Tenant A's data to Tenant B. 2. **Silent Operation Drop:** Tenant B's operation is deduplicated against Tenant A's key, so Tenant B's operation never executes, but the agent believes it succeeded. 3. **Audit Trail Corr...",
    "condition_of_validity": "* **Applies when:** The idempotency layer is shared across tenants, key namespaces are not strictly isolated, and cross-tenant collisions are possible. * **Does not apply when:** Each tenant has a physically separate idempotency store with cryptographic isolation, or keys are content-addressed and globally unique by construction.",
    "decision_boundary": "1. **Is the idempotency key scoped to a specific tenant?** If yes, standard idempotency applies. If no, proceed. 2. **Does the idempotency layer return a prior result for this key?** If no, the operation is new. If yes, proceed to tenant verification. 3. **Does the `original_operation_context_hash` match the current tenant?** If yes, the deduplication is leg...",
    "operational_effect": "1. **Cross-Tenant Leak Prevention:** Prevents one tenant's cached result from being served to another. 2. **Silent Drop Prevention:** Detects collisions before silently dropping the second tenant's operation. 3. **Audit Integrity:** Preserves per-tenant operation attribution even in shared infrastructure."
  },
  "matched_failure_symptoms": [
    "DUPLICATE_MUTATION_OR_BILLING",
    "SECRET_OR_PII_LEAK_IN_LOGS"
  ],
  "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": "a79c050cd62c9242154a22eb27126d710d85eafaf27df4b01f1c29372ec24c87",
    "verified_classes": [
      "IdempotencyVerdict",
      "IdempotencyKey",
      "StoredKeyState",
      "IdempotencyPolicy",
      "IdempotencyManifest",
      "CrossTenantIdempotencyGuard"
    ],
    "verified_functions": [
      "_hash",
      "evaluate_key"
    ],
    "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
  }
}
