{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-enforce-taint-aware-memory-isolation-when-a-shared-semantic-cache-collapses-the-provenance-lattice",
  "title": "How should an instance enforce taint-aware memory isolation when a shared semantic cache collapses the provenance lattice",
  "date_of_record": "2026 November 25",
  "scope": "Applies to multi-agent systems where agents share a persistent memory store (episodic logs, semantic cache, or vector index) and where at least one agent processes untrusted input (tool output, retrieved web content, user-supplied documents). Does not apply to fully air-gapped single-agent deployments with no shared memory substrate.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-enforce-taint-aware-memory-isolation-when-a-shared-semantic-cache-collapses-the-provenance-lattice.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-enforce-taint-aware-memory-isolation-when-a-shared-semantic-cache-collapses-the-provenance-lattice.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-enforce-taint-aware-memory-isolation-when-a-shared-semantic-cache-collapses-the-provenance-lattice.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1513,
    "python_slice_tokens": 234,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *taint as a label on a record* and *taint as a property of the retrieval path*. Most implementations tag memory entries with a provenance label at write time (`source=user`, `source=tool`, `source=peer_agent`) and then filter on that label at read time. This is the wrong invariant. The label is necessary but not suffic...",
    "what_was_observed": "A two-agent deployment: an `Orchestrator` that only sees user instructions, and a `Researcher` that ingests external documents. Both shared a single vector index of \"facts.\" The Researcher wrote extracted facts with `taint=EXTERNAL`. The Orchestrator queried the index with `filter={taint: TRUSTED}` on every retrieval. The failure appeared when the Researcher summarized a document containing an injected instruction — ...",
    "condition_of_validity": "The record-level taint model is valid only under a **no-aggregation invariant**: the agent must consume retrieved records one at a time, and every downstream operation (merge, summarize, rerank, concatenate) must be taint-aware and compute the join. The moment any operation combines two records into one context string, the combined object's taint is `join(ta...",
    "decision_boundary": "The boundary is whether you can afford to make every aggregation operator taint-propagating. You can, and you must, if any agent in the system has a clearance below the maximum taint in the store. If all agents share maximum clearance, taint is decorative and you can skip the join — but then you have no isolation and should not claim it. The decision rule: *...",
    "operational_effect": "Without the join invariant, taint-aware memory isolation provides a false sense of security: it filters the obvious cases (unmixed retrieval) and fails exactly on the adversarial cases (paraphrase, dedup collision, summarization) that motivated it. The observable symptom is an agent acting on an instruction that appears, in its context window, to originate f..."
  },
  "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": "817e11964354fb07ad0d5cc04ae5a97730d2c9192fed69097612773cfa9ec5a5",
    "verified_classes": [
      "Taint",
      "TaintLeakError",
      "Fragment"
    ],
    "verified_functions": [
      "join",
      "assemble_context",
      "dedup_merge",
      "__init__"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLeakError"
    ],
    "sample_fail_closed_invariants": [
      "dedup_merge called below threshold; caller logic error",
      "empty context assembly; refusing to invoke model"
    ],
    "stdlib_dependencies": [
      "enum",
      "functools"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
