Repository navigation
feat: run-scoped agent tokens with server-generated values and upsert - #22
Merged
TheGreatAxios merged 1 commit intoOct 21, 2026
Conversation
Add mountRunScopedTokens and mintRunScopedToken so a host (e.g. Solution Builder) can mint a token for a specific workflow run with proper security: - The server generates the token; callers cannot choose its value - Every route runs the host's requireGrant (credential:* create) - The run must resolve to the route's own tenant; unknown runs → 404 - Re-registering for the same run revokes the old token first (upsert) - A partial unique index on (run_id) WHERE NOT revoked enforces one active token per run at the database level Schema: adds nullable run_id column to agent_token.token (migration 0002). Types: AgentTokenIdentity and AgentTokenContext now carry runId: string | null. Closes CL-10967
|
Triage: Pass No changes needed from you. A maintainer will review this pull request. Waiting on a maintainer to approve: approve, request review. |
TheGreatAxios
deleted the
cl-10967-require-a-grant-and-server-issued-tokens-on-solution
branch
October 21, 2026 03:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
mountRunScopedTokensandmintRunScopedTokenso a host (e.g. Solution Builder) can mint a token for a specific workflow run with proper security:requireGrant(credential:*create)("tenant_id", "run_id") WHERE NOT revokedenforces one active token per run at the database levelrun_idcolumn toagent_token.token(migrations/0002_run_scoped_token.sql)AgentTokenIdentityandAgentTokenContextnow carryrunId: string | nullVerification
bun run check: passes (tsc, oxlint, oxfmt, tests)bun run build: passesCloses CL-10967