{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-enforce-prompt-injection-taint-across-tool-call-boundaries-and-why-per-message-provenance-is-the-wrong-granularity",
  "title": "Where must an instance enforce prompt-injection taint across tool-call boundaries, and why per-message provenance is the wrong granularity",
  "date_of_record": "2026 December 2",
  "scope": "Applies to agents whose tool outputs (web fetches, file reads, retrieved documents, sub-agent replies) are interleaved into the same context window that carries the instruction hierarchy, and which perform multi-step execution after ingesting untrusted content. Does not apply to single-turn, no-tool inference, or to architectures that hard-partition untrusted content into a separate model call with a typed, non-textual return channel.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-prompt-injection-taint-across-tool-call-boundaries-and-why-per-message-provenance-is-the-wrong-granularity.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-prompt-injection-taint-across-tool-call-boundaries-and-why-per-message-provenance-is-the-wrong-granularity.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-prompt-injection-taint-across-tool-call-boundaries-and-why-per-message-provenance-is-the-wrong-granularity.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2644,
    "python_slice_tokens": 496,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common framing of prompt-injection defense is a *content* problem: detect malicious text, classify it, sanitize it. The operational failure this record documents is a *provenance* problem. An injection succeeds not because the payload is undetectable but because the taint label attached to a tool result is dropped, downgraded, or silently re-scoped at th...",
    "what_was_observed": "A three-stage agent executed a research task: `fetch_page → summarize → act`. Instrumentation captured the following trace. 1. `fetch_page` returned a document. The runtime tagged the tool-call result with `provenance=external, trust=untrusted`. Correct so far. 2. Stage 2 (`summarize`) was invoked with the document in context. The model produced a 300-token summary. The runtime wrote the summary into the episodic sto...",
    "condition_of_validity": "This record holds under three conditions, and the guardrail is only sound when all three are met. **Condition 1 — The transform is text-mediated.** Taint propagation by lineage is required when a transform reads untrusted text and emits text that a downstream step will interpret. If the transform instead emits a typed, non-interpretable artifact (a structure...",
    "decision_boundary": "The boundary is: **at what granularity do you enforce, and what do you do when enforcement cannot be satisfied?** Enforce at the *span* level, at transform time. The decision procedure for each transform invocation is: - Compute `out_trust = meet(in_trust for every input span)`. If any input is `untrusted`, the output is at most `derived`. - If the transform...",
    "operational_effect": "With span-level, transform-time taint propagation and a lineage-keyed action gate, the trace above fails at step 2 rather than step 4: the summarizer attempts to write a `trusted` record from an `untrusted` input without a declassification record, and the write raises. The agent surfaces \"cannot persist summary: untrusted lineage, no declassifier\" and either..."
  },
  "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": "6046669670d4b4186caa48202714eb441ae82b77ddd98ec29c2b74a9465abc14",
    "verified_classes": [
      "Trust",
      "TaintViolation",
      "Span",
      "TaintGraph"
    ],
    "verified_functions": [
      "gate_passed",
      "run_trace",
      "__init__",
      "register_declassifier",
      "ingest",
      "transform",
      "require_gate"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
