Skip to content

[sandbox-skill] Fix the working directory and add drive guidance to the Sandbox skill - #459

Open
erulkey wants to merge 2 commits into
mainfrom
erulkey/skill-drives-shell-guidance
Open

erulkey wants to merge 2 commits into
mainfrom
erulkey/skill-drives-shell-guidance

Conversation

@erulkey

@erulkey erulkey commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

The Sandbox skill tells agents to work in /vercel/sandbox, but managed images use /vercel. On the current default image, commands start in /vercel and /vercel/sandbox doesn't exist until a file write creates it. So the skill's examples can point commands at a directory that isn't there. A command started with cwd under /vercel/sandbox fails with chdir /vercel/sandbox: no such file or directory.

This PR makes four changes to the skill:

  • Working directory: examples now use /vercel. The limits table now gives the working directory, replacing the "Writable paths" row. This matches the SDK reference: "Managed images use /vercel. Custom images use the Dockerfile WORKDIR, or / if none is set."
  • Drives: a short guide to choosing between a drive, a snapshot, and a custom image, condensed from the Drives page. It adds a shared dependency cache example and a drive-limits row.
  • runCommand: it runs the executable without a shell and doesn't throw on a non-zero exit. Use bash -c for pipes and &&.
  • readFileToBuffer: returns null for a missing file. The SDK's JSDoc says so too.

It also updates the official resource links from /docs/vercel-sandbox/... (which redirect) to /docs/sandbox/....

The Vercel plugin copies this file. Its drift agent flagged the plugin's copy in vercel/vercel-plugin#397, and these changes reach the plugin on its next resync.

Validation

I ran these against live sandboxes with @vercel/sandbox 3.9.1 on November 9:

  • pwd in a new sandbox prints /vercel, and HOME is /vercel. Relative writeFiles paths land in /vercel.
  • runCommand("echo", ["one", "&&", "echo", "two"]) prints one && echo two. runCommand("echo one && echo two") returns 400 executable file not found in $PATH. bash -c with the same string prints both lines. runCommand("false") returns exitCode 1 without throwing.
  • readFileToBuffer on a missing path returns null.
  • I ran the shared-cache example as written: pnpm install exits 0 and writes its store to the drive. A second sandbox mounts cache.snapshot() and sees the store, and writes there fail with Read-only file system. Running pnpm directly against that read-only store fails with ERR_SQLITE_ERROR unable to open database file. Copying it to /tmp/store first and installing from there exits 0, so the skill now says to do that.

The Drives docs have the same two problems. vercel/front#97270 fixes them.

…e Sandbox skill

Managed images use /vercel as the working directory, not /vercel/sandbox.
Add when to use a drive, snapshot, or custom image, a tested shared-cache
example, the no-shell runCommand rule, and the null readFileToBuffer return.
@erulkey erulkey changed the title [sandbox-docs] Fix the working directory and add drive guidance to the Sandbox skill [sandbox-skill] Fix the working directory and add drive guidance to the Sandbox skill Nov 9, 2026
@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
sandbox Ready Ready Preview, v0 Nov 9, 2026 7:50pm UTC
sandbox-cli Ready Ready Preview Nov 9, 2026 7:50pm UTC
sandbox-sdk-ai-example Ready Ready Preview Nov 9, 2026 7:50pm UTC
workflow-code-runner Ready Ready Preview Nov 9, 2026 7:50pm UTC

Request Review

This branch was successfully deployed

4 active deployments
Preview – sandbox-sdk-ai-example — ca7be401 Deployed Nov 9, 2026 by vercel[bot]
Preview – sandbox — ca7be401 Deployed Nov 9, 2026 by vercel[bot]
Preview – workflow-code-runner — ca7be401 Deployed Nov 9, 2026 by vercel[bot]
Preview – sandbox-cli — ca7be401 Deployed Nov 9, 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

None yet

Development

Successfully merging this pull request may close these issues.

1 participant