Skip to content

feat(sandbox,vercel-sandbox): multi-region support - #301

Merged
marc-vercel merged 12 commits into
mainfrom
sandbox-multi-region-support
Aug 20, 2026
Merged

feat(sandbox,vercel-sandbox): multi-region support#301
marc-vercel merged 12 commits into
mainfrom
sandbox-multi-region-support

Conversation

@marc-vercel

@marc-vercel marc-vercel commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Enable multi-region for sandboxes and snapshots. When we show the region, if it is not defined, we default to iad1, which is where we place sandboxes/snapshots by default.

Example of creating a sandbox (now we also show the region):

❯ sandbox create
✅ Sandbox silver-colossal-wren-WU4M8Y created.
   │ team: marc-codina-enhanced-vtest314
   │ region: iad1
   │ project: my-sandbox-app-tmp
   ╰ connect with: sandbox ssh silver-colossal-wren-WU4M8Y

Example of creating a sandbox with failover regions:

sandbox create --region cle1 --failover-regions sfo1,iad1
✅ Sandbox scarlet-vitreous-woodpecker-kkjYfK created.
   │ team: marc-codina-enhanced-vtest314
   │ region: cle1
   │ project: my-sandbox-app-tmp
   ╰ connect with: sandbox ssh scarlet-vitreous-woodpecker-kkjYfK

Example of updating an existing sandbox region and failover regions:

❯ sandbox config list crimson-chronic-mackerel-pbh3WM
FIELD                 VALUE                                 
Region                cle1                                  
Failover regions      sfo1, iad1                            
...

❯ sandbox config failover-regions crimson-chronic-mackerel-pbh3WM sfo1
✅ Configuration updated for sandbox crimson-chronic-mackerel-pbh3WM
   ╰ failover-regions: sfo1

❯ sandbox config region crimson-chronic-mackerel-pbh3WM iad1
✅ Configuration updated for sandbox crimson-chronic-mackerel-pbh3WM
   ╰ region: iad1

❯ sandbox config list crimson-chronic-mackerel-pbh3WM
FIELD                 VALUE    
Region                iad1     
Failover regions      sfo1
...

Notes:

  • We are not validating the regions, so that if in the future we add more, old sandbox versions keep working.

@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
sandbox Ready Ready Preview, v0 Aug 20, 2026 9:01am
sandbox-cli Ready Ready Preview Aug 20, 2026 9:01am
sandbox-sdk-ai-example Ready Ready Preview Aug 20, 2026 9:01am
workflow-code-runner Ready Ready Preview Aug 20, 2026 9:01am

@vercel vercel Bot 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.

Additional Suggestion:

The generated CLI reference packages/sandbox/docs/index.md is stale and omits the newly-added --region and --failover-region flags for the create and fork commands.

Fix on Vercel

marc-vercel and others added 10 commits August 19, 2026 19:14
- Expose failoverRegions on Sandbox (validator field + getter) so the
  param is readable, not write-only.
- Mock server: reject failover regions that include the sandbox region,
  and stop inheriting the source failovers when a fork overrides region.
- Trim --region/--failover-region values before forwarding them.
- snapshots ls: fall back to region when regions is an empty array.
- create: align failoverRegions with the surrounding argument style.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The mock diverged from the API in both directions: a fork dropped the
inherited failover regions when the region was overridden (accepting a
combination the server rejects), and create validated the failover set
against the defaulted region (rejecting one the server accepts).

Copy each side independently on fork and validate the resulting pair,
only reject an overlap with a region the caller provided, and filter an
overlap with the default region on read.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace the repeatable --failover-region flag with a single
--failover-regions option that takes a comma-separated list, trimming
blanks and de-duplicating entries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sandbox.update now accepts region and failoverRegions, forwarded on the
PATCH, plus `sandbox config region` and `sandbox config failover-regions`
commands and Region / Failover regions rows in `sandbox config list`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace the three hardcoded "iad1" display fallbacks with a single
constant, also used in the --region flag description.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
`Sandbox.region` and `Sandbox.failoverRegions` returned `undefined`
whenever the API omitted the fields, pushing the platform defaults onto
every caller. Report `iad1` and `[]` from the getters instead, typed as
`string` and `string[]`, and export `DEFAULT_SANDBOX_REGION` so the
default region has one source of truth.

The CLI's display-layer fallbacks are now redundant, except in `ls`,
which renders raw list metadata rather than `Sandbox` instances.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@marc-vercel
marc-vercel force-pushed the sandbox-multi-region-support branch from fd6d3bd to 78396e3 Compare August 19, 2026 17:15
Co-authored-by: Tom Lienard <tom.lienrd@gmail.com>
@marc-vercel
marc-vercel merged commit 2997ecc into main Aug 20, 2026
13 checks passed
@marc-vercel
marc-vercel deleted the sandbox-multi-region-support branch August 20, 2026 09:02
@github-actions github-actions Bot mentioned this pull request Aug 20, 2026
@github-actions github-actions Bot mentioned this pull request Aug 20, 2026
QuiiBz added a commit that referenced this pull request Aug 20, 2026
Following #301, this PR adds
support for multi-region in drives

