Skip to content

Budgets: align with AAuth Protocol -11 and prepare -00 - #206

Merged
dickhardt merged 4 commits into
mainfrom
budgets-11-review
Sep 28, 2026
Merged

dickhardt merged 4 commits into
mainfrom
budgets-11-review

Conversation

@dickhardt

Copy link
Copy Markdown
Owner

Reviews draft-hardt-aauth-budgets.md against AAuth Protocol -11 and prepares it for its first datatracker submission as -00. Only the Budgets draft is touched. The settlement and allocation model is unchanged.

Changes, with the -11 section behind each

Examples

  • Resource Token Extensions: the example's presented_jti was pt-3ab910 (a person token) while budget_consumed named auth token at-71b9d0. A record is only carried when an auth token was presented, and that token is the one presented_jti names, so presented_jti is now at-71b9d0. Its iat/exp moved to after the auth token's issuance. Added a sentence saying which challenge the example is. (-11 §6.7.1)
  • The Consumption Record: jti is stated to be the value the resource token carries as presented_jti. (-11 §6.7.1)
  • Auth Token Extensions: the example now carries tenant and mission_s256. The resource token example copies both from this token, which it can only do if the token carries them. (-11 §6.7.1, §9.4.1)
  • PS-to-AS Token Request Extensions: the example adds Content-Digest and covers content-type and content-digest. (-11 §11.3.3.1)
  • How the PS Responds: the clarification 202 example adds Cache-Control: no-store. (-11 §11.8)
  • Resource Metadata Extensions: the example shows revocation_endpoint, with one sentence noting the base protocol recommends it for a resource that accepts person tokens and that Settlement depends on it. (-11 §11.2.4, §11.12)

Restated rules that did not match -11

  • How the PS Responds: "The PS SHOULD enforce the base protocol's limit on clarification rounds" contradicted -11's MUST. It now cites the limit instead of restating it. (-11 §7.5.3)
  • The Billing Account: removed the (iss, tenant, sub) lookup. (iss, sub) is the identifier and tenant is not part of it. (-11 §9.4.1, §13.10, §14.1)
  • Budget Exhaustion, step-up: the restated permission now uses -11's wording ("needs more authorization than the token provides") and cites Auth Token Required. (-11 §6.5)
  • Budgets Require Auth-Token Mode: "only where it issues auth tokens" is now "requires auth tokens", since a resource never issues auth tokens. Per-endpoint modes cite Resource Access Modes. (-11 §4.2)
  • Token Scope, revocation: replaced "A PS and an AS SHOULD provide a revocation endpoint, and revoking an auth token by (iss, jti)". The request is now {jti, exp} with the issuer taken from the signer. Revocation happens at the resource, by the PS in three-party access. In four-party access the PS revokes the person token at the AS, and the AS revokes the auth tokens it issued against that token. A resource without an endpoint honors the token until exp. (-11 §11.12.1, §11.12.2, §11.12.4)

Flows -11 changed

  • Budget Exhaustion, auth token expired: added the refresh margin (refresh with five minutes left, do not present inside it). An expired token is now answered 401 with Signature-Error: error=expired_jwt, per the family's Signature-Error rule. (-11 §7.9.1, §11.3.4)
  • Budget Exhaustion, exhausted: the agent sends the exhausted auth token as presented_token. The auth token issued against it expires no later than the exhausted one, so a step-up renews the allocation but not the lifetime. (-11 §7.2.1, §9.4.1, §7.1.3)
  • Token Scope: the expiry condition now reflects the refresh margin. (-11 §7.9.1)
  • Unreported Allocations: the opening paragraph said allocations go unreported when an agent crashes. Under -11, a token the agent retires inside the refresh margin is never named in a record either, because re-authorization runs on a person token. The normative rule is unchanged. (-11 §7.9.1, §7.1.3)
  • Settlement: a revocation's terminal answer can arrive at the pending URL of a 202. The citation is now Revocation Response. (-11 §11.12.3)
  • The Consumption Record: "an agent it has not authorized" is now "on a person token, at its authorization endpoint or on the first challenge of a grant". (-11 §6.7, §6.7.1)
  • Mission Attribution: a mission is identified by its PS plus mission_s256. The PS, and the AS in four-party access, verify the resource token's mission_s256 against the presented token's; the text previously said the PS "bound the resource token to the person token". (-11 §8.2.1, §6.7.2)
  • Usage Request: the caller signs as a server in its own right (jwks_uri scheme, id = its issuer, dwk = its metadata document), covering content-type/content-digest. This replaces "exactly as a PS does at an AS auth_token_endpoint", which did not describe an AS caller. (-11 §11.3.2, §11.3.3.1)
  • Standing Authorization for Metered Inference: the mission blob was called "signed". It is content-addressed, and tokens bind to it through mission_s256. (-11 §8.2.1)

