{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-quarantines-a-tainted-tool-output-but-the-downstream-planner-has-already-committed-the-derived-subgoal-to-working-memory",
  "title": "What happens when an instance quarantines a tainted tool output but the downstream planner has already committed the derived subgoal to working memory",
  "date_of_record": "2026 November 28",
  "scope": "Applies to single- or multi-agent systems where tool outputs are labeled by an information-flow (taint) analyzer and quarantined before entering the agent's reasoning context. Does not apply to systems that sanitize at the tool boundary (pre-return) or that operate without persistent working memory across turns.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-quarantines-a-tainted-tool-output-but-the-downstream-planner-has-already-committed-the-derived-subgoal-to-working-memory.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-quarantines-a-tainted-tool-output-but-the-downstream-planner-has-already-committed-the-derived-subgoal-to-working-memory.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-quarantines-a-tainted-tool-output-but-the-downstream-planner-has-already-committed-the-derived-subgoal-to-working-memory.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1671,
    "python_slice_tokens": 332,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint-aware sandboxing is usually described as a gate at the *tool return* boundary: an output is scanned, labeled `tainted` (e.g., because it carries untrusted instructions, cross-tenant data, or content from an unprivileged source), and is withheld from the model. This framing is correct but incomplete. The dangerous boundary is not the tool return — it is...",
    "what_was_observed": "Trace from a retrieval agent handling a customer-support ticket. Task: \"Summarize the refund policy exception for order 4471 and draft a reply.\" 1. Turn 4: planner emits `subgoal: fetch_policy_exception(order=4471)` and, in the same generation, speculatively writes `assumed_fact: \"exception window is 45 days per policy-doc-9\"` into working memory, tagged `source=pending:tool_call_17`. 2. Turn 5: `fetch_policy_excepti...",
    "condition_of_validity": "The invariant that must hold is **taint closure over the derivation graph**: for any working-memory item `m` whose `source` chain includes a quarantined artifact `a`, `m` must itself be marked `tainted:derived` and excluded from planner reads until re-derived from an untainted source. This holds only if: - every speculative write carries an explicit `source=...",
    "decision_boundary": "The operator must decide, at quarantine time, between three dispositions, and the choice is not free: - **Rollback-and-rederive:** invalidate all `source=pending:<call_id>` items, force the planner to re-plan from the last untainted checkpoint. Correct, but expensive: it discards valid work done in parallel with the quarantined call. Use when the derived sub...",
    "operational_effect": "Systems that implement return-boundary-only quarantine exhibit a characteristic signature: high task completion rate, low auditor-resolvable citation rate, and a specific class of \"confident but unsourced\" answers where the cited artifact is `QUARANTINED` in the same trace. The failure is not detectable by injection scanners (no injection is present in conte..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "f01e44f2d8c7d654d9990de2fabb326b799fff05fbc72b3bd9b307204643a3e2",
    "verified_classes": [
      "TaintState",
      "DerivedFromQuarantineError",
      "MemoryItem",
      "ProvenanceGraph"
    ],
    "verified_functions": [
      "quarantine",
      "commit_action"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "DerivedFromQuarantineError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
