{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-tainted-context-egress-from-silently-widening-capability-scope-across-a-sandboxed-tool-chain",
  "title": "Which invariants prevent tainted-context egress from silently widening capability scope across a sandboxed tool chain",
  "date_of_record": "2026 December 3",
  "scope": "Applies to LLM agents that execute tool calls inside a sandbox where each tool carries a capability scope (allowed egress destinations, filesystem roots, secret handles) and where taint labels propagate from untrusted inputs (retrieved documents, tool-returned text, peer-agent messages). Does not apply to single-turn, stateless function-calling with no cross-call state, nor to sandboxes where every tool shares one undifferentiated privilege level.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-context-egress-from-silently-widening-capability-scope-across-a-sandboxed-tool-chain.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-context-egress-from-silently-widening-capability-scope-across-a-sandboxed-tool-chain.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-context-egress-from-silently-widening-capability-scope-across-a-sandboxed-tool-chain.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1925,
    "python_slice_tokens": 367,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The boundary that fails is not \"did taint get detected.\" It is the distinction between **taint propagation across a value** and **capability propagation across a call boundary**. Most taint-tracking implementations label the *data* that flows into the model's context, then check whether that data appears in an egress payload. That check is a *content* check....",
    "what_was_observed": "Trace of a three-tool chain, all under a single sandbox session with a per-session capability token: 1. `fetch_doc(url)` — capability scope `net:read:docs.corp.example`. Returns a document body containing an embedded instruction-like string and, critically, a *resource identifier* (`bucket=reports-prod, key=Q2/forecast.csv`). The returned text is labeled `taint=external`. 2. The model, reasoning over the tainted text...",
    "condition_of_validity": "The invariant **scope monotonicity under taint** holds only when all of the following are enforced simultaneously: - **Taint is a property of the session's derived-value graph, not of individual strings.** A derived value (model-authored summary, reformatted table, computed aggregate) inherits the join of the taint labels of all inputs that contributed to it...",
    "decision_boundary": "The operational decision is not \"block tainted egress.\" That is too coarse — it breaks the legitimate summarize-an-external-doc workflow. The boundary is: - **Allow** an egress call when `egress_scope ⊆ pre_taint_scope` (the destination was reachable before any taint was acquired). Tainted paraphrase to an already-reachable internal sink is within the origin...",
    "operational_effect": "Enforcing scope monotonicity under taint changes three things in practice: 1. **Egress sinks become taint-aware endpoints.** A summarizer that accepts model-authored bodies must declare whether it accepts externally-derived content. If it does not, the capability token's taint claim causes the sandbox to reject the call before the body is even serialized — t..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "6545487e1999a7e5c504308dfab67e12f97cb7884550a52522a2f058781df8d0",
    "verified_classes": [
      "TaintScopeViolation",
      "CapabilityToken",
      "DerivationGraph"
    ],
    "verified_functions": [
      "authorize_egress",
      "run_chain",
      "labels_for"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TaintScopeViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
