Skip to content

docs(agent-identity): finish inline broker keys and note assertion clock skew - #2574

Merged
jhrozek merged 2 commits into
mainfrom
docs/agent-identity-design-followups
Oct 27, 2026
Merged

jhrozek merged 2 commits into
mainfrom
docs/agent-identity-design-followups

Conversation

@ChrisJBurns

@ChrisJBurns ChrisJBurns commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Follow-ups to #2523 and #2571 in the agent identity design drafts. Design text only; no code changes.

Changes

  1. Inline broker client keys everywhere. docs(agent-identity): sign embedded-mode users in through the company IdP #2571 settled that the broker's public key is registered as an inline JWKS and registered again on rotation (credentials-and-lifecycle.md step (5)), but a few places still described jwks_uri as the mechanism or as open:
    • credentials-and-lifecycle.md: the credential roles table (broker client credential), check 1 in step (5), and the key-set rotation row.
    • implementation.md: the ToolHive work-list row for fetching keys from jwks_uri now says decided, not planned.
    • mcp-gateway-modes.md: what the gateway administrator registers for mecatl.
  2. Clock skew on the assertion's exp (please confirm). Check 5 in step (5) said "exp has not passed" with no skew. Two other places already assume a skew there: check 6 keeps a used jti "until exp plus the clock skew", which is only useful if an assertion can still be accepted after exp; and implementation.md's tests expect "a client assertion replayed inside the clock-skew window after exp" to be refused. This PR adds "allowing the configured clock skew" to check 5, as step (1)'s access-token check already does. The offline harness's AS-1 applies that skew since feat(identitybroker): authenticate the broker to AS-1 and AS-2 with private_key_jwt #2573. If you'd rather check 5 stay strict, say so: we'd drop the skew from the harness and the replay-window test instead.
  3. Issuer as the assertion's aud. The work-list row said "Unknown; verify". It's supported on ToolHive main (toolhive#6946) but not in a release yet (it missed v0.57.0); released versions accept only the token-endpoint URL.
  4. Proxy and rate-limit statuses are unavailable. The error-reasons table named only HTTP 503 as retryable. A 429, 502, or 504 from a proxy or rate limiter in front of AS-1 or AS-2 is a passing outage too, not a configuration fault, so it now maps to UNAVAILABLE, as the broker's token-endpoint client already does (feat(identitybroker): authenticate the broker to AS-1 and AS-2 with private_key_jwt #2573).

Test plan

  • matlatl check . --strict: no new findings (the existing ones are in an untracked local file).

…ock skew

Follow #2571 through: the credential roles table, step (5) check 1, the
key-set rotation row, the ToolHive work list, and the gateway
administrator configuration now say the broker's public key is an
inline JWKS registered again on rotation, not a jwks_uri.

Check 5 in step (5) now allows the clock skew on the assertion's exp,
as check 6's jti retention and the replay-window test already assume.
The work list records that ToolHive accepts the issuer as the assertion
audience on main (toolhive#6946), not yet in a release.

Co-authored-by: Mecatl <[email protected]>
@ChrisJBurns ChrisJBurns added the agent-identity Agent Identity label Oct 27, 2026
@ChrisJBurns
ChrisJBurns requested a review from jhrozek October 27, 2026 00:15
The error-reasons table named only HTTP 503 as retryable. A 429, 502, or
504 from a proxy or rate limiter in front of AS-1 or AS-2 is a passing
outage too, not a configuration fault, so map it to UNAVAILABLE as the
broker's token-endpoint client already does (#2573).

Co-authored-by: Mecatl <[email protected]>

@jhrozek jhrozek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for finishing this.

  • Inline keys. ToolHive refuses jwks_uri for clients, so an operator registering the broker's public key at each server is the only option that works today. Saying so in the roles table, check 1, the rotation table, and the external-mode checklist means a gateway administrator learns up front that a key rotation needs them, instead of finding out from an invalid_client. Marking the jwks_uri row "Not planned" closes the open decision rather than leaving it to look like pending ToolHive work.
  • Issuer as aud. Right status: it's on ToolHive main but not released, so a broker that follows the design is refused by any released ToolHive. Whatever ToolHive version the demo pins has to include it.
  • 429, 502, 504 as UNAVAILABLE. These come from an ingress or rate limiter in front of the server, not from the server's decision. Mapping them to "try again later" keeps a timeout from being reported as a Mecatl misconfiguration and sending someone to debug configuration that is fine.
  • Clock skew on check 5. Yes, that's the intent. RFC 7523 allows the server a small margin, and the access-token check in step (2) already allows it on exp and iat. ToolHive doesn't apply one to client assertions yet: fosite compares exp and iat exactly, so a broker whose clock runs a second ahead gets invalid_client from real ToolHive while the harness accepts it. Tracked in stacklok/toolhive#6954; the text stays as the target.

@jhrozek
jhrozek merged commit 94f7352 into main Oct 27, 2026
31 checks passed
@jhrozek
jhrozek deleted the docs/agent-identity-design-followups branch October 27, 2026 11:43
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Nov 18, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-identity Agent Identity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants