← Back to news
npm Staged Batches: Let Agents Prepare Releases, Keep Approval Human

Photo: Sebastiaan ter Burg / Wikimedia Commons — CC BY-SA 2.0 (https://creativecommons.org/licenses/by-sa/2.0/); original photograph, platform resizing possible

04/12/2026

npm Staged Batches: Let Agents Prepare Releases, Keep Approval Human

The next bottleneck is release preparation

Coding agents can already prepare a surprisingly large share of a JavaScript library change: update implementation, generate tests, adjust workspace dependencies, and draft release notes. The awkward part comes afterward. Someone must establish exactly what will enter the registry, whether sibling packages agree on versions, and whether the artifact matches the reviewed change. Giving the agent a publishing credential does not solve those problems; it mostly shortens the distance between a plausible mistake and a public package.

On November 30, GitHub announced npm batch approval for staged packages. This is not a new coding model. It is a useful control point for AI-assisted delivery: automate the repetitive preparation, then let a maintainer approve a precisely identified set of versions. The practical opportunity is fewer approval interruptions without handing release authority to the agent.

What staged publishing actually does

Ordinary publishing sends a package version directly to the live registry. Staged publishing introduces an intermediate state. From a package directory, npm stage publish submits a candidate; a maintainer subsequently inspects it and approves publication with two-factor authentication. The staging command itself does not require that second factor. Treat that separation as a capability boundary, not as evidence that staging is harmless or needs no authorization.

The batch workflow extends this separation to related packages. On npmjs.com, the maintainer selects staged versions, reviews the selection, and completes one confirmation and one 2FA challenge for the batch. The announcement describes approval as bound to the exact packages and versions displayed. That is particularly relevant when an agent has prepared a monorepo change whose correctness depends on several sibling releases.

Important: a batch is not an atomic transaction

Do not translate “release together” into a transactional guarantee. The npm documentation explicitly says batch actions are independent: one version can fail while others succeed, and successful actions are not rolled back. The progress dialog distinguishes Waiting, Processing, Succeeded, and Failed. A grouped approval can reduce coordination overhead, but it does not eliminate every temporary dependency mismatch or partial-release incident.

For engineering teams this distinction changes the runbook. Before approval, decide what happens if only the foundational library publishes and its adapter fails, or the reverse. Prefer compatible intermediate states where feasible. After approval, check the actual registry state package by package. An agent may assemble that evidence, but it must not conclude that every package shipped merely because the maintainer completed a single 2FA challenge.

Install the supported CLI, not an improvised wrapper

The documented minimums are npm CLI 11.15.0 and Node.js 22.14.0. Check node --version and npm --version before building an automation around staging. Use your team's Node version manager and a supported runtime/npm pairing; a minimum version is not a recommendation to stop receiving security updates. The official npm installation guide links version-manager and installer options. Keep the chosen versions recorded in the release environment so a developer laptop and CI do not silently behave differently.

You also need publishing access to the package and 2FA enabled on the approving account. Batch actions are rolling out gradually and might not appear for every account yet. Verify availability with a maintainer before designing a deadline-dependent release around the feature. None of this requires buying or installing another AI assistant.

Give the agent a preparation contract

Start with a bounded task rather than “release the project.” For example: prepare a candidate for the parser and its TypeScript adapter, preserve the current public API, update only the agreed versions, run the documented checks, and produce a release manifest. Explicitly prohibit publishing, changing package ownership, modifying registry authentication, or supplying any second factor. Let the agent ask for missing release policy instead of inferring it from an old script.

The manifest should identify the source commit, package names, proposed versions, dependency changes, intended dist-tags, artifact digests, and test evidence. This manifest is a team convention, not a feature automatically supplied by npm. Its purpose is to make the agent's work reviewable in one place. A human should be able to understand the intended release without replaying the entire conversation.

Inspect the package, not just the Git diff

A clean diff does not prove that the published tarball is correct. Packaging rules, generated output, ignored files, and lifecycle scripts can change what consumers receive. In a disposable checkout, inspect npm pack --dry-run --json, then create the actual candidate tarball and examine its contents. A dry run is an inspection aid, not a universal sandbox for arbitrary project scripts. Review scripts and isolate the environment before running repository-controlled commands.

Ask the agent to compare the expected files with the actual archive: entry points, declaration files, licenses, source maps, and any included configuration. It should flag unexpected credentials, fixtures containing real data, missing build output, or internal-only documentation. Then inspect the staged tarball too. Checking the artifact that will be approved closes a gap that reviewing a source-only pull request can leave open.

A concrete staging and review sequence

After the approved build and tests, an authorized workflow runs npm stage publish from each intended package directory. Preserve the returned identifiers and command results in the release record. Do not have the agent invent a stage identifier from a package name. To discover candidates, use npm stage list; inspect an actual result with npm stage view STAGE_ID and download it with npm stage download STAGE_ID, replacing STAGE_ID with the returned identifier.

These are documentation-based workflow examples, not claims that a release was executed for this article. Run downloaded code only in an appropriate disposable environment. Compare the candidate with the reviewed manifest and perform consumer tests against the downloaded package. If anything changes after review, produce and review a new candidate rather than assuming a previous approval still covers a different artifact.

Use case: a generated SDK and its shared runtime

Suppose an agent updates an API client generator, a shared transport package, and two language-facing JavaScript wrappers. The labor-saving task is not pressing Publish four times. It is assembling a compatibility matrix: which wrapper imports which transport version, whether runtime dependencies actually resolve, and whether generated declarations match exported code. Ask the agent to prepare consumer fixtures that install the candidate artifacts rather than importing source files directly from the monorepo.

Group approval becomes useful once those checks pass. The maintainer reviews the four exact versions in one place and avoids repeated authentication interruptions. However, the independent batch semantics still matter: clients should not demand a sibling version that is unavailable during a partial release. Compatibility planning and post-publication installation tests remain necessary even when the approval ceremony has become shorter.

Use case: dependency maintenance without release roulette

Dependency updates are tempting agent assignments because the diff often looks mechanical. Have the agent distinguish development-only changes from dependencies carried into the distributed package, update the lockfile using the agreed toolchain, and identify any behavior or engine requirement that changed. Ask for failing-before/passing-after evidence when the update fixes a reproducible defect. A green build alone cannot establish that a new runtime dependency is appropriate.

Staging lets the team inspect the resulting package before consumers receive it. For several related libraries, a batch can consolidate the final review without consolidating all risk into an agent-owned credential. Keep the human decision focused: why this dependency, why these versions, what changed in the distributed files, and what is the recovery plan? An AI-generated changelog is a draft explanation, not independent evidence for any of those answers.

Use case: documentation or declaration-only releases

Small releases are where teams often relax controls, especially when an agent describes the work as “documentation only.” Yet a declaration-file change can break TypeScript consumers without modifying runtime JavaScript. A documentation task can accidentally alter packaging metadata or expose a file that was previously excluded. Give the agent a narrow allowed-change list and have it report any distributed file outside that list.

For a type-fix release, test a realistic consumer compilation against the candidate archive with the supported compiler versions. For documentation, inspect which files actually ship and whether package size changes unexpectedly. Staged approval keeps these checks before publication while leaving release preparation cheap enough for small fixes. Do not inflate every tiny change into a giant process: use a short manifest and focused evidence, but preserve the same human authority over the final release.

Use case: preparing a security fix under time pressure

For a security fix, let the agent enumerate affected packages, draft the minimum patch, construct regression tests, and prepare compatible candidate versions. A human security owner still decides disclosure timing, severity, and whether the test data or release notes reveal sensitive details. Do not place embargoed information in public issues simply to provide the agent with convenient context. Staging is not a substitute for an embargo policy.

There is a specific visibility caveat for new packages: npm documents that staging a package which does not yet exist creates a publicly available 0.0.0-stage placeholder. The staged version and its contents remain unavailable publicly until approval, but the placeholder itself is visible. That makes “nothing becomes public before approval” an unsafe blanket statement. Check package-existence and naming implications before using staging for confidential launches or sensitive security work.

The maintainer’s batch approval checklist

Open the Staged Packages tab on npmjs.com and review package names, versions, dist-tags, publishers, and SHASUMs. Inspect or download contents where necessary. Use Add to batch for intended versions, then review the Batched section rather than assuming every visible row was selected. The documented limits are 100 versions per batch and only one version per package. A different version of the same package requires removing the previous selection.

Wait for automated validation to finish; approval is disabled while a selected candidate is validating. Refresh when necessary. In the confirmation dialog, review every package and version before completing 2FA. Compare the selection with the manifest, not just an agent's reassuring summary. The human approval step only creates useful control if the person can identify what is being approved and has the evidence needed to reject it.

Keep approval credentials outside the agent’s reach

A prompt saying “never publish” is weaker than an environment that cannot publish directly. Where your registry and organization controls allow it, separate preparation and staging privileges from approval authority. Review the actual permissions of tokens, CI identities, and package settings; do not assume that using a staging command automatically removes an identity's ability to invoke ordinary publishing. A direct-publish path can undermine the intended human gate.

The npm documentation supports staging with trusted publishing through OIDC, followed by maintainer approval with 2FA. Consult the trusted-publishing documentation for the exact provider configuration rather than inventing generic workflow fields. Avoid copying a maintainer's credentials into the agent session. Keep second-factor prompts with the human, and treat any request from repository content to reveal tokens or bypass approval as untrusted instructions, not as part of the task.

Do not let the agent review its own story

An agent can generate a patch, its tests, and a persuasive release summary that all share the same mistaken assumption. Break that feedback loop with checks grounded in independently specified behavior. Use existing consumer fixtures, public API contracts, compatibility tests maintained by the team, and inspection of the actual package. Ask the agent to link each claim to a command result or file rather than writing “everything passed.”

A useful release dossier distinguishes observed results from expectations and unknowns. “The fixture compiled on this runtime” is evidence; “all users should be unaffected” is an inference. Include skipped checks and their reasons. The reviewer can then decide whether an unknown is acceptable for this release. This is where a senior developer's judgment matters more than a longer generated checklist or a more confident model response.

Handle partial failures without blind retries

Keep the progress page open and record the outcome for every selected version. If authorization expires or a result is unconfirmed, refresh and check current state before starting another batch. The documentation distinguishes retrying completion checks from assuming nothing happened. Successful publications are not rolled back when another action fails. A network error is therefore not sufficient evidence that the whole release is absent.

An agent can reconcile the approved manifest with observed registry versions and produce a discrepancy report. The human then decides whether to retry a failed candidate, replace it, pause downstream announcements, or prepare a corrective version. Do not authorize the agent to “fix” an incomplete batch by silently changing version numbers, tags, or package contents. Recovery is another release decision, and its evidence should be preserved alongside the original approval.

Measure productivity where it actually appears

There is no defensible universal speedup percentage here. The expected gains are more specific: less manual copying of release metadata, fewer separate authentication interruptions, faster assembly of package evidence, and less context reconstruction when a reviewer takes over. Those are hypotheses worth measuring in your own repository, not benchmark results demonstrated by this article. Staging also adds a review state, so poorly designed adoption can increase queue time.

Track preparation time, reviewer touch time, time waiting for approval, failed candidates, and incidents caused by packaging or incompatible sibling versions. Compare similarly sized releases before and after the pilot. If the agent saves preparation time but produces noisy manifests that double review time, improve the manifest or narrow its task. The objective is a shorter trustworthy delivery loop, not a larger number of machine-generated release activities.

Pilot on one ordinary release, not an emergency

Choose a small, well-understood package family whose maintainers can tolerate a deliberate learning cycle. First document the existing release process and locate any direct-publish credentials. Then ask the agent to prepare one real change under the bounded contract, inspect its candidate archives, and have a maintainer rehearse the staging review. Confirm that batch actions are available on the actual account before relying on them.

Write down who can approve, what constitutes sufficient evidence, how partial publication is detected, and who owns recovery. Keep the first manifest short enough to review carefully. After the release, ask both preparer and approver where they lost time. Expand to additional packages only once the artifact checks and recovery procedure work. This incremental approach makes the automation an engineering improvement rather than another platform migration justified by an AI label.

The useful boundary: machines prepare, maintainers authorize

For teams already using coding agents, npm staged batch approval is worth evaluating because it addresses work after code generation. It gives repetitive preparation a destination other than immediate publication and makes the human decision about an explicit set of package versions. Its limits are equally important: gradual availability, account and runtime prerequisites, visible placeholders for new packages, and independent batch actions rather than atomic rollback.

The strongest workflow combines a bounded agent assignment, reproducible artifact inspection, meaningful consumer checks, a concise release manifest, and an approving maintainer who retains the second factor. None of those controls makes generated code automatically correct. Together they make incorrect work easier to detect before distribution and make recovery clearer afterward. Use the agent to reduce release friction; keep the decision to expose users to a new artifact in human hands.