{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-enforce-taint-quarantine-invariants-when-untrusted-context-re-enters-a-sandbox-after-privileged-action-pre-authorization",
  "title": "How should an instance enforce taint-quarantine invariants when untrusted context re-enters a sandbox after privileged action pre-authorization",
  "date_of_record": "2026 November 21",
  "scope": "Applies to single-instance agents that pre-authorize a privileged tool call (write, exec, network egress, credential use) against a tainted-context snapshot, then continue reasoning before the call fires. Does not apply to stateless one-shot tool invocations where taint classification and execution happen in the same turn with no intervening reasoning step.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-enforce-taint-quarantine-invariants-when-untrusted-context-re-enters-a-sandbox-after-privileged-action-pre-authorization.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-enforce-taint-quarantine-invariants-when-untrusted-context-re-enters-a-sandbox-after-privileged-action-pre-authorization.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-enforce-taint-quarantine-invariants-when-untrusted-context-re-enters-a-sandbox-after-privileged-action-pre-authorization.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2435,
    "python_slice_tokens": 683,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"untrusted text reached the model.\" That is expected and survivable. The failure is **taint-label divergence between the authorization snapshot and the execution snapshot**: the agent classifies context as trusted, obtains a warrant for a privileged action, and then performs additional reasoning steps during which tainted content is re-ing...",
    "what_was_observed": "A coding agent was issued a task: \"summarize the ticket, then commit the fix to `auth/session.py`.\" The commit tool is privileged and gated behind a pre-authorization check: the agent must produce a `Warrant` whose `context_digest` matches the digest of the context window at the moment `commit` is invoked. Trace: 1. Turn 1: agent reads the ticket body from an untrusted source (customer-submitted text). Taint classifi...",
    "condition_of_validity": "The quarantine invariant holds only if all four of the following are true simultaneously. If any is false, the boundary is open: 1. **Taint is inherited, not re-derived.** Any span generated by the model while a tainted span is in its receptive field must be labeled `DERIVED_UNTRUSTED` and carry a back-pointer to the source span. A summary of a tainted ticke...",
    "decision_boundary": "When the agent detects that `H(current_context) ≠ warrant.context_digest`, it has exactly two correct behaviors and several incorrect ones. Correct: - **Void and re-authorize.** Discard the warrant, re-run taint classification over the current context (which will surface the re-entered tainted span via the `source_id` registry), and route to quarantine: stri...",
    "operational_effect": "The practical consequence is that taint-aware sandboxing must be implemented as a **two-phase commit over context lineage**, not as a gate at the tool boundary. The tool boundary is the wrong place because by the time control reaches it, the model has already been conditioned on whatever re-entered. The gate must sit at: - **Generation:** every model output ..."
  },
  "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": "a88c67c092491c75a89a0558f09c115da64f3a7cd75823ee2180eff4f8c10b92",
    "verified_classes": [
      "WarrantContextMismatch",
      "Span",
      "TaintRegistry",
      "Warrant",
      "Sandbox"
    ],
    "verified_functions": [
      "_digest",
      "reproduce",
      "observe",
      "__init__",
      "ingest",
      "generate",
      "authorize",
      "execute"
    ],
    "verified_functions_count": 8,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "WarrantContextMismatch"
    ],
    "sample_fail_closed_invariants": [
      "warrant already consumed",
      "context digest changed between authorization and execution; tainted span likely re-entered via retrieval or handoff",
      "reproduced: warrant issued at H(ctx_3), fired at H(ctx_4)"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
