Skip to content

Settlement of a revoked auth token: is revocation an early exp? #151

Closed

Description

@dickhardt

Problem

(#settlement) keys finality strictly on exp: a record is final when its resource token was issued at or after the auth token's exp, and a usage reading settles an allocation once its exp is at or before as_of. Revocation appears in (#token-scope) as a control — the budget ends with the token, committed consumption is unaffected, an in-flight request completes — but not in (#settlement) at all. So a revoked token's remainder stays reserved until exp, even though the token can start no new spend.

An issuer that wants its money back early therefore has exactly one lever today: short TTLs. A production deployment asked the sharper question: is revoke-then-settle intended — revoke at a checkpoint and treat the record in hand as final — or does a revoked token still owe a post-exp figure?

The checkpoint record cannot simply become final: requests in flight at revocation complete after it, so the snapshot can undercount. And the revocation response cannot carry the figure — it is deliberately an empty 200 that does not vary with what the recipient holds (base protocol, Token Revocation).

Suggested direction

Treat revocation as an early exp, with the drain made the resource's obligation on the record channel:

  1. Record channel. A resource MUST NOT issue a consumption record for a revoked token until the requests in flight at revocation have settled. A record the resource issues after recording the revocation is then final, and the issuer can verify that ordering itself — it made the revocation call, so iat at or after its own call is checkable, mirroring the iat-vs-exp arithmetic (#settlement) already uses.
  2. Reading channel. A reading settles a revoked allocation once as_of is at or after the revocation — subject to the same drain caveat, which the reading cannot express. Either accept the in-flight race there (the unsafe direction: it releases early) or leave readings on exp semantics and let early settlement be a record-channel property only.

Option 2's second branch is the conservative one: revocation accelerates settlement only where a resource-signed record attests the drain, and readings stay as specified.

Context

Raised by Regent Protocol from production (get4agent.com): they would rather revoke at a checkpoint than run short TTLs, and asked whether the spec means revocation that way. They found the settle-on-snapshot behavior as a bug in their own settlement path while adopting (#settlement), which is what surfaced the question.

Activity

  1. added
    budgets
    on Sep 8, 2026
  2. dickhardt commented on Sep 8, 2026

    @dickhardt
    OwnerAuthor

    What the rule buys, and its precondition:

    Buys: TTL stops being the only bound on dead-reserved capital. With revocation as both the spend stop and (post-drain) the settlement trigger, an issuer can issue at the protocol's one-hour cap and reclaim the remainder the moment a checkpoint looks wrong, instead of running minutes-short tokens. This is the answer to the short-TTL-vs-revoke trade the production question posed.

    Precondition: the resource must expose a revocation endpoint, which is MAY in the base protocol. An issuer should size TTL by whether it holds a revocation path to that resource — revocation path, TTL at the cap; none, short TTL remains the only lever. Worth a sentence in the resolution.

    Kept in view: expiry was doing two jobs — bounding the reservation and forcing the agent back to the PS. Revocation takes over only the first. An issuer running long TTLs takes its supervision from allocation sizing (exhaustion still forces the return) and from usage readings between re-authorizations, revoking on anomaly.

  3. abay94 commented on Sep 8, 2026

    @abay94
    Contributor

    Implementer's view from the meter side (regent-httpsig / get4agent.com). Context first: until this morning our marketplace exposed no revocation endpoint and our envelope path did not consult agent revocation, so a revoked agent's live envelope spent until exp. Both shipped today (regent-httpsig 0.6.0, get4agent.com), with the drain rule below, which is why its exact shape matters to us.

    Drain, as our meter runs it. A reservation is held per in-flight request and resolved on commit or release; an unresolved reservation counts as consumed once its timeout passes. Revocation fits directly: mark the jti revoked, refuse new reservations, and the token is drained when no reservation remains outstanding. The drain is therefore bounded by the resource's reservation timeout, and I'd suggest the resolution say so: a resource MUST issue the record no later than its reservation timeout after revocation, with unresolved in-flight requests counted as consumed. Without that bound the issuer has no worst case to wait for.

    Record channel. Agreed that a record issued after the revocation is final and verifiable by iat. On our side a revoked token presented at the resource gets the same challenge an expired one does, with the final record on the resource token once the drain is complete; while a request is still in flight the challenge carries no record.

    The carrier problem. After revocation the record still travels through the agent, and revocation is most often applied to an agent that is compromised or gone. When the whole agent is revoked, the usage endpoint's per-key query already gives the issuer a pull path: every token of that agent is bound to one key, so the per-key total settles all of its allocations together, provided the issuer keeps its own ledger of what it has already settled per key. What that query cannot do is settle one revoked token among several live ones under the same key. A per-token member alongside jkts, answered only for tokens that are expired or revoked, i.e. drained, would close that case without touching reading semantics for live tokens.

    Reading channel. Agree with the conservative branch: readings stay on exp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    budgets

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions