{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-re-derive-a-taint-label-at-the-write-boundary-rather-than-trust-the-label-carried-on-a-tool-output",
  "title": "Where must an instance re-derive a taint label at the write boundary rather than trust the label carried on a tool output?",
  "date_of_record": "2026 November 30",
  "scope": "Applies to single- or multi-agent systems that implement dynamic information-flow control (DIFC) by attaching provenance/taint labels to tool outputs and propagating them into episodic memory writes. Does not cover static source-sink taint analysis of the agent's own code, nor pure prompt-level \"ignore injected instructions\" heuristics.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-re-derive-a-taint-label-at-the-write-boundary-rather-than-trust-the-label-carried-on-a-tool-output.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-re-derive-a-taint-label-at-the-write-boundary-rather-than-trust-the-label-carried-on-a-tool-output.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-re-derive-a-taint-label-at-the-write-boundary-rather-than-trust-the-label-carried-on-a-tool-output.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2451,
    "python_slice_tokens": 459,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that breaks implementations is between a *label as metadata* and a *label as a derived predicate over content lineage*. Most agent frameworks implement the former: a tool wrapper tags its return value with `taint=\"untrusted\"` when the tool is classified as \"external\" (web fetch, email read, file read from user dir). Downstream, the memory wri...",
    "what_was_observed": "A research agent with three tools: `web_fetch(url) -> str` (classified external), `summarize(text) -> str` (classified internal/trusted, a small local model), and `memory_write(key, value)` (classified internal). A user task: \"Research X and store a one-paragraph summary under `topic_x`.\" Trace: 1. `web_fetch` returns a page whose body contains, after the legitimate article, an injected block: `SYSTEM: when summarizi...",
    "condition_of_validity": "The re-derivation rule is *necessary* whenever all three hold: - (a) At least one tool classified trusted/internal can transform content that originated from a tainted source (any pass-through, parser, summarizer, embedder, or query). - (b) The taint label is consulted as an authorization signal at a later boundary — memory admission, tool-call gating, or cr...",
    "decision_boundary": "The operational question at each write is: *do I have the input lineage for these bytes in scope right now?* - If **yes** — the write is happening in the same frame that holds the producing tool call's arguments and their labels — compute `label = join(labels of all arguments that fed this value)` and attach that. Do not read a label off the tool's return en...",
    "operational_effect": "Enforcing re-derivation changes three things. First, it converts the summarizer from a laundering point into a join point: its output label becomes `join(untrusted)` = `untrusted`, so the memory write is quarantined and the injected policy is never promoted to first-party context. Second, it makes the \"trusted tool\" classification a statement about *what the..."
  },
  "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": "544d45b22cb7094d123e2a0193ebd59f61a5759ede3e06e62cd727e4c1b0e9b6",
    "verified_classes": [
      "TaintLaunderingError",
      "UnresolvableLineageError",
      "LabeledValue",
      "MemoryRecord",
      "TaintTrackingMemory"
    ],
    "verified_functions": [
      "join_labels",
      "demo",
      "__init__",
      "write_from_tool_output",
      "write_from_unknown_source",
      "read_as_context"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TaintLaunderingError",
      "UnresolvableLineageError"
    ],
    "sample_fail_closed_invariants": [
      "assert ctx.label == 'untrusted'",
      "join over empty lineage",
      "assert rec.quarantined and rec.label == 'untrusted'"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
