Skip to content

docs(agent-identity): settle session-open token, owner, and 502/504 rules - #2590

Merged
jhrozek merged 3 commits into
mainfrom
docs/agent-identity-session-open-decisions
Oct 28, 2026
Merged

jhrozek merged 3 commits into
mainfrom
docs/agent-identity-session-open-decisions

Conversation

@ChrisJBurns

@ChrisJBurns ChrisJBurns commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Settles four session-open questions that #2492 needs answered before its broker and server work. Smallest in-place edits to credentials-and-lifecycle.md and implementation.md; no new sections. The lost-response rule is #2587's; this PR only extends it to proxy 502s and 504s.

Question Decision Why
Does an already-open session take a later request's access token? Only while it holds no live refresh token. A conversion spends the token's jti, and clients keep one access token across requests, so taking it every time would make the next request fail with token_used. Since #2575, a replacement cannot outlive the session's hard expiry, so it gains nothing. Matches the lifetimes table ("never renewed"). The broker keeps its replace-and-revoke rule as a guard.
Can a later open in a gRPC stream use the stream's token? Only before the stream's first response; later opens pass no token. A 401 the client can retry must come before any work starts, and a stream that has produced output cannot be retried. Pushing a fresh token on the stream would be a wire change.
What owner does an open without a token keep? The owner mecak8s reports pairs the session, as today; the verified owner is recorded when AS-1 first accepts a token, and broker check 2 compares against it. The expires_at rule keys on "no stored expiry" instead of "first open", and an echo without expires_at does not match. Opens without a token (scheduled sessions, team roots, continuations) keep working without changing registration or lookup, and check 2 keeps its meaning.
Does a 502 or 504 at session open follow #2587's lost-response rule? Yes: resend once with a new client assertion; a refused resend gets token_used, which mecak8s returns as the tagged 401. 503 and 429 stay UNAVAILABLE. A proxy's 502 or 504 may come from a request AS-1 processed, exactly like a lost response. As UNAVAILABLE, mecak8s would retry with the same access token and always get token_used, and the orphan would not be revoked. A 503 or 429 means AS-1 did not process it.

Wording fix: the hop test list no longer says a bare invalid_request is INTERNAL at session open, where step (3) reports it as subject_invalid.

Decided in the ticket, not here, because they stay inside #2492:

Issue relationship

Relates to #2492

Type of change

  • Documentation

Test plan

  • matlatl check docs/drafts/agent-identity --strict: same result as on main (3 links out of the directory, 0 broken anchors). task docs stops at docs:configref here because buf is not installed; no generated reference is affected.

User-facing change

None. Design drafts only.

ChrisJBurns and others added 2 commits October 28, 2026 19:01
…onse rules

mecak8s passes an access token only while the broker session holds no
live refresh token, and a gRPC stream's token only before its first
response. An open without a token pairs the session with the reported
owner; the verified owner is recorded when AS-1 first accepts a token,
and the expires_at rule keys on the stored expiry. A lost session-open
response, or a 502 or 504, is reported as token_used. Step (5) and the
hop tests no longer contradict session open.

Relates to #2492.

Co-authored-by: Mecatl <[email protected]>
#2587 settled the lost-response rule (resend once with a new client
assertion), so this branch drops its own token_used rule for lost
responses and 502/504, and the step (5) exception it implied. The
token, stream, and owner rules stay.

Co-authored-by: Mecatl <[email protected]>
@ChrisJBurns ChrisJBurns changed the title docs(agent-identity): settle session-open token, owner, and lost-response rules docs(agent-identity): settle session-open token and owner rules Oct 28, 2026
A proxy's 502 or 504 may come from a request AS-1 processed, so at
session open it follows the lost-response rule: resend once with a new
client assertion, and a refused resend is token_used. 503 and 429 stay
UNAVAILABLE.

Co-authored-by: Mecatl <[email protected]>
@ChrisJBurns ChrisJBurns changed the title docs(agent-identity): settle session-open token and owner rules docs(agent-identity): settle session-open token, owner, and 502/504 rules Oct 28, 2026
@ChrisJBurns
ChrisJBurns requested a review from jhrozek October 28, 2026 19:29
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.

2 participants