Skip to content

Authorization server: revocation and audit for delegated agents #6886

Open
1 of 11 issues completed
Open

Description

@jhrozek

Moved: the phase 1 items in the list below moved to mecatl #2543 on 2026-11-04. See the table at the end.

Problem: ToolHive's authorization server can redeem ID-JAGs but cannot issue them, and token exchange returns only access tokens. A delegated client, for example Mecatl's credential broker, needs to hold a user's authority for unattended work and turn it into short-lived tokens on demand.

Standard grant types only. Every request uses token exchange (RFC 8693) or the JWT-bearer grant (RFC 7523, ID-JAG profile). No custom grant types. Deployment-defined items: one authorization_details type, https://toolhive.dev/exchange_grant, that describes a grant (RFC 9396), and the reason codes.

The server knows grants, not the client's sessions. A client maps its own sessions, schedules, and owners onto grants, which are bound to the client and the user.

Design home: an amendment to THV-0019 (auth-server design). Mecatl's agent identity design describes the end-to-end flow. Each open sub-issue emits its audit events in the same change, using the event types in "Add audit logging to authserver" (#3919). The events for the sub-issues that shipped before #3919 are collected in #7375.

Profile note: this server issues ID-JAGs only from grants issued by token exchange: a refresh token whose output is ID-JAGs, or a child of a grant that issues refresh tokens. ID-token subject tokens (allowed by draft-ietf-oauth-identity-assertion-authz-grant §4.3) are deliberately not accepted, so only a client holding a revocable grant can mint ID-JAGs.

Sub-issues (in order)

Login identity (no dependencies):
0. #6900 Emit sub_id (RFC 9493) with the user's upstream identity in access tokens (done, v0.57.0)

Foundation:

  1. Stable pre-provisioned broker client for token exchange and ID-JAG redemption #6893 Stable pre-provisioned broker client (the issuer as client-assertion audience is in v0.58.0)
  2. Support authorization_details (RFC 9396) in token exchange #6894 authorization_details in token exchange (RFC 9396) (done, v0.57.0)
  3. Storage for grants issued by token exchange #6895 Storage for grants issued by token exchange
  4. Authorization server: allow clock skew on private_key_jwt client assertions #6954 Allow clock skew on private_key_jwt client assertions

Grants and ID-JAGs:
5. #6897 Refresh tokens through token exchange, as generic grants (including child grants)
6. #6898 ID-JAG issuance through token exchange
7. #6899 Pluggable actor-token validation at ID-JAG issuance
8. #6965 Kind e2e for refresh tokens issued by token exchange
9. #6967 Document the profile for refresh tokens issued by token exchange

Scheduled runs: #6896 is closed as covered by #6897. A schedule is a grant that issues refresh tokens, and each run is a child grant that issues ID-JAGs.

Revocation and offboarding (later):

Audit (needs "Add audit logging to authserver" (#3919) and its middleware issue #3918):

Later (not needed for the above; file when in scope)

Terms

  • Grant: the server's record of authority a user delegated to a client, created by token exchange. It is bound to the client and the user (sub and sub_id), lists exactly one output (an ID-JAG or a refresh token), has an expiry the server caps and echoes, never rotates, and cannot be redeemed at the refresh-token grant. The client holds an opaque refresh token for it. The server records no session, schedule, or owner.
  • Child grant: a grant derived from a grant that issues refresh tokens. It lists one other output, expires no later than its parent, and works only while its parent is live, checked on every use. Depth is one.
  • Company IdP: the upstream identity provider users sign in with (for example Entra or Okta).
  • sub_id: the user's subject at the company IdP as an RFC 9493 iss_sub identifier.
  • Actor-token validator: the pluggable check in Pluggable actor-token validation at ID-JAG issuance #6899 that confirms an agent's credential, whether the agent may act for the grant's user, and the identifier used as act.sub.
  • Reason codes: exact, stable strings in error_description, so a client can act on them: for grants token_used, revoked, parent_revoked, not_issuable, grant_invalid (an unknown, expired, or another client's grant); for a refused subject token subject_token_invalid, subject_token_audience, subject_token_source_client, subject_token_offline_access; at ID-JAG issuance upstream_subject_missing, sub_id_missing, dpop_not_supported, and bound_elapsed (under invalid_grant); for the actor check actor_token_expired, approval_required, denied; for the upstream re-check upstream_revoked, owner_action_required. The reasons for a malformed authorization_details entry are listed in the profile documentation (Document the profile for refresh tokens issued by token exchange #6967). A client maps these to its own reasons.

Moved to the ToolHive track (phase 1)

Phase 1 items moved from this tracker to the Phase 1 ToolHive track (mecatl #2543). This tracker now covers phase 2: revocation and audit for delegated agents. Closed items are listed for the record.

Item State Now under Phase
Stable pre-provisioned broker client (#6893) closed mecatl #2543 1
Support authorization_details in token exchange (#6894) closed mecatl #2543 1
Storage for grants issued by token exchange (#6895) closed mecatl #2543 1
Schedule refresh tokens through token exchange (#6896) closed mecatl #2543 1
Refresh tokens through token exchange, as generic grants (#6897) closed mecatl #2543 1
ID-JAG issuance through token exchange (#6898) closed (PR #7130, in v0.66.0) mecatl #2543 1
Pluggable actor-token validation at ID-JAG issuance (#6899) closed (in v0.66.0) mecatl #2543 1
Emit sub_id in access tokens (#6900) closed mecatl #2543 1
Set typ: at+jwt on access tokens (#6941) closed mecatl #2543 1
Allow clock skew on private_key_jwt assertions (#6954) closed (PR #7088, after v0.64.0) mecatl #2543 1
Kind e2e for refresh tokens issued by token exchange (#6965) closed mecatl #2543 1
Document the profile for refresh tokens issued by token exchange (#6967) open mecatl #2543 1
Test that one upstream identity never maps to two users (#6980) open mecatl #2543 1
Configured delegate client with api_audience (#7026) closed mecatl #2543 1
Refuse every failed client assertion with invalid_client (#7028) closed mecatl #2543 1
Return invalid_target on an audience parameter (#7027) closed mecatl #2543 1 (provisional)

Sub-issues

Sub-issues

1 of 11 Issues completed
Loading 11 sub-issues

Activity

  1. added
    needs-triage
    on Oct 20, 2026
  2. changed the title [-]Authorization server: grants and ID-JAG issuance for delegated agents[/-] [+]Authorization server: refresh tokens and ID-JAG issuance for delegated agents[/+] on Oct 21, 2026
  3. removed
    needs-triage
    on Oct 24, 2026
  4. 31 remaining items

  5. changed the title [-]Authorization server: refresh tokens and ID-JAG issuance for delegated agents[/-] [+]Authorization server: revocation and audit for delegated agents[/+] on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions