{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-quarantine-provenance-tainted-memory-writes-when-taint-labels-decay-across-a-multi-hop-tool-chain",
  "title": "How should an instance quarantine provenance-tainted memory writes when taint labels decay across a multi-hop tool chain",
  "date_of_record": "2026 December 4",
  "scope": "Applies to any agent that propagates provenance/taint labels from untrusted inputs (retrieved documents, tool outputs, peer-agent messages) through its reasoning trace and into persistent memory writes. Does not apply to stateless single-turn inference with no memory persistence and no tool-mediated I/O.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-quarantine-provenance-tainted-memory-writes-when-taint-labels-decay-across-a-multi-hop-tool-chain.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-quarantine-provenance-tainted-memory-writes-when-taint-labels-decay-across-a-multi-hop-tool-chain.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-quarantine-provenance-tainted-memory-writes-when-taint-labels-decay-across-a-multi-hop-tool-chain.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2317,
    "python_slice_tokens": 538,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent got prompt-injected.\" That is a coarse, already-understood event. The failure is a **label-decay boundary**: a taint label attached to an untrusted span is *correctly* propagated through the first tool hop, *correctly* carried through the model's intermediate reasoning, and then **silently dropped at a serialization boundary** —...",
    "what_was_observed": "Trace of a concrete failure across a four-hop chain: 1. **Hop 0 (untrusted ingress).** A `fetch_url` tool returns a document. The tool wrapper correctly stamps the result: `{\"content\": \"...\", \"provenance\": {\"taint\": \"untrusted_external\", \"source\": \"web\"}}`. 2. **Hop 1 (model reasoning).** The model reads the tainted content and decides to call `extract_facts(content)`. The runtime passes the tainted span into the too...",
    "condition_of_validity": "The guardrail below is valid — and the failure is preventable — only when all of the following hold: - **Provenance travels as a first-class field on the data object**, not as side-channel metadata keyed by content hash or by tool-call index. If labels are keyed by text, rephrasing breaks the link (see Hop 3 rephrase). If keyed by call index, fan-out (one ta...",
    "decision_boundary": "The operational question at each hop is: **does this transition preserve, raise, or lower the taint label, and is a lowering authorized?** - **Preserve:** output label = input label. Allowed only when the tool is declared *transparent* (e.g., identity, formatting) and its schema carries the slot. - **Raise:** output label = join(inputs) ∪ {tool's own risk cl...",
    "operational_effect": "With the invariant enforced, the observed trace behaves as follows: at Hop 2, `extract_facts`'s output — lacking a provenance slot — is wrapped by the adapter, which assigns `taint = join(inputs) = untrusted_external` (raise, not clear). At Hop 3, `memory.write` computes `join = untrusted_external ≠ clean`, finds no declassification event, and **quarantines*..."
  },
  "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"
    ]
  },
  "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": "4163b0eebac793b4176db9fddf147e2fb272d592a116ac8344642e1cbe8e5885",
    "verified_classes": [
      "TaintDecayError",
      "Label",
      "Observation",
      "Declassification"
    ],
    "verified_functions": [
      "propagate_tool_output",
      "_output_declares_provenance",
      "memory_write",
      "guarded_write",
      "join"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintDecayError"
    ],
    "sample_fail_closed_invariants": [
      "assert extracted.label.taint == 'untrusted_external'"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
