Skip to content

feat(ai): accept key-bearing v1 Agent tokens - #327

Merged
nimish-ks merged 2 commits into
feat--agentsfrom
feat--agent-token-keys
Oct 29, 2026
Merged

nimish-ks merged 2 commits into
feat--agentsfrom
feat--agent-token-keys

Conversation

@nimish-ks

@nimish-ks nimish-ks commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Agent tokens are now minted by the Console as pss_agent:v1:{token}:{kx_pub}:{share_a}:{wrap_key}, the same layout as Personal Access and Service Account tokens. AuthenticationFromPhaseToken accepts that form and rejects pss_agent:v2 and the bearer-only three-part form, neither of which was ever released.
  • Only the bearer part is sent (Bearer Agent <token>), so the runtime, proxy and secrets-command refusal are unchanged.
  • Tests now use the key-bearing v1 form and check that v2 and the bearer-only form are rejected.

Testing

  • go build ./..., go vet (native and GOOS=windows), go test ./....
  • Parsed a token minted by the Console's real minting code: the bearer header matched the Console's.

Console side: phasehq/console#1102.

The Console now mints Agent tokens as
pss_agent:v2:{token}:{kx_pub}:{share_a}:{wrap_key}, the same layout as
Service Account tokens. Parse that form and reject the bearer-only v1
form, which was never released. Only the bearer part is sent.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Deploying phase-cli-install-script with  Cloudflare Pages  Cloudflare Pages

Latest commit: 775ee68
Status: ✅  Deploy successful!
Preview URL: https://19ab6ea2.phase-cli-install-script.pages.dev
Branch Preview URL: https://feat--agent-token-keys.phase-cli-install-script.pages.dev

View logs

No released CLI or Console has ever handled pss_agent tokens, so the
first released form is pss_agent:v1:{token}:{kx_pub}:{share_a}:{wrap_key}.
The prefix alone selects Agent authentication, so the version does not
need to match Service Account tokens. v2 and the bearer-only form are
rejected.
@nimish-ks nimish-ks changed the title feat(ai): accept key-bearing v2 Agent tokens feat(ai): accept key-bearing v1 Agent tokens Oct 28, 2026
@nimish-ks
nimish-ks merged commit 89841bb into feat--agents Oct 29, 2026
13 checks passed
@nimish-ks
nimish-ks deleted the feat--agent-token-keys branch October 29, 2026 15:47
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