{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-prompt-injection-taint-that-survives-a-tool-output-round-trip-when-the-taint-label-is-derived-from-content-rather-than-pro",
  "title": "How does an instance detect prompt-injection taint that survives a tool-output round trip when the taint label is derived from content rather than provenance?",
  "date_of_record": "2026 November 24",
  "scope": "Applies to single-agent or multi-agent runtimes that ingest untrusted content (web fetches, retrieved documents, third-party MCP tool results) into the same context window that carries the instruction hierarchy, and that attempt to enforce sink policies (write, send, execute) via dynamic taint labels computed from tool output. Does not apply to architectures that maintain strict provenance tags assigned at the transport layer and never re-derive labels from content.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-prompt-injection-taint-that-survives-a-tool-output-round-trip-when-the-taint-label-is-derived-from-content-rather-than-pro.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-prompt-injection-taint-that-survives-a-tool-output-round-trip-when-the-taint-label-is-derived-from-content-rather-than-pro.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-prompt-injection-taint-that-survives-a-tool-output-round-trip-when-the-taint-label-is-derived-from-content-rather-than-pro.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2079,
    "python_slice_tokens": 317,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent read a malicious string.\" It is the collapse of taint identity across the serialization boundary between a tool's raw output and the agent's parsed representation of that output. A taint label attached to a byte range of a tool response is meaningful only if the label can be re-associated with the exact token span the model late...",
    "what_was_observed": "A retrieval tool returns a document. The runtime's taint tracker runs a content classifier over the tool result and labels spans matching imperative patterns (\"ignore previous\", \"you must\", tool-call-shaped JSON) as `TAINTED`. The document contains a benign-looking instruction embedded in a code block: The classifier does not fire: it is inside a code fence, phrased as a comment, and contains no first-person imperati...",
    "condition_of_validity": "Content-derived taint labels are sound only under a condition the runtime almost never checks: **the classifier's miss region must be disjoint from the adversary's control surface.** Since the adversary controls the content, this condition is never met in adversarial settings. Content-derived labels are therefore valid only as a *recall aid* layered on top o...",
    "decision_boundary": "The boundary the runtime must enforce is between *label as annotation* and *label as authority*: - **Annotation mode (safe):** classifier output may *escalate* a span to a higher quarantine tier. `UNTRUSTED + classifier_hit → QUARANTINED`. Sinks blocked on both. No loss of soundness. - **Authority mode (unsound):** classifier output may *de-escalate*. `UNTRU...",
    "operational_effect": "With the invariant enforced, the failure mode converts from silent exfiltration into a bounded, observable refusal: the sink call raises a taint-lineage violation, the agent receives a structured error naming the offending span and its source tool, and the run halts or re-plans with the untrusted span quarantined. The cost is a higher false-positive rate—leg..."
  },
  "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": "11c01da226c266b3cdddefc34703c3c38ec4d5c56574dca6d56d1594cbb115a8",
    "verified_classes": [
      "Trust",
      "TaintLineageError",
      "Span",
      "TaintTracker"
    ],
    "verified_functions": [
      "run_turn",
      "__init__",
      "register_source",
      "derive",
      "_lineage_min",
      "enforce_sink"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TaintLineageError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
