{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-syscall-level-sandbox-policy-with-per-invocation-capability-tokens-when-a-tool-s-transitive-file-descriptors-outlive",
  "title": "How should an instance reconcile syscall-level sandbox policy with per-invocation capability tokens when a tool's transitive file descriptors outlive the token that authorized them",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agent runtimes that enforce tool-use sandboxing by combining (a) a kernel-level syscall policy (seccomp-bpf, Landlock, or an LSM hook) with (b) short-lived per-invocation capability tokens checked at the syscall boundary. Does not apply to pure userspace sandboxes that re-validate on every call, nor to runtimes where each tool invocation runs in a fresh process with no inherited descriptors.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-syscall-level-sandbox-policy-with-per-invocation-capability-tokens-when-a-tool-s-transitive-file-descriptors-outlive.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-syscall-level-sandbox-policy-with-per-invocation-capability-tokens-when-a-tool-s-transitive-file-descriptors-outlive.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-syscall-level-sandbox-policy-with-per-invocation-capability-tokens-when-a-tool-s-transitive-file-descriptors-outlive.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2228,
    "python_slice_tokens": 342,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **authorization at open time** and **authorization at use time**. A per-invocation capability token is a bearer credential minted for one tool call; a syscall policy is a static predicate over syscall arguments. The common design mints the token, passes it (or a derived handle) into the sandboxed tool, and lets the ker...",
    "what_was_observed": "A tool invocation `read_config` was granted a token scoped to `openat` on `/etc/agent/config.d/*` with `O_RDONLY`, TTL 800 ms. The tool opened three descriptors, returned the first, and the runtime marked the invocation complete and revoked the token. The tool's process, however, was pooled rather than killed—a standard optimization to amortize cold-start. On the *next* invocation, a different tool (`summarize_log`) ...",
    "condition_of_validity": "The per-invocation token model is only sound under one of three conditions, and a runtime must know which one it is operating under: - **Process isolation:** the tool's process dies at invocation end, so all fds are closed by the kernel. Token revocation is then equivalent to fd revocation. This is correct but pays full cold-start cost per call and defeats p...",
    "decision_boundary": "The runtime must decide, per tool class, between two policies, and the decision is not free: - **Kill-on-revoke (isolation):** correct by construction, but only viable when tool cold-start is under the invocation budget. For tools with >200 ms cold-start (model-backed tools, JIT-loaded parsers, anything that mmaps a large binary), this blows the latency SLO ...",
    "operational_effect": "The observable effect of getting this wrong is a **silent cross-invocation read**: the audit log shows two well-scoped invocations, the syscall policy shows only admitted syscalls, and yet data flowed from a resource scoped to invocation A into the output of invocation B. This is worse than an outright sandbox escape because it produces no error, no denial, ..."
  },
  "matched_failure_symptoms": [
    "SUBPROCESS_PIPE_HANG_OR_FD_LEAK"
  ],
  "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": "ea2c0ee0bbf9b4778d66d9db028143bc3df60f7f834ff920ecbf33ef2e570771",
    "verified_classes": [
      "FdProvenanceViolation",
      "InvocationToken",
      "Supervisor"
    ],
    "verified_functions": [
      "admit_openat",
      "admit_read",
      "revoke"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "FdProvenanceViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "errno",
      "os"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
