{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-enforce-taint-label-join-semantics-at-every-memory-write-boundary-not-just-at-tool-ingress-to-prevent-prompt-injection-launderi",
  "title": "Where must an instance enforce taint-label join semantics at every memory-write boundary, not just at tool-ingress, to prevent prompt-injection laundering through episodic buffers",
  "date_of_record": "2026 December 2",
  "scope": "Applies to single- or multi-agent LLM systems that propagate information-flow (IFC) taint labels from tool outputs into a persistent or episodic memory store, where memory reads are later re-admitted into the context window as trusted content. Does not apply to stateless single-turn invocations with no memory persistence, nor to systems where all tool outputs are structurally quarantined and never re-read into context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-taint-label-join-semantics-at-every-memory-write-boundary-not-just-at-tool-ingress-to-prevent-prompt-injection-launderi.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-taint-label-join-semantics-at-every-memory-write-boundary-not-just-at-tool-ingress-to-prevent-prompt-injection-launderi.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-taint-label-join-semantics-at-every-memory-write-boundary-not-just-at-tool-ingress-to-prevent-prompt-injection-launderi.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2145,
    "python_slice_tokens": 430,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common framing of prompt-injection defense treats taint tracking as an *ingress* problem: label untrusted tool outputs when they enter the context, and gate any action (tool call, code execution, outbound request) on whether the current reasoning trace carries a high-integrity label. This is necessary but insufficient. The boundary that actually fails is...",
    "what_was_observed": "A research agent loop with three tools (`web_fetch`, `doc_search`, `write_note`) and a persistent episodic store. Ingress labeling worked: every `web_fetch` result was tagged `UNTRUSTED`, and the action gate blocked any `shell` call while an `UNTRUSTED` span was live in context. The store was a vector index keyed by note text; `write_note` accepted a `content` string and a `tags` list, and the agent's policy layer pa...",
    "condition_of_validity": "The laundering failure is possible exactly when all three hold: 1. **There exists a write path whose schema does not carry the label.** If `write_note` required a `taint` field and the policy layer computed it as the join of all contributing spans, the write would be labeled and the read would join it. The failure requires the label to be *droppable*—i.e., t...",
    "decision_boundary": "The architectural invariant required is a **label join at every memory-write and every memory-read**, with taint as a monotone semilattice: - On write: `label(record) = join(label(content_span), label(provenance_spans...))`, where `join(UNTRUSTED, anything) = UNTRUSTED`. The write must be rejected or downcast if the store cannot represent the joined label. -...",
    "operational_effect": "With join-at-boundary enforced, the incident trace changes at step 2: `write_note` computes `join(UNTRUSTED, TRUSTED) = UNTRUSTED` and either stores the record with an `UNTRUSTED` label or rejects the write. At step 4, `doc_search` retrieves the record, joins `UNTRUSTED` into the result, and the gate arms before `shell` is called. The attack is blocked at th..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION",
    "PROMPT_INJECTION_OR_CONFUSED_DEPUTY"
  ],
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "abd313c756950d97f1fcd1c296a77b0d411a3a5243d5e71ad384ba338e838fd1",
    "verified_classes": [
      "Taint",
      "TaintLaunderingError",
      "Span",
      "Record",
      "LabeledStore"
    ],
    "verified_functions": [
      "join",
      "act_on_memory",
      "__init__",
      "write",
      "read",
      "_supports_labels"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "write with no provenance: cannot compute taint join",
      "store is label-blind but write derives from UNTRUSTED content; blocking write to preserve taint invariant"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
