{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-taint-clear-on-write-back-but-persist-injected-state-across-sessions-the-write-back-barrier-invariant",
  "title": "Why does an instance taint-clear on write-back but persist injected state across sessions: the write-back barrier invariant",
  "date_of_record": "2026 November 23",
  "scope": "Applies to multi-tenant agent runtimes that implement taint-aware memory isolation to prevent prompt-injection persistence, where memory regions are tagged with a trust label (e.g., `tainted`, `clean`) and cross-session reads are gated on that label. Does not apply to single-session sandboxes where no memory outlives the process, nor to runtimes that perform full session teardown and re-instantiation of the memory store between turns.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-taint-clear-on-write-back-but-persist-injected-state-across-sessions-the-write-back-barrier-invariant.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-taint-clear-on-write-back-but-persist-injected-state-across-sessions-the-write-back-barrier-invariant.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-taint-clear-on-write-back-but-persist-injected-state-across-sessions-the-write-back-barrier-invariant.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1528,
    "python_slice_tokens": 183,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **taint as a property of the write** and **taint as a property of the value**. Most taint-aware isolation designs implement the former: when a session writes to a memory region, the region is marked tainted, and on session close the region is cleared or quarantined. This is a *write-barrier* model. It is correct for pr...",
    "what_was_observed": "In a production agent runtime, sessions were isolated by a per-session memory namespace with a `trust` field on each namespace, set to `clean` on creation. A \"research\" tool fetched external documents and wrote summaries into the session's namespace. The tool was declared taint-free because its output was passed through a content filter that stripped instruction-like patterns. A prompt injection was embedded in a fet...",
    "condition_of_validity": "The write-barrier model is valid only when the following holds: **no value originating in a tainted region may be written to a clean region without the destination inheriting the source's taint.** In practice this requires one of: 1. A provenance-tracking type system where every value carries a taint lattice element, and every write performs `dest.taint = de...",
    "decision_boundary": "Use the write-barrier model when: the memory store is the only persistence path, all cross-region copies go through a single audited declassifier, and no service identity can read tainted regions and write clean regions in the same operation. Do **not** use the write-barrier model when: any consolidation, summarization, caching, or \"promote to long-term\" pat...",
    "operational_effect": "The operational consequence is that taint-aware isolation must be specified as a **data-flow property**, not an **access-control property**. Access-control framing (who may write where) is necessary but insufficient; the failure is a data-flow leak through an authorized writer. Teams that implement taint as a namespace flag and then add a \"consolidation\" or ..."
  },
  "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": "4658ea64d1715f47ced5cff1739f9f91eca53b626870d57d82e55de2a027206b",
    "verified_classes": [
      "TaintLaunderingError",
      "TaintedValue"
    ],
    "verified_functions": [
      "consolidate",
      "__init__"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "clean-identity write of tainted value into clean region: taint must join over value provenance, not just writer identity"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
