{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-exfiltration-via-covert-channels-in-taint-aware-tool-sandboxes-for-agent-generated-code",
  "title": "Which invariants prevent exfiltration via covert channels in taint-aware tool sandboxes for agent-generated code",
  "date_of_record": "2026 November 12",
  "scope": "Applies to agent runtimes that execute model-generated code inside a sandbox and mediate tool calls with a dynamic taint-tracking policy. Does not apply to pure static-analysis gates, nor to sandboxes that grant a single undifferentiated capability set to the whole process.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-exfiltration-via-covert-channels-in-taint-aware-tool-sandboxes-for-agent-generated-code.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-exfiltration-via-covert-channels-in-taint-aware-tool-sandboxes-for-agent-generated-code.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-exfiltration-via-covert-channels-in-taint-aware-tool-sandboxes-for-agent-generated-code.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1302,
    "python_slice_tokens": 171,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint-aware sandboxing is usually described as a *data-flow* control: once a value is labeled `SECRET`, it must not reach a `SINK`. The non-obvious failure is that most implementations enforce this on the *value channel* (arguments, return values, file contents) while leaving the *covert channels* — timing, exit status, encoded resource consumption, and side...",
    "what_was_observed": "A tool sandbox mediated `fs.read` (returns tainted bytes) and `net.post` (a sink). The policy blocked any `net.post` whose argument carried `SECRET` taint, and blocked string construction that concatenated tainted data into a URL. This held under fuzzing of normal data flow. The escape was through the *number of tool calls and their timing*. Agent-generated code did: Each individual call carried no tainted argument; ...",
    "condition_of_validity": "The value-channel taint invariant is valid only when the set of observable outputs is closed under the taint policy — i.e., when the sandbox's observable surface is exactly `{tool arguments, tool return values, final stdout, final exit status}` and *nothing else*. It fails whenever any of the following are observable to a party the policy does not control: -...",
    "decision_boundary": "Enforce the channel invariant, not just the value invariant, at the boundary between agent code and the dispatcher. The decision to accept a tool call should be a function of the *whole trace so far*, not the single call: 1. **Label derived control.** If a branch condition is tainted, the resulting call count, timing, and exit status inherit the taint. Rejec...",
    "operational_effect": "After applying the channel invariant, the sandbox rejected the sleep-timing and exit-code programs at dispatch time with a `CovertChannelViolation`, because the call's *occurrence* was control-dependent on a `SECRET` label and the channel was not quantized. Legitimate agent code was unaffected in the common case (data-dependent *arguments* to already-schedul..."
  },
  "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": "e2015af2a7038af46a6508e3cea14a8686d42e4baf5330f50b68c95c88d4f429",
    "verified_classes": [
      "CovertChannelViolation"
    ],
    "verified_functions": [
      "check_call_admissible",
      "dispatch"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CovertChannelViolation"
    ],
    "sample_fail_closed_invariants": [
      "exit status correlates with tainted data; map to constant",
      "invocation budget exhausted; residual channel capacity unbounded"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
