# Shared-budget ledger for parallel agent workers

**Version:** 1.0
**Last updated:** 2026-11-24
**Source:** KLA Digital (kla.digital/blog/shared-spending-controls-parallel-agents)

---

## About this ledger

Use this ledger when several AI agent workers draw on one allowance and their calls finish, fail or
settle at different times. It keeps four states apart: the estimated cost of an operation, the
allowance reserved for it, the external request that was dispatched, and the charge finally
settled. It gives calls whose outcome is still unknown their own place in the balance.

Research date: 26 October 2026. The ledger is an editorial design walkthrough informed by these
preprints, read at the versions listed:

- BudgetPM, v3 (first submitted 29 September 2026, revised 16 October 2026):
  https://arxiv.org/html/2609.37125v3
- BAGEN, v1 (29 May 2026): https://arxiv.org/html/2606.00198v1; code at commit `54df9bf`:
  https://github.com/mll-lab-nu/BAGEN/tree/54df9bfe54218f933563a8920575e334d7236d4a; dataset at
  revision `5818957`:
  https://huggingface.co/datasets/MLL-Lab/BAGEN/tree/58189576e54b675fdd0e1d6c1c9f189c2992732f
- Token Budgets, v1 (2 June 2026): https://arxiv.org/html/2606.04056v1. Its linked implementation
  repository returned a 404 on 26 October 2026.
- AgentTime, v2 (first posted 7 October 2026, revised 8 October 2026):
  https://arxiv.org/html/2610.09944v2
- Mixed human and agent team cost simulation, v1 (14 October 2026):
  https://arxiv.org/html/2610.20394v1

Assumptions behind the worked example:

- One authority serialises reservations for the shared allocation.
- Each dispatched operation costs at most its reservation.
- Each authoritative settlement is final.
- Every paid operation passes through the authority.
- Operation identifiers survive restarts.

A provider or integration that breaks any of these assumptions needs additional controls.

Limits: the units are synthetic and the arithmetic was worked by hand. No execution system,
provider cancellation, provider billing or monetary cap was tested. BudgetPM's main temporal
experiments count queries at unit cost, so its results do not establish behaviour under monetary
billing. The reported results of every paper above are the authors' own and were not reproduced.
This is a proposed operational record. It is not a validated accounting implementation.

## Spending checks

Answer these before trusting a budget figure:

| Check | Question |
| --- | --- |
| Unit | Does every budget and every figure name its unit: tokens, query count, priced estimate or settled currency amount? |
| Estimate, reservation, settlement | Are estimated cost, reserved allowance and settled charges recorded as separate quantities? |
| Unresolved calls | Does the available balance exclude every dispatched call whose charge is still unknown? |
| Conservation | Does available + unresolved reservations + settled charges equal the allocation, adjusted for explicit top-ups and refunds? |
| Idempotency | Does a stable operation identifier stop a duplicate receipt from debiting or refunding twice? |
| Lease expiry | Is expiry of a worker's permission to dispatch kept separate from settlement of work it already submitted? |
| Allocation and accounting | Are allocation quality (useful work preserved) and accounting correctness (balance right after failures) evaluated separately? |
| Correlated samples | When cost estimates are evaluated on recorded trajectories, are several prefixes of one rollout grouped as one task? |
| Sample selection | Is a sample chosen for convenience, such as small file size, labelled as non-random and unrepresentative? |
| Invoice reconciliation | Who reconciles counted or priced usage with the provider invoice, and when? |

## Ledger header

| Field | Record |
| --- | --- |
| Ledger owner and reviewer | |
| Workflow, tenant and environment | |
| Allocation identifier | |
| Unit and pricing source (tokens, queries, priced estimate or currency) | |
| Initial allocation | |
| Top-ups and refunds, with authority and time | |
| Authority that serialises reservations | |
| Workers sharing the allocation | |
| Provider receipts treated as final, and their source | |
| Cancellation behaviour confirmed for each provider | |
| Reconciliation owner and schedule | |

## Operation record

