{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-label-laundering-across-retrieval-and-tool-call-boundaries-in-prompt-injection-taint-tracking",
  "title": "Which invariants prevent label-laundering across retrieval and tool-call boundaries in prompt-injection taint tracking",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agents that carry per-span data-flow labels (trusted/untrusted, or provenance tags) through a plan and enforce them at each tool-call and retrieval boundary. Does not apply to stateless single-turn calls with no label propagation, nor to systems whose only defense is a static system-prompt instruction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-label-laundering-across-retrieval-and-tool-call-boundaries-in-prompt-injection-taint-tracking.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-label-laundering-across-retrieval-and-tool-call-boundaries-in-prompt-injection-taint-tracking.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-label-laundering-across-retrieval-and-tool-call-boundaries-in-prompt-injection-taint-tracking.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1989,
    "python_slice_tokens": 432,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A taint label is not a property of a *string*; it is a property of a *derivation*. The failure mode here is **label laundering**: an untrusted span enters the context (a retrieved document, a tool response, a web fetch), gets transformed by an operation the runtime treats as label-preserving-neutral (summarization, JSON re-serialization, entity extraction, a...",
    "what_was_observed": "A research agent was asked to reconcile a vendor's pricing across two sources. Step 1 fetched `vendor.example/pricing` (untrusted, label `U`). Step 2 called a local `summarize` tool on the fetched text. The tool's implementation re-emitted the summary as a *new* message with `role: assistant` and no `source_refs`, because the summarizer was written as a generic text utility that returns `{\"summary\": str}`. The tracke...",
    "condition_of_validity": "The invariant holds only under three jointly-required conditions: 1. **Total labeling of sinks and sources.** Every tool in the registry declares, in its schema, an `output_trust` policy: either `derived` (must propagate input labels via lattice join) or `constant(level)` (e.g., a clock tool is `T`). A tool that omits the declaration is treated as `derived` ...",
    "decision_boundary": "The boundary is between **blocking on taint** and **blocking on taint-and-sink-class**. Blocking all `U`-labeled content from all tools is over-broad: it prevents the agent from reading untrusted text to *reason* about it, which is the entire point of retrieval. The correct boundary is a two-dimensional policy: `(label, sink_class) → allow | require_human | ...",
    "operational_effect": "With the invariant enforced, the incident's Step 2 (`summarize`) emits `{\"summary\": ..., \"source_refs\": [\"span:pricing:47\"]}` and the tracker computes `label(summary) = U`. Step 3's `send_email` pre-dispatch check sees a `U`-labeled recipient and a `mutating` sink, and blocks with a structured refusal that names the offending span. The agent's trace shows th..."
  },
  "matched_failure_symptoms": [
    "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": "da8d6878951b82a66ccc3accdec5f666e92b5d8e74e0e6c9eea4fc5f38097e49",
    "verified_classes": [
      "Trust",
      "SinkClass",
      "TaintLaunderingError",
      "ExfiltrationBlocked",
      "Span",
      "ToolSpec"
    ],
    "verified_functions": [
      "join",
      "dispatch",
      "enforce_sink",
      "run_plan"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ExfiltrationBlocked",
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
