Vibeleaderboard
← All Intel
Intel / article

Vercel Sandbox now supports managed npm credentials

Source
vercel.com
Author
Vishal Yathish
Date

Context

Vercel , Vercel's service for running code such as a coding 's commands in an isolated machine, can now install a team's private npm packages without the registry ever entering the sandbox (Vercel changelog). A developer turns this on by passing `credentials: { npm: true }` when creating a sandbox. The sandbox then uses the registry credentials the team already keeps as Shared Environment Variables, including those for custom registries such as GitHub Packages and JFrog Artifactory.

The npm credentials documentation explains how the token stays outside. The sandbox receives an `.npmrc` configuration file that lists the team's registry addresses and package scopes but contains no tokens. When a package manager inside the sandbox downloads from one of those registries, the sandbox firewall, which handles the sandbox's outgoing traffic, adds the `Authorization` header to the request as it leaves. An agent running `npm install` or `pnpm install` therefore gets the private packages, while nothing it runs inside the sandbox can read the token itself.

The documentation also sets out what the feature does not do. It covers installs only: the firewall adds credentials to download requests, and `npm publish` or other write requests leave without them. It works with package managers that read `.npmrc`, including npm, pnpm and Bun. The sandbox's network policy must already allow the registry hosts, or creating the sandbox fails. The credentials are also team-wide, so anyone who can create a sandbox in the team can install its private packages. Hiding the token protects the secret from code in the sandbox; it does not narrow who on the team can use the packages.

Key takeaways · AI-distilled
  • Vercel Sandbox can now install a team's private npm packages using credentials stored in its Shared Environment Variables, enabled by passing credentials: { npm: true } when creating a sandbox.
  • The tokens never enter the sandbox: Vercel's firewall adds authentication to install requests sent to configured registries, so a coding agent can install dependencies without seeing the credentials.
  • Custom registries such as GitHub Packages and JFrog Artifactory are supported, and the feature requires updating to the latest Sandbox SDK or CLI.
Terms in this piece · Glossary
  • sandbox — An isolated environment where AI-generated code or agent actions run without being able to touch anything real.
  • AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
  • token — The chunk of text a model reads and writes in — roughly three-quarters of a word — and the unit AI usage is billed in.
More from Vishal Yathish
Recommended reads
Comments

Checking sign-in…

Loading comments…