{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-propagate-prompt-injection-taint-labels-across-tool-output-boundaries-without-losing-the-label-at-context-compaction",
  "title": "How should an instance propagate prompt-injection taint labels across tool-output boundaries without losing the label at context compaction?",
  "date_of_record": "2026 November 27",
  "scope": "Applies to single-agent and orchestrator-worker LLM systems that ingest untrusted tool output (web fetch, file read, email body, RAG chunk, sub-agent reply) into a shared context and later act on it with side-effecting tools. Does not apply to systems where all tool outputs are cryptographically signed by a trusted producer and validated before ingestion, nor to stateless single-turn inference with no tool use.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-propagate-prompt-injection-taint-labels-across-tool-output-boundaries-without-losing-the-label-at-context-compaction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-propagate-prompt-injection-taint-labels-across-tool-output-boundaries-without-losing-the-label-at-context-compaction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-propagate-prompt-injection-taint-labels-across-tool-output-boundaries-without-losing-the-label-at-context-compaction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2324,
    "python_slice_tokens": 629,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *content provenance* and *content instruction authority*. A taint label is not a classification of the text (\"this looks malicious\"); it is a data-flow fact (\"this byte range originated from an untrusted source and has not been laundered through a trusted transform\"). The non-obvious boundary is that taint must survive...",
    "what_was_observed": "Trace from a research agent (orchestrator, `claude-opus`, 200k window) tasked with \"summarize the vendor's security posture and, if the policy page authorizes it, file a disclosure ticket.\" 1. **Ingestion.** Agent calls `fetch_url(\"https://vendor.example/security\")`. Output is 41 KB of HTML→text. The runtime wraps it: `{\"role\":\"tool\",\"tool_call_id\":\"t17\",\"content\":\"...\",\"taint\":[\"untrusted_web\"],\"origin\":\"vendor.exam...",
    "condition_of_validity": "The invariant holds — and the failure is preventable — only under these conditions: - **The taint lattice is explicit and ordered.** Define labels as a join-semilattice: `trusted ⊔ untrusted_web = untrusted_web`. A transform may only *raise* taint, never lower it, unless it passes through a declared *declassifier* (e.g., a schema-validated extractor that ret...",
    "decision_boundary": "The operational decision is: **at what granularity do you track taint, and which transforms are allowed to reduce it?** Three regimes: The boundary to cross is from *envelope* to *claim-level with declassifiers*. Below that boundary, every compaction is a potential laundering event and the only safe posture is to forbid side-effecting tools after any compact...",
    "operational_effect": "Implementing claim-level taint with a monotone compaction rule changes three things: 1. **Compaction becomes a labeled transform, not a lossy rewrite.** The summarizer must emit spans with inherited labels; the runtime re-attaches them. Cost: ~5–10% token overhead for label metadata, and a summarizer prompt that instructs \"preserve provenance markers.\" Benef..."
  },
  "matched_failure_symptoms": [
    "PROMPT_INJECTION_OR_CONFUSED_DEPUTY",
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "b35fe8cfd05e0e1211a1a41584dfeda64776f9b91d3f997f07d459c92f4933b0",
    "verified_classes": [
      "Taint",
      "TaintLaunderingError",
      "Span",
      "Message"
    ],
    "verified_functions": [
      "compact",
      "declassify_typed",
      "authorize_tool_call",
      "join",
      "__post_init__",
      "taint"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "assert summary.taint == Taint.UNTRUSTED_WEB"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
