Skip to content

docs(agent-identity): record the session-open rules settled in code - #2616

Merged
ChrisJBurns merged 3 commits into
mainfrom
docs/agent-identity-session-open-catchup
Oct 30, 2026
Merged

ChrisJBurns merged 3 commits into
mainfrom
docs/agent-identity-session-open-catchup

Conversation

@ChrisJBurns

@ChrisJBurns ChrisJBurns commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Records in the agent identity design what the session-open implementation (#2589, #2593, #2601, #2606) settled, found in the #2492 stock take. Smallest in-place edits to credentials-and-lifecycle.md and one row in implementation.md.

  • Request rules (step 3): a request presents its access token at most once (its first open takes it), mecak8s opens before any change, create/fork/clear open before saving and close an unsaved session's broker session by ID, registration after the save is retried at run start, and a broker session that closes after converting the request's token fails the request as a refused token.
  • Workload isolation: narrowed to what holds. A lookup by host session and a call naming the broker session hide another workload's session; an open by host session cannot.
  • Undecodable answer: treated like a mismatched echo.
  • Converted tokens: the broker remembers every jti AS-1 may have converted, across its sessions, until exp plus skew; AS-1 keeps its own record, made explicit.
  • Error reasons: owner_mismatch/session_owned fail with 403; an explicit session ID held by another owner's broker session is refused before saving; owner_action_required at session open is a 401 sign-in; subject_invalid for a token without an iss_sub sub_id; the 401 codes bearer_rejected and sign_in_required are named.
  • Replay-revoke: the lost-response and crash text says "once replay-revoke lands" (toolhive#6973).
  • AS-1's named refusal reasons (agreed on toolhive#7003): a refused subject token gets subject_token_invalid when a fresh access token can pass, which the broker reports as subject_invalid (refresh and retry once), or subject_token_audience / subject_token_source_client for configuration faults (INTERNAL); an unknown or expired grant gets grant_invalid (INTERNAL). An invalid_request with no reason is now a broker bug or configuration fault, not a subject problem. The ToolHive work-list row records them as in progress (toolhive#7003, #7007).
  • ToolHive work list: a new row for exchanging only tokens issued with offline_access, which check 4 no longer claims ToolHive already requires.

Deliberately unchanged: the sentences where the broker revokes a refresh token or keeps it in shared session storage. They describe the target; the phase 1 shortcuts (discard instead of revoke, single replica) stay in the tickets (#2451, #2454, #2563, #2538, #2568).

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)

User-facing change

None. Design drafts only.

The design now states what the session-open implementation settled: a
request presents its access token at most once and opens before any
change, create/fork/clear open before saving, the broker remembers
every converted access-token jti across its sessions, an undecodable
answer is treated like a mismatched echo, and the session-open outcomes
for owner_action_required, owner_mismatch, session_owned, and
subject_invalid. The workload-isolation claim is narrowed to what an
open by host session can hide, and the ToolHive work list gains the
check 4 refusal without a reason.

Co-authored-by: Mecatl <[email protected]>
The work-list row for check 4 now says ToolHive's in-progress exchange
handler sends its own reason codes (and grant_invalid for an unknown
grant), not prose. Check 4 no longer claims ToolHive already requires
the offline_access scope; that requirement moves to its own work-list
row.

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

Agreed with the ToolHive exchange's author: AS-1 refuses a subject
token with subject_token_invalid when a fresh access token can pass, or
subject_token_audience / subject_token_source_client for configuration
faults, and an unknown or expired grant with grant_invalid. The broker
reports subject_token_invalid as subject_invalid (refresh and retry
once); an invalid_request with no reason is a broker bug or
configuration fault. The ToolHive work-list row records the reasons as
in progress.

Co-authored-by: Mecatl <[email protected]>
@ChrisJBurns
ChrisJBurns merged commit 78ff09e into main Oct 30, 2026
32 checks passed
@ChrisJBurns
ChrisJBurns deleted the docs/agent-identity-session-open-catchup branch October 30, 2026 15:39
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants