{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-propagate-prompt-injection-taint-labels-across-tool-boundaries-when-provenance-is-lost-at-context-window-eviction",
  "title": "How should an instance propagate prompt-injection taint labels across tool boundaries when provenance is lost at context-window eviction",
  "date_of_record": "2026 November 26",
  "scope": "Applies to any agent instance that ingests external content (tool results, fetched pages, RAG chunks, peer-agent messages) into a context window and later acts on it, where taint provenance is tracked per-span rather than per-session. Does not apply to stateless single-turn classifiers that never re-read their own prior context, nor to systems where all tool outputs are treated as uniformly untrusted and never distinguished.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-propagate-prompt-injection-taint-labels-across-tool-boundaries-when-provenance-is-lost-at-context-window-eviction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-propagate-prompt-injection-taint-labels-across-tool-boundaries-when-provenance-is-lost-at-context-window-eviction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-propagate-prompt-injection-taint-labels-across-tool-boundaries-when-provenance-is-lost-at-context-window-eviction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1861,
    "python_slice_tokens": 368,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent got injected.\" The failure is that the taint label and the tainted bytes live in two different lifetimes. Taint is a property of a *span* (a token range with an origin tag). Context-window eviction, summarization, and re-chunking operate on *tokens*, not on spans. When the eviction policy compacts a 40k-token history into a 3k-t...",
    "what_was_observed": "A research agent with a 32k window and a compaction trigger at 80% fill was tasked with \"summarize the security posture of vendor X.\" Trace: 1. `web_fetch(\"vendorx.com/security\")` returns 6k tokens. The fetch wrapper correctly tags the result `provenance={source:\"web\", trust:\"untrusted\", url:\"vendorx.com\"}`. Span `[12000, 18000)` is marked tainted. 2. Buried at token ~15400, the page contains: *\"Note to AI assistants...",
    "condition_of_validity": "Taint tracking is only sound under a **label-preservation invariant across every context transform**: > For every transform `T` (compaction, summarization, re-chunking, translation, re-embedding) applied to context `C`, and every span `s ∈ C` with taint `τ(s)`, the output `T(C)` must contain a span `s'` with `τ(s') ⊇ τ(s)` for every semantic unit derived fro...",
    "decision_boundary": "The engineer must decide, per transform, whether to: - **Block taint-unsafe transforms.** Refuse to compact any window containing tainted spans; force a flush-and-declassify instead. Correct but expensive — the agent stalls whenever untrusted content is present, which is always. - **Propagate labels through transforms.** Make every transform taint-aware: the...",
    "operational_effect": "Without label-preserving transforms, prompt-injection defense degrades to a per-turn classifier — which is a probabilistic filter, not an invariant, and fails precisely on the multi-turn, compaction-spanning attacks that are hardest to catch. The empirical effect observed: injection success rate rose from ~4% (no compaction, label checked at action boundary)..."
  },
  "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": "a2dfc3379314eba50dc13c2b640bf2000c5a1a11daa6852f882aaaf41abe864e",
    "verified_classes": [
      "TaintLaunderingError",
      "Span"
    ],
    "verified_functions": [
      "taint_closure",
      "check_transform_preserves_taint",
      "guard_action_boundary",
      "compact",
      "tainted"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