- Set the `region` field when creating a new drive, or use the
`--region` flag in the CLI
- You can retrieve the region of a drive using the `region` getter on
the `Drive` class
- Drives can be only be mounted to sandboxes running on the same region

Also adding the missing mock for the `Drive` class in
`@vercel/sandbox-mock`
marc-vercel pushed a commit that referenced this pull request Aug 21, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## sandbox@4.1.0

### Minor Changes

- Add multi-region support:
([#301](#301))

- New `region` and `failoverRegions` options on sandbox create, fork,
and update (SDK), with matching flags on `sandbox create`, `fork`,
`run`, `sh`, and the `sandbox config region` / `sandbox config
failover-regions` commands (CLI).
- New `failoverRegions` getter on `Sandbox` and `regions` getter on
`Snapshot`.
- Regions are now shown in `sandbox ls`, `sessions list`, `snapshots
list`/`get`, `sandbox config list`, and the create/fork summary.

### Patch Changes

- Accept `none` for `--failover-regions` on `sandbox create`, `sandbox
run` and `sandbox fork`.
([#310](#310))

`sandbox config failover-regions <name> none` already clears the list,
but at creation time
`none` was forwarded as a literal region name and rejected by the API.
With a project-level
default failover list there was no way to create a sandbox in one of
those regions from the
CLI, while the SDK and the HTTP API both accept an empty
`failoverRegions` array.

The `none` sentinel is now shared between `create`/`run`/`fork` and
`config`.

- `Sandbox.region` and `Sandbox.failoverRegions` no longer return
`undefined`: the getters now report the platform defaults (`iad1` and
`[]`) when the API omits the fields, so their types are `string` and
`string[]`. The new `DEFAULT_SANDBOX_REGION` export makes the default
region readable. ([#301](#301))

- Updated dependencies
[[`2997ecc32a77c145289fbbd89ae2dc0214767ae3`](2997ecc),
[`2997ecc32a77c145289fbbd89ae2dc0214767ae3`](2997ecc),
[`2023195eafe3199c2372f7dad8bfaf0878267c52`](2023195)]:
  - @vercel/sandbox@3.1.0
## @vercel/sandbox@3.1.0

### Minor Changes

- Add multi-region support:
([#301](#301))

- New `region` and `failoverRegions` options on sandbox create, fork,
and update (SDK), with matching flags on `sandbox create`, `fork`,
`run`, `sh`, and the `sandbox config region` / `sandbox config
failover-regions` commands (CLI).
- New `failoverRegions` getter on `Sandbox` and `regions` getter on
`Snapshot`.
- Regions are now shown in `sandbox ls`, `sessions list`, `snapshots
list`/`get`, `sandbox config list`, and the create/fork summary.

- `Sandbox.region` and `Sandbox.failoverRegions` no longer return
`undefined`: the getters now report the platform defaults (`iad1` and
`[]`) when the API omits the fields, so their types are `string` and
`string[]`. The new `DEFAULT_SANDBOX_REGION` export makes the default
region readable. ([#301](#301))

### Patch Changes

- Update `defineSandboxProxy` to limit the JWKS issuer cache size to
prevent unbounded memory usage.
([#309](#309))
## @vercel/sandbox-mock@3.1.0

### Minor Changes

- Add multi-region support:
([#301](#301))

- New `region` and `failoverRegions` options on sandbox create, fork,
and update (SDK), with matching flags on `sandbox create`, `fork`,
`run`, `sh`, and the `sandbox config region` / `sandbox config
failover-regions` commands (CLI).
- New `failoverRegions` getter on `Sandbox` and `regions` getter on
`Snapshot`.
- Regions are now shown in `sandbox ls`, `sessions list`, `snapshots
list`/`get`, `sandbox config list`, and the create/fork summary.

- `Sandbox.region` and `Sandbox.failoverRegions` no longer return
`undefined`: the getters now report the platform defaults (`iad1` and
`[]`) when the API omits the fields, so their types are `string` and
`string[]`. The new `DEFAULT_SANDBOX_REGION` export makes the default
region readable. ([#301](#301))

### Patch Changes

- Updated dependencies
[[`2997ecc32a77c145289fbbd89ae2dc0214767ae3`](2997ecc),
[`2997ecc32a77c145289fbbd89ae2dc0214767ae3`](2997ecc),
[`2023195eafe3199c2372f7dad8bfaf0878267c52`](2023195)]:
  - @vercel/sandbox@3.1.0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
marc-vercel pushed a commit that referenced this pull request Aug 21, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to drives-beta, this
PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`drives-beta` is currently in **pre mode** so this branch has
prereleases rather than normal releases. If you want to exit
prereleases, run `changeset pre exit` on `drives-beta`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases
## sandbox@4.1.0-beta.1

### Minor Changes

- Add multi-region support for drives:
([#307](#307))

- Set the `region` field when creating a new drive, or use the
`--region` flag in the CLI.
- You can retrieve the region of a drive using the `region` getter on
the `Drive` class.
- Drives can be only be mounted to sandboxes running on the same region.

- Add multi-region support:
([#301](#301))

- New `region` and `failoverRegions` options on sandbox create, fork,
and update (SDK), with matching flags on `sandbox create`, `fork`,
`run`, `sh`, and the `sandbox config region` / `sandbox config
failover-regions` commands (CLI).
- New `failoverRegions` getter on `Sandbox` and `regions` getter on
`Snapshot`.
- Regions are now shown in `sandbox ls`, `sessions list`, `snapshots
list`/`get`, `sandbox config list`, and the create/fork summary.

### Patch Changes

- `Sandbox.region` and `Sandbox.failoverRegions` no longer return
`undefined`: the getters now report the platform defaults (`iad1` and
`[]`) when the API omits the fields, so their types are `string` and
`string[]`. The new `DEFAULT_SANDBOX_REGION` export makes the default
region readable. ([#301](#301))

- Updated dependencies
[[`c2b5d7b45340b485264abb82f0cd640ed4e93293`](c2b5d7b),
[`2997ecc32a77c145289fbbd89ae2dc0214767ae3`](2997ecc),
[`2997ecc32a77c145289fbbd89ae2dc0214767ae3`](2997ecc),
[`2023195eafe3199c2372f7dad8bfaf0878267c52`](2023195)]:
  - @vercel/sandbox@3.1.0-beta.1
## @vercel/sandbox@3.1.0-beta.1

### Minor Changes

- Add multi-region support for drives:
([#307](#307))

- Set the `region` field when creating a new drive, or use the
`--region` flag in the CLI.
- You can retrieve the region of a drive using the `region` getter on
the `Drive` class.
- Drives can be only be mounted to sandboxes running on the same region.

- Add multi-region support:
([#301](#301))

- New `region` and `failoverRegions` options on sandbox create, fork,
and update (SDK), with matching flags on `sandbox create`, `fork`,
`run`, `sh`, and the `sandbox config region` / `sandbox config
failover-regions` commands (CLI).
- New `failoverRegions` getter on `Sandbox` and `regions` getter on
`Snapshot`.
- Regions are now shown in `sandbox ls`, `sessions list`, `snapshots
list`/`get`, `sandbox config list`, and the create/fork summary.

- `Sandbox.region` and `Sandbox.failoverRegions` no longer return
`undefined`: the getters now report the platform defaults (`iad1` and
`[]`) when the API omits the fields, so their types are `string` and
`string[]`. The new `DEFAULT_SANDBOX_REGION` export makes the default
region readable. ([#301](#301))

### Patch Changes

- Update `defineSandboxProxy` to limit the JWKS issuer cache size to
prevent unbounded memory usage.
([#309](#309))
## @vercel/sandbox-mock@3.1.0-beta.1

### Minor Changes

- Add multi-region support:
([#301](#301))

- New `region` and `failoverRegions` options on sandbox create, fork,
and update (SDK), with matching flags on `sandbox create`, `fork`,
`run`, `sh`, and the `sandbox config region` / `sandbox config
failover-regions` commands (CLI).
- New `failoverRegions` getter on `Sandbox` and `regions` getter on
`Snapshot`.
- Regions are now shown in `sandbox ls`, `sessions list`, `snapshots
list`/`get`, `sandbox config list`, and the create/fork summary.

- `Sandbox.region` and `Sandbox.failoverRegions` no longer return
`undefined`: the getters now report the platform defaults (`iad1` and
`[]`) when the API omits the fields, so their types are `string` and
`string[]`. The new `DEFAULT_SANDBOX_REGION` export makes the default
region readable. ([#301](#301))

### Patch Changes

- Add mock for the `Drive` class.
([#307](#307))

- Updated dependencies
[[`c2b5d7b45340b485264abb82f0cd640ed4e93293`](c2b5d7b),
[`2997ecc32a77c145289fbbd89ae2dc0214767ae3`](2997ecc),
[`2997ecc32a77c145289fbbd89ae2dc0214767ae3`](2997ecc),
[`2023195eafe3199c2372f7dad8bfaf0878267c52`](2023195)]:
  - @vercel/sandbox@3.1.0-beta.1

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants