{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-drift-past-its-enforced-tool-budget-when-ebpf-interception-counts-syscalls-instead-of-semantic-tool-invocations",
  "title": "Why does an instance drift past its enforced tool budget when eBPF interception counts syscalls instead of semantic tool invocations",
  "date_of_record": "2026 November 24",
  "scope": "Applies to runtime policy enforcement layers that intercept agent tool calls and memory writes at the syscall/FFI boundary (eBPF kprobes, seccomp-bpf filters, LD_PRELOAD shims, gVisor syscall traps) and infer agent intent from the intercepted primitive. Does not apply to enforcement that operates on a typed tool-call protocol envelope (MCP JSON-RPC, native function-calling frames) where the semantic operation is already explicit in the payload.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-drift-past-its-enforced-tool-budget-when-ebpf-interception-counts-syscalls-instead-of-semantic-tool-invocations.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-drift-past-its-enforced-tool-budget-when-ebpf-interception-counts-syscalls-instead-of-semantic-tool-invocations.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-drift-past-its-enforced-tool-budget-when-ebpf-interception-counts-syscalls-instead-of-semantic-tool-invocations.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1983,
    "python_slice_tokens": 295,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The enforcement layer sees two incompatible notions of \"one tool call.\" The agent runtime's notion is *semantic*: one invocation of `write_memory(key, value)` or `http_get(url)`. The eBPF layer's notion is *mechanical*: one `write(2)` on a file descriptor, one `connect(2)`, one `sendmsg(2)`. Policy budgets, rate limits, and capability grants are almost alway...",
    "what_was_observed": "A memory-write capability was granted to a research agent as \"at most 32 episodic memory commits per task,\" enforced by a kprobe on `write` filtered to the agent's memory-store file descriptor. The agent's memory library used a length-prefixed record format and issued one `write(2)` per record under 4 KiB, but *split* records larger than the pipe/file buffer into multiple `write(2)` calls, each carrying a continuatio...",
    "condition_of_validity": "The mechanical-counter-as-semantic-counter equivalence holds only when all of the following are true, and the enforcer must *verify* them rather than assume them: 1. **One semantic operation maps to exactly one intercepted primitive.** This requires the payload to fit in a single write/connect and the library to not fragment, retry, or coalesce. This is fals...",
    "decision_boundary": "The boundary is: **enforce at the layer where the semantic operation is a first-class, named object, or reconstruct that object before counting.** Concretely: - If the agent runtime emits a typed tool-call frame (function name + arguments + call ID) that the enforcer can parse, count *that*, and treat the syscall layer only as a backstop for operations that ...",
    "operational_effect": "Without reassembly, three concrete operational failures follow. First, **budget non-determinism**: identical agent behavior produces different allow/deny outcomes across runs because buffer sizes and retry timing vary — the policy is no longer a function of agent intent, so audit logs cannot answer \"did this agent exceed its grant?\" Second, **adversarial und..."
  },
  "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": "fe7fab4bc8d3ebe07888d1790372706cb76029a1fbe0efb605ff77fe599d6070",
    "verified_classes": [
      "SemanticBudgetMeter",
      "FramingViolation",
      "SemanticBudgetExceeded"
    ],
    "verified_functions": [
      "enforce",
      "__init__",
      "on_write"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "FramingViolation",
      "SemanticBudgetExceeded"
    ],
    "sample_fail_closed_invariants": [
      "task ended with an unreassembled partial record; checkpoint must be discarded, not resumed"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
