Skip to content

feat(tokens): document stage-only access tokens - #2036

Merged
Tayvon merged 3 commits into
mainfrom
tayvon-stage-only-token-docs
Sep 10, 2026
Merged

Tayvon merged 3 commits into
mainfrom
tayvon-stage-only-token-docs

Conversation

@Tayvon

@Tayvon Tayvon commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

What

Adds public documentation for the new "Read and write (stage only)" granular access token publish policy.

Part of github/npm#15530 (Phase 1 — safer stage-capable GAT). Closes github/npm#15610.

Changes

about-access-tokens.mdx — new ### About stage-only tokens section covering:

  • What it is / why it exists (safer automation on-ramp).
  • Capabilities and limitations: can stage (npm stage publish), deprecate, move dist-tags, unpublish; cannot directly publish a new version (fails with E_STAGE_REQUIRED).
  • Promotion flow: npm stage publish → maintainer with 2FA runs npm stage approve <stage-id> --otp <code>.
  • Jan 2027 direct-publish deprecation.
  • A <Note> explicitly stating this is not a general-purpose security boundary (avoids overstating security, per the issue).

creating-and-viewing-access-tokens.mdx — updates the now-live Packages and scopes permission options to match the production UI (wubwub #3762, deployed at 100%): Read and write (publish and stage) / Read and write (stage only).

Document the new "Read and write (stage only)" granular access token
publish policy (github/npm#15610, epic github/npm#15530).

- about-access-tokens: add "About stage-only tokens" section covering
  capabilities (stage, deprecate, dist-tags, unpublish), the limitation
  (no direct publish; E_STAGE_REQUIRED), the npm stage publish -> maintainer
  npm stage approve promotion flow, and the Jan 2027 direct-publish
  deprecation. Avoids overstating security.
- creating-and-viewing-access-tokens: update the now-live Packages and
  scopes permission options ("Read and write (publish and stage)" /
  "Read and write (stage only)").

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0f2e357f-6da8-4978-a637-f14539820093
@Tayvon
Tayvon requested a lite review from Copilot September 10, 2026 13:28
@Tayvon
Tayvon marked this pull request as ready for review September 10, 2026 13:29
@Tayvon
Tayvon requested review from a team and leobalter as code owners September 10, 2026 13:29

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.

Copilot review overview

🟡 Changes recommended

A few documentation statements need tightening/consistency fixes, and the Jan 2027 scope is flagged as undecided but currently stated definitively in the doc.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Lite
Findings: 3 Low severity

New issues introduced by this change (3)
Severity Finding
Low severity content/​integrations/​integrating-npm-with-external-services/​about-access-tokens.mdx — In this bullet, the permission labels are lowercased ("read-only" / "read and write"), but…
Low severity content/​integrations/​integrating-npm-with-external-services/​about-access-tokens.mdx — This sentence implies stage-only tokens are "safer" because they can't push a version live, but the…
Low severity content/​integrations/​integrating-npm-with-external-services/​about-access-tokens.mdx — The PR description flags an open decision about whether the Jan 2027 cutoff applies to all
What changed in this PR

Adds public documentation for the new “Read and write (stage only)” granular access token publish policy, and updates the token-creation documentation to match the production UI permission labels.

Changes:

  • Documented stage-only tokens (capabilities, limitations, staging/promotion workflow, and deprecation timeline messaging) in about-access-tokens.mdx.
  • Updated Packages and scopes → Permissions options and added brief explanations/links in creating-and-viewing-access-tokens.mdx.
File Description
content/​integrations/​integrating-npm-with-external-services/​creating-and-viewing-access-tokens.mdx Updates UI permission option labels and adds short explanations + link to stage-only token docs.
content/​integrations/​integrating-npm-with-external-services/​about-access-tokens.mdx Adds “About stage-only tokens” section and references it from the granular token capability list, including deprecation messaging.
Suppressed comments (1)

content/integrations/integrating-npm-with-external-services/about-access-tokens.mdx:69

  • Grammar: "Stage-only restricts" reads like an adjective without a subject. Changing to "A stage-only token restricts" makes the note clearer.
**Note:** Stage-only restricts _direct publishing of new versions only_. It is not a general-purpose security boundary — a stage-only token retains the other write capabilities listed above, so treat it with the same care as any other token.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

- Scope the January 2027 deprecation to bypass-2FA direct-publish tokens
  (dhei review; matches github/npm#15610).
- State the narrow security guarantee (no direct new-version publish without
  maintainer approval) instead of implying broad safety (Copilot review).
- Title-case the Read-only / Read and write permission labels to match the UI
  and the token-creation doc, and add a trailing period (Copilot review).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0f2e357f-6da8-4978-a637-f14539820093
Unpublish is not governed by the stage-only publish policy but by the
bypass-2FA GAT allowlist (npm-auth-ws, github/npm#15226): a 2FA-bypass
granular access token — the population stage-only automation tokens fall
into — is blocked from unpublish (403), while deprecate and dist-tags
remain allowed. Verified against enforcement code and a live test (dhei
review). Keep deprecate and dist-tags; remove the overstated unpublish claim.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0f2e357f-6da8-4978-a637-f14539820093
@Tayvon
Tayvon merged commit 9cab483 into main Sep 10, 2026
8 of 9 checks passed
@Tayvon
Tayvon deleted the tayvon-stage-only-token-docs branch September 10, 2026 21:22
dhei added a commit to npm/api-documentation that referenced this pull request Sep 11, 2026

This branch was previously deployed

1 inactive deployment
github-pages 39b72d97 Deployed Sep 10, 2026 by Tayvon via deploy #3130
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.

3 participants