Citations and naming

  • Every protocol citation now names an -11 heading. New or corrected: Endpoint and Other URLs (was "Endpoint URL requirements"), Authorization Endpoint, Resource Token Structure, Updated Request, Clarification Limits, PS-to-AS Token Request (was AS Token Endpoint), Expiry and the Refresh Margin, Auth Token Required, Auth Token Structure, Requirement Responses, Resource Access Modes, Revocation Response, Organization Identification, PS-AS Trust Establishment (was Access Server Federation), Agent Delegation, Mission Identifier, Resource Token Verification, Keying Material, Covered Components, AAuth-Capabilities Request Header. I checked every one against the -11 headings.
  • "PS token request" is now "auth token request". usage_endpoint names both callers, the PS and the AS.

Submission prep

  • I-D.hardt-aauth-r3 target is now https://datatracker.ietf.org/doc/draft-hardt-aauth-r3. There are no other sibling references.
  • The front matter had no date = line, so nothing was removed.

Document History

The preamble said: "This document has not been submitted to the datatracker ... The log is reset at first submission, which becomes draft-hardt-aauth-budgets-00." I did what it says:

Needs a decision

  1. budget_consumed.jti duplicates presented_jti. -11 binds every resource token to the token it was issued on, and the record only appears when that token is an auth token. The record could shrink to consumed alone. Why One Record says "The jti stays", but that was written without presented_jti in view. This PR only states that the two are equal.
  2. Budget refusals and 202 deferred delivery (-11 §6.5.1). Budget Exhaustion is written for the 401, but a -11 resource may deliver requirement=auth-token as a 202 and hold the invocation. The draft needs either a rule requiring the 401 for budget refusals, or rules for:
    • which token the held invocation meters against (the auth token on the completing poll);
    • that nothing is reserved against the exhausted token while the invocation is held;
    • what AAuth-Budget on the 202 reports;
    • that the insufficient-budget shrink-and-retry path means abandoning the pending URL.
  3. suggested_budget in four-party access. -11 §9.1.3 has the PS relay an AS terminal error in its own problem+json body, carrying only the AS's error value and status. Declining with Guidance lets the AS include suggested_budget, but does not say whether the PS carries it to the agent, or lowers it to its own ceiling first.
  4. PS check at Auth Token Delivery (-11 §9.1.3). The PS checks that the AS's scope is no broader than the resource token's. There is no parallel check that the AS's budget stays within the budget parameter the PS sent and keeps unit/decimals. Under -11, a token failing such a check would be reported as as_unreachable.
  5. Ledger key in four-party access. The ledger is keyed on (iss, sub, aud). In four-party access iss is the AS, but sub is minted by the PS. Two PSes can mint the same sub for different people behind one AS. (ps, sub, aud) would be unambiguous. The draft follows -11 as written; see the protocol item below.

Found in the protocol spec (not changed here)

  • §13.7 Trust Posture in PS Authorization Access still says "(iss, tenant, sub) identifies a user within an organization". This contradicts §9.4.1, §13.10 and §14.1, which say tenant is never part of the identifier.
  • §9.4.1 says auth token sub is "unique within iss", and §9.4.3 identifies the person by (iss, sub). In four-party access iss is the AS and sub is the PS's directed value, so uniqueness within the AS is not guaranteed across PSes.
  • The §9.1.1 PS-to-AS request example and the §11.12.1 revocation request example show no Content-Digest or Signature-Input, although body coverage is REQUIRED on both.

Build

make draft-hardt-aauth-budgets.txt: mmark OK, xml2rfc OK. xml2rfc reports three warnings, and main reports the same three: the consensus attribute, one wide artwork, and the long Signature-Key line in the authorization endpoint example. This PR adds no warnings.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GF34pBFY1fXuHBTFPMrqRN