One row per operation. Keep the operation identifier stable across restarts and retries.

| Field | Record |
| --- | --- |
| Operation identifier | |
| Worker and lease identifier | |
| Estimated cost and estimator | |
| Reservation amount and time | |
| Admission decision and reason | |
| Dispatch time and external request identifier | |
| Outcome state: reserved, dispatched, uncertain, settled, released | |
| Receipts received, with source and time | |
| Settled amount and time | |
| Released amount and time | |
| Duplicate or late messages and how they were resolved | |
| Evidence that an undispatched reservation can no longer dispatch | |

## Balance log

Record the three quantities after every event. Their sum stays equal to the allocation, adjusted for
explicit top-ups and refunds.

| Event | Available | Reserved | Settled | Admission and accounting decision |
| --- | ---: | ---: | ---: | --- |
| | | | | |

## Worked example (synthetic)

Initial allocation is 100 synthetic units. The conservation relation is
`available + unresolved reservations + settled charges = 100`.

| Event | Available | Reserved | Settled | Admission and accounting decision |
| --- | ---: | ---: | ---: | --- |
| Start | 100 | 0 | 0 | Workers A and B share one allocation |
| A requests 60; authority reserves operation A1 | 40 | 60 | 0 | Admit A1 |
| B requests 60 | 40 | 60 | 0 | Refuse for insufficient available capacity |
| A dispatches A1 | 40 | 60 | 0 | Record external request identifier |
| A times out after dispatch | 40 | 60 | 0 | Mark outcome uncertain; retain reservation |
| A's lease expires | 40 | 60 | 0 | Prevent new dispatch under that lease; existing charge remains unresolved |
| Final authoritative receipt for A1 reports 35 | 65 | 0 | 35 | Settle 35 and release the unused 25 atomically |
| Duplicate receipt for A1 reports 35 again | 65 | 0 | 35 | Stable operation ID prevents another debit or refund |
| B retries; authority reserves B1 for 60 | 5 | 60 | 35 | Admit B1 |
| B cancels before dispatch is possible | 65 | 0 | 35 | Release B1 only after proving it cannot still dispatch |

The timeout row is the critical ambiguity. Releasing A1 at that point would allow another 60-unit
reservation while A1 could still incur up to 60. Serial admission and conservative per-worker
allocations are alternative baselines. Measure them for useful work and latency under the same
assumptions.

## Testing an implementation

An implementation experiment should give every policy the same tasks, initial capacity and
accounting rules, and compare atomic shared reservation with a serial queue and fixed per-worker
allocations. A racy read-then-write counter can serve as a negative control.

- Scenarios: concurrent requests exceeding capacity, crash before dispatch, timeout after dispatch,
  delayed usage, duplicate confirmation, ambiguous retry, stale lease reuse, process restart and
  storage failure.
- Measures: completed work, overdraw under the stated assumptions, affordable requests refused,
  stranded reserved capacity and reconciliation delay.
- Provider integration: establish what a final receipt means and whether cancellation stops
  charging. Treat provider invoice reconciliation as a separate evidence stage.

This experiment has not been built or run.

## Public-data note: BAGEN estimation files

On 26 October 2026 we downloaded the BAGEN dataset manifest at revision `5818957` and the two
smallest estimation-pair files by declared size. The sample was chosen for small download size. It
is neither random nor representative and supports no model ranking.

| Observation | First file | Second file |
| --- | ---: | ---: |
| Size in bytes, matching the manifest | 873,328 | 963,174 |
| Prefix records | 85 | 87 |
| Rollout indices in the file | 83 | 66 |
| Rollouts with one prefix / with two | 81 / 2 | 45 / 21 |
| Rows carrying request-token usage | 85 | 0 |
| Rows where completed-turn usage sums to the cumulative total | 85 | 87 |

The manifest lists 445 unique paths (393 origin, 52 estimation). Rollout indices are scoped to each
file. These checks describe data shape and arithmetic only. They do not validate the original token
measurements, model performance, provider charges or reservation enforcement.
