{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-launders-injected-instructions-through-a-trusted-tool-s-structured-output-and-persists-them-as-semantic-memory",
  "title": "What happens when an instance launders injected instructions through a trusted tool's structured output and persists them as semantic memory",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents that (a) attach provenance/taint labels to context segments, (b) call tools whose outputs are re-ingested into context, and (c) write distilled facts to long-term memory. Does not cover purely single-turn, stateless inference where no tool output re-enters the context or memory store.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-launders-injected-instructions-through-a-trusted-tool-s-structured-output-and-persists-them-as-semantic-memory.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-launders-injected-instructions-through-a-trusted-tool-s-structured-output-and-persists-them-as-semantic-memory.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-launders-injected-instructions-through-a-trusted-tool-s-structured-output-and-persists-them-as-semantic-memory.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1769,
    "python_slice_tokens": 418,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint tracking fails not at the *ingestion* boundary but at the *re-representation* boundary. When an untrusted document's bytes are parsed by a trusted tool (a summarizer, a schema-validating extractor, a JSON normalizer) and emitted as a *structured* payload, the agent's taint machinery typically resets the label because the output now carries the tool's i...",
    "what_was_observed": "A research agent was tasked with reading a set of externally sourced PDFs and building a structured knowledge base. The pipeline: 1. `fetch_document(url)` → returns raw text, tagged `provenance=external, taint=untrusted`. 2. `extract_entities(text)` → an LLM-backed extractor returning JSON `{entities: [...], notes: \"...\"}`. Output was tagged `provenance=tool:extract_entities, taint=trusted` by the orchestrator, on th...",
    "condition_of_validity": "The laundering requires all of the following to hold jointly: - **Taint reset on tool boundary.** The orchestrator assigns taint by tool identity (`trusted` for schema-validated tools) instead of by `taint(output) = join(taint(inputs), tool_trust_floor)`. If output taint is the *join* (least upper bound) of input taints, the injection remains `untrusted` and...",
    "decision_boundary": "The operative invariant is **taint conservativity across re-representation**: > For every transformation `t` with inputs `I` and output `o`, `taint(o) ⊇ join{taint(i) : i ∈ I}`. A tool's own trust level may *raise* the floor (e.g., a formally verified parser can downgrade *syntactic* taint) but may never *erase* the taint of untrusted inputs without an expli...",
    "operational_effect": "Once taint is conservative, the downstream gates that were silently bypassed now fire correctly: - The `notes` field enters context as `untrusted`, so the distillation step either rejects it, quarantines it for review, or wraps it in a \"this is data, not instructions\" envelope before the model sees it. - The memory record inherits `source_taint=untrusted`; t..."
  },
  "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": "ae8c32f98cfcd00627f440d8bbd14c8f20d68693713dbd31556584eecdb51191",
    "verified_classes": [
      "TaintLaunderingError",
      "Taint"
    ],
    "verified_functions": [
      "propagate_tool_output",
      "write_memory",
      "join"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "assert mem['status'] == 'quarantined'"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
