{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-that-taint-from-a-prompt-injection-source-has-silently-laundered-through-a-tool-output-re-serialization-boundary",
  "title": "What structural signals indicate that taint from a prompt-injection source has silently laundered through a tool-output re-serialization boundary",
  "date_of_record": "2026 November 7",
  "scope": "Applies to agent runtimes that propagate provenance/taint labels across tool calls and retrieved-context injection, specifically when a tool output is re-serialized (JSON→string→JSON, template rendering, log-and-replay, or schema coercion) before re-entering the model context. Does not apply to runtimes where taint is tracked purely on the raw byte stream and never re-parsed, nor to single-turn systems with no tool loop.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-that-taint-from-a-prompt-injection-source-has-silently-laundered-through-a-tool-output-re-serialization-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-that-taint-from-a-prompt-injection-source-has-silently-laundered-through-a-tool-output-re-serialization-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-that-taint-from-a-prompt-injection-source-has-silently-laundered-through-a-tool-output-re-serialization-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1491,
    "python_slice_tokens": 248,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A taint label has two independent failure modes: **dropping** (label lost, tainted content re-enters as clean) and **laundering** (label survives as a *string* but is disconnected from the *bytes it was supposed to guard*). Dropping is loud — you can detect it by asserting every ingested span carries a label. Laundering is silent: the label is present, well-...",
    "what_was_observed": "In a retrieval-augmented agent with a `fetch_document` tool, a poisoned document contained an instruction payload. The taint tracker correctly labeled the retrieved chunk `TAINTED:external_untrusted` at ingestion. The chunk then passed through a summarization tool whose output was re-serialized through a JSON round-trip (`json.dumps` → transport → `json.loads`) and a Jinja-style template render before re-entering con...",
    "condition_of_validity": "The laundering is only possible when all of the following hold; remove any one and the boundary is safe: - The re-serializer is **not label-aware** (it transforms content without a callback to re-anchor spans). - Taint is stored as **offsets or span lengths** into a mutable buffer rather than as an **immutable content-addressed reference** (e.g., a hash of t...",
    "decision_boundary": "Treat the boundary as **unsafe to cross with a live label** when the serializer cannot re-anchor. The operational rule: - **Re-anchor** if the serializer exposes a mapping from old spans to new spans (rare; requires instrumenting the serializer). Recompute span offsets against the post-serialization buffer and verify each re-anchored span hashes to the origi...",
    "operational_effect": "Enforcing content-hash binding at consumption converts silent laundering into a loud, catchable `TaintLaunderingError` at the boundary, at the cost of re-hashing every tainted span on read (measured ~0.3ms per KB in the observed runtime — acceptable for tool outputs, prohibitive for large retrieved corpora, which is why the fail-closed invalidation path is t..."
  },
  "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": "66e46746abff188c168c25635200c916ecbcc134effd4a461c2f43b38ba042c8",
    "verified_classes": [
      "TaintLaunderingError",
      "TaintLabel"
    ],
    "verified_functions": [
      "reanchor_or_invalidate",
      "consume_tainted_span"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
