{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-s-ebpf-tool-hook-policy-is-keyed-on-process-identity-but-the-agent-runtime-multiplexes-concurrent-tool-calls-through-one",
  "title": "What happens when an instance's eBPF tool-hook policy is keyed on process identity but the agent runtime multiplexes concurrent tool calls through one long-lived worker",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agent runtimes that enforce per-invocation tool and egress policy via kernel-level hooks (eBPF/LSM on `execve`, `connect`, `sendmsg`) keyed on PID/TGID or cgroup identity, where a single worker process services multiple concurrent agent invocations. Does not apply to runtimes that fork one process per tool call or that enforce policy purely in userspace at the dispatch layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-s-ebpf-tool-hook-policy-is-keyed-on-process-identity-but-the-agent-runtime-multiplexes-concurrent-tool-calls-through-one.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-s-ebpf-tool-hook-policy-is-keyed-on-process-identity-but-the-agent-runtime-multiplexes-concurrent-tool-calls-through-one.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-s-ebpf-tool-hook-policy-is-keyed-on-process-identity-but-the-agent-runtime-multiplexes-concurrent-tool-calls-through-one.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2019,
    "python_slice_tokens": 353,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct things an enforcement hook can be keyed on: the *invocation* (the logical agent task with its own warrant, capability set, and egress allowlist) and the *execution context* (the OS-level process, thread, or cgroup that the kernel actually sees). eBPF hooks only see the execution context. When the runtime maps many invocations onto one ...",
    "what_was_observed": "A runtime enforced egress allowlists per invocation by writing a BPF map entry keyed on `pid` at invocation start and deleting it at invocation end. The hook on `connect()` looked up `bpf_get_current_pid_tgid() >> 32` and consulted the entry's allowlist. Under single-invocation load this behaved correctly for thousands of calls. Under concurrency, three distinct anomalies appeared: 1. **Cross-invocation egress leakag...",
    "condition_of_validity": "The per-PID keying invariant holds only when the following conjunction is true: - **Injectivity:** at most one live invocation is bound to any PID/TGID at any instant (one-process-per-invocation, or a worker that is exclusively leased for the invocation's duration). - **Atomic bind/unbind:** the map entry is written before the first tool call and removed bef...",
    "decision_boundary": "The architectural choice is between two enforcement substrates, and the boundary is sharp: - **If the runtime multiplexes invocations onto shared workers**, the hook key *must* be an invocation-scoped identifier that the kernel can recover at syscall time. In practice this means either (a) a per-invocation cgroup or `BPF` cookie propagated via a thread-local...",
    "operational_effect": "The practical consequences are: - **Audit integrity is lost before enforcement integrity is.** Even when the hook's decision happens to match the correct invocation's policy (because the policies coincided), the *attribution* is wrong. Forensic replay of the audit log reconstructs a history that did not happen. This is worse than a plain denial because it co..."
  },
  "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": "5543398370fe75e3e642473253f2e22f9f601a147764e492f73b68b7cfba9c20",
    "verified_classes": [
      "EgressWarrantAliasingError",
      "InvocationWarrant"
    ],
    "verified_functions": [
      "bind_worker_to_invocation",
      "authorize_egress",
      "unbind_worker",
      "__init__"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "EgressWarrantAliasingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
