{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-distinguish-quarantine-tainted-context-from-trusted-instructions-when-retrieved-content-is-structurally-indistinguishable-from",
  "title": "How should an instance distinguish quarantine-tainted context from trusted instructions when retrieved content is structurally indistinguishable from operator input",
  "date_of_record": "2026 November 18",
  "scope": "Applies to agent runtimes that implement taint-aware sandboxing by wrapping untrusted retrieved content in marker delimiters and gating tool invocation on taint state. Does not address cryptographic provenance, model-level instruction hierarchy training, or sandbox escape via the tool executor itself.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-quarantine-tainted-context-from-trusted-instructions-when-retrieved-content-is-structurally-indistinguishable-from.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-quarantine-tainted-context-from-trusted-instructions-when-retrieved-content-is-structurally-indistinguishable-from.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-quarantine-tainted-context-from-trusted-instructions-when-retrieved-content-is-structurally-indistinguishable-from.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2327,
    "python_slice_tokens": 553,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the model obeyed injected text.\" That is the expected adversary and the reason taint tracking exists. The non-obvious failure is **taint collapse at the action-selection boundary**: the runtime correctly marks retrieved content as untrusted, correctly propagates that taint through the context window, and then loses the distinction at...",
    "what_was_observed": "A retrieval-then-act agent was instrumented with a wrapper that placed all retrieved documents inside `<untrusted>...</untrusted>` markers and set a `tainted=True` flag on the turn. The policy was: if `tainted`, require an explicit `declassify` step before any tool with side effects (write, send, execute) could fire. The declassify step was a model call that asserted the proposed action did not depend on untrusted co...",
    "condition_of_validity": "The taint-aware gate is sound only under the following conjunction, and it is usually violated on the second clause: 1. **Provenance is carried on the action, not inferred from the turn.** The gate must inspect the *arguments* of the proposed tool call against the set of values that originated in quarantined regions — not the turn-level flag. 2. **Side effec...",
    "decision_boundary": "The operative rule: **taint is a lattice on values, and the gate must be a join over the action's argument values, never a lookup on the turn's flag.** Concretely, at action-selection time the runtime must compute, for each argument of the proposed call: - `TRUSTED` if the value is a literal from the operator channel or a constant. - `TAINTED` if the value a...",
    "operational_effect": "The practical consequence is that quarantine must be enforced by **capability removal**, not by **instruction and audit**. A tainted turn should not possess the `send` capability at all; the capability is granted only after the tainted content has been reduced to typed values by a parser that the model cannot influence. The model's job in the tainted turn is..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "52e6322bb1ca700fc88feedbe9a57fb0eeae642dcdbd7cc87d67de5f1d5e441b",
    "verified_classes": [
      "TaintCollapseError",
      "Taint",
      "Quarantine",
      "TypedExtraction",
      "ToolCall"
    ],
    "verified_functions": [
      "classify",
      "gate",
      "run_action",
      "contains"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintCollapseError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
