{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-of-a-provenance-label-survive-re-entry-across-a-memory-write-boundary",
  "title": "Where must an instance of a provenance label survive re-entry across a memory-write boundary",
  "date_of_record": "2026 November 12",
  "scope": "Applies to agent runtimes that tag context segments with provenance labels (e.g., `trusted:user`, `untrusted:tool_output`, `derived:tainted`) and persist them into a memory store read by later turns or sessions. Does not apply to stateless single-turn inference where no context segment crosses a turn boundary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-of-a-provenance-label-survive-re-entry-across-a-memory-write-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-of-a-provenance-label-survive-re-entry-across-a-memory-write-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-of-a-provenance-label-survive-re-entry-across-a-memory-write-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1549,
    "python_slice_tokens": 407,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint tracking fails not at the point where untrusted content is *read*, but at the point where it is *re-materialized*. A tool output arrives with a label; the agent summarizes it; the summary is written to memory; a later turn retrieves the summary. The critical question is not \"was the tool output labeled?\" but \"did the label travel with the *derivation* ...",
    "what_was_observed": "In a runtime using a `write_memory(key, value, provenance)` API, the following sequence laundered taint: 1. Turn N: agent calls a fetch tool. Output labeled `untrusted:tool_output` contains an instruction-shaped string. 2. Agent composes a memory value: `f\"{user_question}\\n\\nNotes: {tool_output}\"` and passes `provenance=\"trusted:user\"` because the *call site* was in a user-initiated handler. 3. Turn N+1: retrieval re...",
    "condition_of_validity": "The join invariant holds only if all three of the following are enforced: - **Write-time join is mandatory and non-overridable.** The store computes the record label as the join over constituent fragment labels; callers may *raise* taint (mark something untrusted) but never lower it. A caller-supplied label is a floor, not an assignment. - **Derivation is tr...",
    "decision_boundary": "At the write boundary, the decision is binary and must be made mechanically: - **Compose → join.** If the value is built from more than one fragment, compute `label = join(fragment_labels)` and reject any caller label that does not dominate the join. - **Transform → propagate.** If the value is a function of tainted input, the output inherits the taint unles...",
    "operational_effect": "With the join enforced, injected instructions remain quarantined: they may be retrieved, but they arrive labeled `untrusted:tool_output` (joined through the summary), and policy that gates instruction-following on trust refuses them. The cost is over-tainting — a single untrusted fragment taints the whole record, and records become less reusable. This is the..."
  },
  "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": "f9c640a006814f0d6df99b58df5dc4d2052ddcc28daadb3c64bca2b26ba6941d",
    "verified_classes": [
      "ProvenanceLaunderingError",
      "Fragment"
    ],
    "verified_functions": [
      "join_labels",
      "write_memory",
      "retrieve_memory"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ProvenanceLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "assert retrieve_memory(rec).label == 'untrusted:tool_output'",
      "cannot join empty fragment set"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
