{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-dynamic-taint-labels-from-surviving-tool-boundaries-during-prompt-injection-containment",
  "title": "Which invariants prevent dynamic taint labels from surviving tool boundaries during prompt-injection containment",
  "date_of_record": "2026 November 14",
  "scope": "Applies to agentic systems that propagate information-flow (taint) labels across calls into external tools, sub-agents, or retrieval services, where the label is attached at ingestion and consulted at a privileged sink (e.g., outbound HTTP, shell execution, file write). Does not apply to stateless single-turn classifiers that make an injection decision before any tool call, nor to systems where the entire tool graph runs in one trust domain with no label serialization.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-dynamic-taint-labels-from-surviving-tool-boundaries-during-prompt-injection-containment.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-dynamic-taint-labels-from-surviving-tool-boundaries-during-prompt-injection-containment.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-dynamic-taint-labels-from-surviving-tool-boundaries-during-prompt-injection-containment.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1653,
    "python_slice_tokens": 334,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *label persistence* (the taint marker is still attached to the data when it reaches the sink) and *label fidelity* (the marker still describes the same bytes it originally described). Most containment designs test the first and assume the second. Prompt injection containment fails at the seam where a tool boundary re-s...",
    "what_was_observed": "A retrieval tool returned a document chunk labeled `taint=untrusted, origin=web, digest=sha256:9f3c…`. The orchestrator forwarded the chunk to a summarization sub-agent, which returned a summary. The summary carried `taint=untrusted` because the framework propagated the parent label one hop. The sub-agent had, however, also been given a system instruction to \"preserve any imperative instructions verbatim,\" and the in...",
    "condition_of_validity": "The containment holds only under three conditions, all of which must be checked at every boundary crossing, not at ingestion: 1. **Content binding.** Every label carries a cryptographic digest (or an equivalent structural commitment, e.g., a Merkle root over the exact token sequence) computed over the bytes the label describes, and the digest is recomputed a...",
    "decision_boundary": "When the digest does not match the bytes at the sink, the system must choose between *re-taint* (raise the value to the join of its provenance and continue, logging the mismatch) and *quarantine* (halt the flow and surface the boundary for inspection). The boundary is: re-taint when the mismatch is explainable by a declared transformation registered in the t...",
    "operational_effect": "Systems that implement content binding plus default-max inheritance eliminate the two observed failure classes at the cost of re-tainting aggressively: any tool that rewrites text (summarizers, formatters, translators) will produce digest mismatches and force re-taint to the join, which in practice means summaries of untrusted documents stay untrusted and ca..."
  },
  "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": "89ba3abfdd8eeec068336ca84dfd312ad0c7b5a992fd8a3fced815c7b4b6d465",
    "verified_classes": [
      "TaintBoundaryError",
      "Label"
    ],
    "verified_functions": [
      "_digest",
      "_join",
      "cross_boundary",
      "check_sink"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintBoundaryError"
    ],
    "sample_fail_closed_invariants": [
      "stale binding at sink; recompute before release"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
