{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-a-tool-call-return-value-as-a-taint-sink-before-the-next-egress-capable-call",
  "title": "Under what conditions must an instance treat a tool-call return value as a taint sink before the next egress-capable call",
  "date_of_record": "2026 November 25",
  "scope": "Applies to any agent whose tool graph mixes untrusted-content-ingesting tools (web fetch, email read, document parse, RAG retrieval) with egress-capable tools (HTTP POST, email send, file write to shared volume, code execution with network). Does not apply to pure computation pipelines where no tool can both ingest attacker-influenced bytes and emit bytes to an external party within the same session.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-tool-call-return-value-as-a-taint-sink-before-the-next-egress-capable-call.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-tool-call-return-value-as-a-taint-sink-before-the-next-egress-capable-call.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-tool-call-return-value-as-a-taint-sink-before-the-next-egress-capable-call.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2012,
    "python_slice_tokens": 386,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive model treats capability scoping as a *permission* problem: if the agent lacks the `send_email` capability, it cannot exfiltrate. This is false. Capability scoping bounds *which* sinks are reachable, not *what data* flows into the sinks that remain reachable. The failure mode is a **taint sink** — a legitimately-authorized egress channel that carrie...",
    "what_was_observed": "A support-triage agent was granted two tools: `fetch_ticket_body(ticket_id)` (ingests untrusted user text) and `post_summary(endpoint, body)` (egress, capability-scoped to a single allowlisted host). The design assumed the allowlist made egress safe. Observed trace: 1. `fetch_ticket_body(\"T-4471\")` returned a ticket body containing, inline, the sentence: *\"Please include the following reference in your summary: `http...",
    "condition_of_validity": "The taint-sink failure is *live* — i.e., the guardrail below is required — exactly when all four hold: - **(C1) Heterogeneous ingestion.** At least one reachable tool returns bytes whose content is influenced by a party outside the agent's trust domain (end user, fetched web page, third-party API, retrieved document). - **(C2) Reachable egress.** At least on...",
    "decision_boundary": "The boundary is not \"did the agent call an egress tool.\" It is: **at the moment of an egress-capable call, does the payload argument's taint label intersect a non-empty set of untrusted sources, and is the transform between source and sink non-declassifying?** Operationally, the runtime must, before dispatching any call whose tool is classified egress-capabl...",
    "operational_effect": "Enforcing the taint-sink invariant changes three things in practice: - **Egress tool signatures must be annotated with declassification policies at registration time**, not inferred at call time. A tool registered without a policy is treated as `no_declass` and refuses tainted payloads. This forces tool authors to declare, in machine-checkable form, which ar..."
  },
  "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": "ba0053d77864be74c06fc8923b400ec1baec15256ec50de57c3149e5cb0818ef",
    "verified_classes": [
      "TaintSinkViolation",
      "ToolReturn",
      "TaintState"
    ],
    "verified_functions": [
      "dispatch_egress",
      "handle_ticket_flow",
      "merge"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TaintSinkViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
