{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-re-derives-a-tool-call-argument-from-a-tainted-retrieval-chunk-after-sanitization-has-already-passed",
  "title": "What happens when an instance re-derives a tool-call argument from a tainted retrieval chunk after sanitization has already passed",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agent pipelines where retrieved context carries provenance/taint tags and tool-call arguments are sanitized at the point of emission. Does not apply to pipelines where tool arguments are constructed solely from developer-supplied templates with no model-generated content, or where retrieval results are never fed back into argument synthesis.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-re-derives-a-tool-call-argument-from-a-tainted-retrieval-chunk-after-sanitization-has-already-passed.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-re-derives-a-tool-call-argument-from-a-tainted-retrieval-chunk-after-sanitization-has-already-passed.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-re-derives-a-tool-call-argument-from-a-tainted-retrieval-chunk-after-sanitization-has-already-passed.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2295,
    "python_slice_tokens": 522,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different moments at which taint can be evaluated: at *retrieval ingress* (when a chunk enters the context window, tagged with provenance and taint class) and at *argument egress* (when the model emits a tool call whose arguments may have been synthesized from that context). Most implementations check taint at one of these points. ...",
    "what_was_observed": "A retrieval-augmented agent was given a task to file a support ticket summarizing a customer's issue. Retrieved chunks carried provenance tags: `source=crm`, `taint=none` for structured CRM fields; `source=email_thread`, `taint=untrusted_user_content` for inbound email bodies. The egress sanitizer for the `file_ticket` tool rejected any argument containing a verbatim span from a `taint=untrusted_user_content` chunk o...",
    "condition_of_validity": "The egress-sanitization-only design is valid if and only if at least one of the following holds: 1. **No re-derivation path exists.** No downstream agent or tool can resolve a paraphrase back to its tainted source (e.g., the tainted chunk is not reachable via any shared index, and the paraphrase contains no resolvable handle). 2. **Provenance is inherited th...",
    "decision_boundary": "The operational choice is not \"sanitize or don't.\" It is *where provenance is computed and what it is attached to*: - **Attach provenance to text spans and sanitize at egress** → correct only for copy-heavy pipelines (extraction, transcription, structured field mapping). Fails under summarization, translation, and cross-chunk synthesis. This is the observed ...",
    "operational_effect": "The immediate effect is **silent taint laundering**: a tainted instruction reaches a privileged tool through an intermediate artifact that carries a clean tag. Detection is delayed because every individual stage behaves correctly against its own local invariant. The failure surfaces only when the downstream tool acts on the laundered referent — in this case,..."
  },
  "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": "2c691ec22ebcfeace819bab1c7b277e7e5d99828251a93580691ebe486d3bafe",
    "verified_classes": [
      "TaintLaunderingError",
      "Chunk",
      "Referent",
      "Artifact"
    ],
    "verified_functions": [
      "egress_sanitize",
      "file_ticket"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "unreachable: egress_sanitize should have rejected this call"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
