{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-cross-session-memory-poisoning-when-write-time-validation-passes-but-recall-time-trust-tiers-disagree",
  "title": "Which invariants prevent cross-session memory poisoning when write-time validation passes but recall-time trust tiers disagree",
  "date_of_record": "2026 November 21",
  "scope": "Applies to long-lived agents that persist episodic/semantic memory across sessions and defend it with write-time validation plus trust-tiered recall. Does not apply to stateless single-turn agents or to memory stores where all writers share one trust tier.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-cross-session-memory-poisoning-when-write-time-validation-passes-but-recall-time-trust-tiers-disagree.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-cross-session-memory-poisoning-when-write-time-validation-passes-but-recall-time-trust-tiers-disagree.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-cross-session-memory-poisoning-when-write-time-validation-passes-but-recall-time-trust-tiers-disagree.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1526,
    "python_slice_tokens": 419,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"poisoned memory gets written.\" Write-time validation—schema checks, source allowlists, contradiction scans against existing facts—usually catches the naive case. The non-obvious failure is **tier/rank divergence between the write path and the recall path**: a fact is admitted at write time under a *low* trust tier (correctly, because...",
    "what_was_observed": "A support-triage agent persisted facts as records `{claim, source_tier, write_epoch, provenance_chain}`. Write-time validation rejected claims contradicting high-tier facts and admitted the rest, tagging unverified web-scrape content as `tier=UNTRUSTED`. A nightly distillation job summarized each session's episodic memory into semantic facts and, as a \"confidence\" heuristic, set distilled `source_tier = max(source_ti...",
    "condition_of_validity": "The invariant holds only under three jointly-required conditions: 1. **Trust monotonicity under internal events.** The trust function `τ(record)` may only be non-increasing along any chain of internal transformations (distillation, summarization, self-retrieval, survival). External re-attestation by an authoritative source is the *only* permitted increase, a...",
    "decision_boundary": "The boundary is: **does any code path allow an agent-internal, non-authoritative event to raise effective recall trust?** Concretely, treat each of these as a red line—if present, the defense is void: - Survival/age-based promotion (`never_contradicted_count >= k → promote`). Survival is evidence of *absence of challenge*, not of truth; an attacker controls ...",
    "operational_effect": "With the invariant enforced, the poisoned fact stays at `UNTRUSTED` forever unless an external authority re-attests it; the `TRUSTED` policy doc wins recall; the refund is blocked. The cost is that genuinely-correct low-tier facts never self-promote—they require an explicit attestation path, which is the correct trade: the agent cannot bootstrap trust from i..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "a2e308967a030e1a9f6f907af2074d0c9c82c8b56ebc7948972bc2d8e6ce82c9",
    "verified_classes": [
      "TrustLaunderingError",
      "MemoryRecord"
    ],
    "verified_functions": [
      "distill",
      "promote",
      "recall",
      "survival_promotion_guard"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TrustLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "cannot distill empty episode set"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
