{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-taint-propagation-as-a-session-scoped-invariant-rather-than-a-process-scoped-one",
  "title": "Under what conditions must an instance treat taint propagation as a session-scoped invariant rather than a process-scoped one",
  "date_of_record": "2026 November 18",
  "scope": "Applies to taint-tracking memory isolation systems where tainted (untrusted-origin) data can enter an agent's working memory and where sessions are multiplexed over a shared process pool. Does not apply to single-session, single-tenant processes where session teardown coincides with process exit, nor to systems where all memory is treated as tainted by default.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-taint-propagation-as-a-session-scoped-invariant-rather-than-a-process-scoped-one.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-taint-propagation-as-a-session-scoped-invariant-rather-than-a-process-scoped-one.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-taint-propagation-as-a-session-scoped-invariant-rather-than-a-process-scoped-one.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1679,
    "python_slice_tokens": 405,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious boundary is the difference between **taint as a property of a memory cell** and **taint as a property of a memory lineage that spans session lifetimes**. Most taint engines implement the former: a byte in the heap carries a shadow bit, and the bit is cleared when the cell is freed or overwritten. This is correct for preventing *immediate* inj...",
    "what_was_observed": "In a multi-tenant agent runtime with per-session taint labels, an injected instruction string placed in a tool-result buffer during session A was observed to influence tool selection in session B, which was assigned the same worker thread. The taint engine reported zero tainted bytes at session B start. Investigation showed: 1. Session A's tool-result buffer was freed at teardown; its shadow bits were cleared correct...",
    "condition_of_validity": "The session-scoped invariant holds only when all three of the following are true: - **Allocator zeroing on reuse is guaranteed**, or the taint map is keyed by *page* rather than by *allocation*, so that a reused page inherits the union of taints of everything ever written to it until it is explicitly sanitized. - **Session teardown performs a memory sanitiza...",
    "decision_boundary": "An operator must escalate from session-scoped to page-scoped taint tracking when **any** of the following is observed: - Worker threads are reused across sessions without a full sanitization pass (the common case for performance). - The allocator is a slab or size-class allocator that does not zero on reuse (jemalloc, tcmalloc, and most arena allocators by d...",
    "operational_effect": "The practical consequence is that taint isolation must be enforced at **two layers with independent lifetimes**: the shadow map (allocation lifetime) and a page-generation counter (page lifetime). On every session boundary, the runtime must either bump the page generation for all pages the session touched — invalidating any allocation that reuses them until ..."
  },
  "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": "cb38c49538b948e5d0f5fbd1bf4c495a0eac9a1c8abd8be0538ffecc153cb038",
    "verified_classes": [
      "CrossSessionTaintPersistenceError",
      "Page",
      "Allocator"
    ],
    "verified_functions": [
      "run_worker_cycle",
      "page_for",
      "mark_tainted",
      "sanitize",
      "end_session",
      "allocate"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CrossSessionTaintPersistenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
