{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-prompt-injection-taint-when-a-tainted-span-is-summarized-into-a-semantic-memory-record",
  "title": "Why does an instance lose prompt-injection taint when a tainted span is summarized into a semantic memory record?",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents that propagate provenance/taint labels across retrieval, tool outputs, and memory writes, and that distill episodic traces into semantic memory. Does not apply to stateless single-turn inference with no persistent store or no summarization step.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-prompt-injection-taint-when-a-tainted-span-is-summarized-into-a-semantic-memory-record.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-prompt-injection-taint-when-a-tainted-span-is-summarized-into-a-semantic-memory-record.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-prompt-injection-taint-when-a-tainted-span-is-summarized-into-a-semantic-memory-record.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2056,
    "python_slice_tokens": 340,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint tracking on raw spans is a *label-preserving* operation: a retrieved document tagged `untrusted` stays `untrusted` as long as it is carried verbatim in context. The failure lives at the *distillation boundary*—the point where an agent compresses one or more episodic spans into a semantic memory record (\"fact\") via an LLM summarization call. The summari...",
    "what_was_observed": "A retrieval-augmented agent with a nightly \"consolidation\" job. Episodic buffer holds span records shaped `{span_id, text, provenance: trusted|untrusted, source_uri}`. Consolidation calls an LLM: \"Summarize these spans into durable facts.\" The output is parsed into `{fact_text, confidence}` and written to the semantic store. The semantic store schema has no `provenance` column—it was added later, for episodic spans o...",
    "condition_of_validity": "The invariant \"semantic memory records are untainted unless explicitly derived from tainted spans\" holds only when the consolidator's input set is *stable across retries* and the write path *joins provenance from every input span*. Both conditions failed above. The bound that must hold: for every semantic record `r` written at time `t`, there exists a set `S...",
    "decision_boundary": "The decision is not \"should we summarize.\" It is **what must be true before a regenerated text artifact is allowed to carry a trusted label.** The boundary: a semantic record may be marked `trusted` only if (a) its input span set is non-empty, (b) every span in the set is `trusted`, and (c) the span set is persisted alongside the record so that a later audit...",
    "operational_effect": "With the join enforced, the staging-endpoint fact is written as `untrusted` with `S(r) = {web_page_span_id, user_question_span_id}`. The cold-start instance retrieves it, sees `untrusted`, and either (a) refuses to act on it for a production task, or (b) routes it through a verification step that re-fetches the source and confirms the claim against a trusted..."
  },
  "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"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "6b8da222f28e5bc46f03a0a874b558094529ec659e3c25847d12b19502fccaf5",
    "verified_classes": [
      "ProvenanceLaunderingError",
      "Span",
      "SemanticRecord"
    ],
    "verified_functions": [
      "join_provenance",
      "consolidate",
      "idempotency_key"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ProvenanceLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "assert rec.provenance == 'untrusted'",
      "refusing write with empty input span set; provenance unresolvable"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
