Skip to content

docs: decide personal access tokens as a person's credential on the platform - #3548

Merged
fforootd merged 6 commits into
mainfrom
claude/personal-access-tokens-adr
Dec 2, 2026
Merged

fforootd merged 6 commits into
mainfrom
claude/personal-access-tokens-adr

Conversation

@fforootd

@fforootd fforootd commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

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

  • Adds ADR 095, status Proposed, and its row in the ADR index. No code.
  • A personal access token (PAT) is a person's credential on the platform: its owner is a person homed in the platform project, and it is resolved as that person, never as a principal of its own.
  • It holds one or more of the scopes a person's token can use, as a ceiling on what the owner holds at each call, and reaches the operations a person's token reaches, on the API and through MCP.
  • It must expire, within 90 days at most. The ADR says that limit becomes a policy setting later.
  • It is an opaque 256-bit random secret, stored as its SHA-256 and shown once (zpat_<id>_<secret><checksum>). No server key is involved, so replacing keys leaves PATs working.
  • The owner creates one through the API, so from the CLI, an MCP client or the Console: from a Console session, or with a person's token that carries 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.
  • Events name the owner as the actor, with the PAT's token_id.
  • Machine identities get a paragraph on what they would still need; nothing of them is decided here.

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

  • No changeset required — no shipped behavior changed.

Notes

https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U


Generated by Claude Code

…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
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cloud Ready Ready Preview Dec 2, 2026 9:36am UTC

Request Review

@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ No Changeset found

Latest commit: 3c12c91

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-12-02T14:11:29.336850Z 3c12c91 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment on lines +168 to +171
- 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.
@fforootd
fforootd added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit 1115e80 Dec 2, 2026
19 checks passed
@fforootd
fforootd deleted the claude/personal-access-tokens-adr branch December 2, 2026 14:47
@github-project-automation github-project-automation Bot moved this from Inbox to Done in Engineering Kanban Dec 2, 2026
fforootd pushed a commit that referenced this pull request Dec 2, 2026
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
fforootd pushed a commit that referenced this pull request Dec 2, 2026
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

This branch was successfully deployed

1 active deployment
Preview — 3c12c91c Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants