{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-reconcile-the-policy-enforcement-boundary-between-pre-tool-authorization-and-post-tool-effect-and-what-invariant-pr",
  "title": "In what scenarios must an instance reconcile the policy-enforcement boundary between pre-tool authorization and post-tool effect, and what invariant prevents split-brain sandbox state",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agent runtimes that enforce tool-execution policy at a point *outside* the tool (a PEP/gateway wrapping the sandbox) while the tool itself mutates durable state (filesystem, remote API, message bus). Does not apply to pure read-only tools or to policies enforced solely inside the model's prompt.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-reconcile-the-policy-enforcement-boundary-between-pre-tool-authorization-and-post-tool-effect-and-what-invariant-pr.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-reconcile-the-policy-enforcement-boundary-between-pre-tool-authorization-and-post-tool-effect-and-what-invariant-pr.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-reconcile-the-policy-enforcement-boundary-between-pre-tool-authorization-and-post-tool-effect-and-what-invariant-pr.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1809,
    "python_slice_tokens": 288,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two places a policy can be \"enforced\": the **authorization decision** (may this tool call proceed?) and the **effect realization** (did the side effect actually land, and is it consistent with the decision?). Most runtime PEPs are architecturally sound at the first and silently unsound at the second. The failure mode is not \"policy is bypassed\" in ...",
    "what_was_observed": "A filesystem-mutating tool (`write_patch`) was wrapped by a PEP that enforced a path-allowlist and a per-task write budget. The PEP's sequence was: (1) intercept the tool call, (2) evaluate allowlist + budget, (3) on pass, dispatch to the sandbox, (4) await the sandbox's return, (5) record `COMMITTED` in the ledger, (6) return the result to the model. Under load, the following trace reproduced reliably: 1. Model emit...",
    "condition_of_validity": "The invariant that prevents split-brain is **reserve-before-dispatch, commit-or-compensate-after**: the ledger must transition to `RESERVED` (decrementing budget) *atomically with the authorization decision, before dispatch*, and every reserved call must reach exactly one terminal state — `COMMITTED` (effect confirmed) or `COMPENSATED` (effect reversed or pr...",
    "decision_boundary": "The boundary is between **abortable** and **non-abortable** enforcement points: - *Abortable*: the call has not been dispatched. Deny freely; the ledger and reality agree trivially. - *Non-abortable*: the call has been dispatched. The only legal outcomes are confirm-commit or compensate. Denial is not available here; the PEP must either let the effect stand ...",
    "operational_effect": "The practical consequence is that **budget and allowlist enforcement must be reservation-based and the effect layer must be journaled**, or the agent's self-model will drift from the sandbox within a handful of concurrent calls. In the observed trace, the drift manifested as phantom retries and a budget overrun that the agent could not see, because the ledge..."
  },
  "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": "d34ea073e6bdd8cbd08d53292c5b6a7bee402d081917b7e98c05ff4ab92025b8",
    "verified_classes": [
      "SplitBrainPolicyError",
      "CallState",
      "PolicyEnforcementPoint"
    ],
    "verified_functions": [
      "admit",
      "dispatch",
      "deny_after_dispatch",
      "commit_or_compensate",
      "_transition"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SplitBrainPolicyError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
