Repository navigation
docs: decide personal access tokens as a person's credential on the platform - #3548
Conversation
…platform ADR 095 is the record ADR 094 §5 waits for before a PAT is admitted. A PAT belongs to a person homed in the platform project and acts as them, capped by its scopes, on the operations a person's token reaches. It expires within 90 days, is created only from a Console session, and is listed and revoked by its owner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmS8uCXd1d5jCxWaiSf
The user decided that the CLI, the API and MCP matter more than the Console for creating a PAT. So a person's OAuth token may create one with a scope the consent step never preselects, holding no scope that token lacks; a PAT still never creates one, and the creating client is recorded. Scope choice on consent is on main (#3543), which the first draft missed. A PAT is now an opaque 256-bit secret stored as its SHA-256, with its record id and a checksum in the token, so it depends on no key and a copy of the table holds nothing usable. The 90-day limit is to become a policy later. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmS8uCXd1d5jCxWaiSf
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Creating a PAT is a marked call with a scope of its own, so ADR 094 §5's rule fits it: the scope is the gate, and the MCP endpoint asks where the client can answer once it asks about marked calls at all. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmS8uCXd1d5jCxWaiSf (cherry picked from commit c757ba5)
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmS8uCXd1d5jCxWaiSf (cherry picked from commit bef352c)
PATs are off until personal_access_tokens.enabled switches them on, since they do open a bearer path a server without OAuth did not have, and §7 no longer says otherwise. The create scope is never granted without the consent step, and the MCP endpoint asks before a PAT is created where the client can. A person holds at most 50 live PATs. The risks now name the audience a PAT leaves and the Console session that outlives recovery, with the options and a recommendation for the latter. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmS8uCXd1d5jCxWaiSf (cherry picked from commit 93677b0)
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmS8uCXd1d5jCxWaiSf (the ADR part of commit 36bd497ba2, whose renames of CLI files belong to the CLI change)
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
The ADR misleadingly describes owner deactivation as permanently revoking PATs, although unexpired tokens become usable again when the owner is reactivated.
1 open issue
What changed in this PR
Proposes ADR 095 for personal access tokens, defining person-owned credentials for unattended API and MCP access. This PR changes documentation only.
Changes:
- Defines PAT ownership, scope limits, expiry, storage and lifecycle.
- Records creation safeguards, audit attribution and security risks.
- Adds the proposed ADR to the index.
| File | Description |
|---|---|
docs/adrs/README.md |
Indexes ADR 095 and summarizes its decisions. |
docs/adrs/095-personal-access-tokens.md |
Proposes the PAT contract and documents tradeoffs. |
Review effort: Balanced
| - Nobody else manages a person's PATs in this ADR. Deactivating or deleting | ||
| the person ends all of them at once; that is the administrator's and the | ||
| operator's lever until a "manage another person's PATs" operation is | ||
| decided. |
main holds this branch's base, ADR 095, as one squash commit (#3548). Its tree is the base's final head merged with the main before it, which this branch already holds, so the squash is recorded as merged and nothing changes. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
main holds this branch's bases as squash commits: the personal access token API (#3563), and before it ADR 095 (#3548) and the CLI's client document (#3558). The token API's squash has the tree of its branch's final head, which this branch already holds, so it is recorded as merged and nothing changes. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U

Context
ADR 094 §12 puts personal access tokens last in its sequence (step 7) and says they wait for a record of their own. This is that record. It is one of five pieces of work on making Zitadel agent-native: an agent with no person at the keyboard (a CI job, a scheduled task, a coding agent in a cloud container) can reach the management API and the MCP endpoint only with a project secret today, which stands for every scope, cannot be narrowed and names no person in events.
Summary
zpat_<id>_<secret><checksum>). No server key is involved, so replacing keys leaves PATs working.personal_access_token.create. That scope is never preselected on consent. A PAT holds no scope the creating token lacks, a PAT never creates a PAT, and the creating client is recorded and shown.token_id.Validation
node scripts/check-adrs-index.mjs(ok, 95 records)node scripts/check-pr-title.mjs --title "docs: decide personal access tokens as a person's credential on the platform"(ok)Release notes / changeset
Notes
zitadel login), docs: propose apps, machine identities and client credentials #2430 (closed draft on machine identities), docs: propose one OAuth server for customers' applications and Zitadel's own clients #2860 and feat: add public OAuth clients with origins and private-use redirects #3409 (open, relevant to the CLI's sign-in, not to PATs).https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
Generated by Claude Code