Examples: the resource token names the exhausted auth token in both
presented_jti and budget_consumed; the auth token carries the tenant and
mission_s256 the resource token copies from it; the PS-to-AS request covers
content-type and content-digest; the clarification 202 carries
Cache-Control: no-store; resource metadata shows revocation_endpoint.

Prose: the refresh margin and the Signature-Error answer to an expired
token; a step-up auth token inherits the exhausted token's exp; revocation
of an auth token follows -11's who-revokes-what and 202 completion;
(iss, sub) without tenant; the clarification-round limit is the base
protocol's; usage requests sign as a server under Keying Material; mission
identity is the PS plus mission_s256; every protocol citation names an -11
heading. R3 reference targets the datatracker. Document History reset to
a single -00 entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GF34pBFY1fXuHBTFPMrqRN
In four-party access the auth token's iss is the AS, which did not mint
sub, so a key on iss lets two person servers behind one AS collide. The
person is identified by the person server named in ps and its sub, as
decided for protocol -12 (#215). An AS querying the usage endpoint by a
scope key names the person server with a new ps member.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GF34pBFY1fXuHBTFPMrqRN
@dickhardt

dickhardt commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner Author

Decision 5 settled as (ps, sub, aud) (#215). Pushed 641f0ad: the ledger key and aggregation text now use (ps, sub). The usage endpoint gains a ps member, REQUIRED when an AS queries by a scope key, because the tokens an AS issues carry values from every PS that federates with it.

…et, delivery check

Budget Exhaustion gains a Deferred Delivery subsection for refusals sent as
a -11 202 that holds the invocation: nothing is reserved against the
refused token while it is held, the invocation meters against the auth
token on the completing poll, a completing token that does not fit gets
another 202, a replay is not metered again, AAuth-Budget on the 202
reports what the 401 would, and shrink-and-retry abandons the pending URL.

In four-party access the PS relays an AS's suggested_budget in its relayed
error body, lowered to what the PS would itself accept. At Auth Token
Delivery the PS checks the AS's budget against the budget parameter it
sent; a failure is as_unreachable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GF34pBFY1fXuHBTFPMrqRN
@dickhardt

Copy link
Copy Markdown
Owner Author

71ce599 applies the decisions on the Budgets items. It builds on 641f0ad, which keys the ledger on (ps, sub, aud).

  1. Record jti: kept. No change.

  2. 202 delivery: new subsection Budget Exhaustion › Deferred Delivery (#exhaustion-deferred), with an example. The 401 text is unchanged. A held invocation follows four rules:

    1. Nothing is reserved against, or metered to, the token presented on the original request.
    2. It meters against the auth token on the poll that completes it, under the hard cap (#overshoot).
    3. If that token's remainder does not cover the invocation's maximum cost, the poll gets another 202 with reason=insufficient-budget and a fresh resource token, and the invocation stays held.
    4. A replay answered from the stored result is not metered again. It reports the token's current remaining, so the figure stays a floor.

    AAuth-Budget on the 202 reports what the 401 would: remaining, required under insufficient-budget, and unit/decimals, with no cost and no reserved. Shrink-and-retry abandons the pending URL: the agent sends a new, smaller request and never polls the held one. The remaining definition and the Sending Rules now mention the 202.

  3. suggested_budget in four-party access (Declining with Guidance): the PS relays it in its relayed problem+json body. unit and decimals are unchanged. amount is lowered to what the PS would itself accept for the person, where that is lower. That figure never exceeds the PS's ceiling. It is stated as an acceptable amount rather than as the ceiling, because the draft keeps the ceiling from the agent (#why-not-the-ceiling).

  4. Delivery check (PS-to-AS Token Request Extensions): the PS verifies that the AS's budget has the unit/decimals of the budget it sent and an amount no higher. It also verifies that the token carries no budget when the PS sent none. A failure is as_unreachable (-11 Auth Token Delivery).

The Document History is still the single -00 entry. The build adds no new warnings.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GF34pBFY1fXuHBTFPMrqRN

At Auth Token Delivery the PS now also rejects an AS-issued auth token
that carries no budget claim when the PS sent a budget parameter, since
the resource would otherwise apply its own default, which can exceed
what the PS allowed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GF34pBFY1fXuHBTFPMrqRN
@dickhardt
dickhardt merged commit c170e03 into main Sep 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant