Repository navigation
Description
Problem
budget_consumed is an array of {jti, consumed} records covering up to 20 recent grants. Walking through what an issuer actually does with them: in the steady re-authorization loop, the presented token's figure is the only new information. Every prior record duplicates an actual the issuer already holds — each was delivered when that token was retired. The gap cases (an agent that crashed holding a token, a resource token lost before reaching the PS) are made safe by conservative accounting (#unreported-allocations) and recoverable without the records: the PS has the usage endpoint, and an AS has out-of-band access to the resource's figures — it sits in the resource's trust domain.
The prior records also carry the design's two real costs. Up to a kilobyte rides inside the AAuth-Requirement header on the 401 path. And they are the privacy exposure the security considerations flag: the agent relays and reads records naming the person's other agents' tokens. The presented token's own spend exposes nothing — the agent watched cost and remaining in AAuth-Budget the whole time.
Proposal
Replace the array with a single claim: what the resource has metered to date against the auth token presented on the request this resource token answers. No list, no jti member. A figure for an unexpired token is a snapshot, superseded by a later report. Long-horizon and multi-grant history moves entirely to the usage endpoint, which already serves it.
Open question: attribution without a jti
The resource token does not name the presented auth token anywhere. presented_jti is the jti of the person token whose verification established ps and sub — on a step-up it is not the presented credential (the #95 rename exists because of exactly this), and it is load-bearing for mission-stripping detection, so it cannot be overloaded. Two options:
- Contextual attribution. The issuer matches the figure to its newest live allocation for
(sub, aud, mission_s256, agent_jkt). Ambiguous only while two allocations for one key overlap (the renewal window); an unattributable figure is discarded and the conservative rule stands, so ambiguity degrades safely. - Carry the auth token's
jtibeside the amount. Exact attribution, still one record rather than a list — but back to an object.
A third fact bears on the choice: the proactive path. An agent re-authorizing at the authorization endpoint before a 401 presents no auth token at all, so under either option the claim is absent there and the issuer's own channels cover it.
Context
Arose from working through the AS ledger in four-party access. The editor's copy currently holds the intermediate step — the presented token's record first in the array, plus (#unreported-allocations) — and this issue is whether to go the rest of the way. The question is also going to Regent Protocol, who run both sides in production.
Activity
dickhardt commentedon Sep 4, 2026
Resolution, in PR #133 (stacked on #128):
budget_consumedbecomes a single{jti, consumed}object for the auth token presented on the request the resource token answers. Thejtistays, for the reason Regent gave: an issuer holding several live allocations for one agent cannot attribute an amount alone, and attributing by agent key would make the conservative fallback the normal case for exactly the agents doing concurrent work. The per-key usage query answers what the sibling records used to.One thing working through the issuer's ledger added, which the array never stated: when a record is final. A record is as of the resource token's
iat. If that is at or after the auth token'sexp, it is the token's final figure and the issuer may release the difference. If the token was still live when the record was stated, it is a snapshot and releases nothing, because the agent can keep spending. That is theinsufficient-budgetcase: the spec leaves the old token spendable (retry a smaller request on it), so a record on that challenge cannot free the old token's remainder. An issuer that released on it would let the agent spend old remainder plus new allocation. A randomized simulation in the access module caught exactly this.Still worth confirming with Regent before this closes: whether their PS releases on a record for an unexpired token. Their public resource middleware (
regent-httpsig) leaves the old token fully spendable after a refusal, and the PS side is not published.Residual doubt, on the record: it costs little, but under the settlement model in #133 the issuer settles expired allocations from the usage reading in aggregate, so the record's value is that it arrives early and exact, not that it is necessary.
Budgets: one consumption record, the AS as usage caller, settlement
Budgets: one consumption record, the AS as usage caller, settlement (#…
dickhardt commentedon Sep 20, 2026
Done in the budgets editor's copy:
budget_consumedis a single consumption record for the auth token presented on the request the resource token answers, not an array of up to 20 grants. The open question resolved as option 2 — the record keepsjtibesideconsumed, so attribution is exact and long-horizon history lives at the usage endpoint. A resource MUST NOT include it withoutbudgetin the same token.