Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
This file records user-visible changes to the BoxCompute CLI. GitHub Releases
use the same notes and bind them to the exact source commit.

## [0.15.0] - 2026-11-30

Create XL and XXL VM sandboxes from the CLI.

### CLI users

- Run `bxc sandbox start WORKSPACE_ID --size xl` or `--size xxl` to select
a larger VM. `small` remains the default.
- Update with `bxc update` or `npm install --global @boxcompute/cli@latest`.

### Security

- The BoxCompute API enforces Starter or organization eligibility for XL and XXL.

## [0.14.4] - 2026-11-30

`bxc sandbox expose` reports unsupported platforms before loading credentials.
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ bxc sandbox delete SANDBOX_ID --yes
```

See [Test tools in a VM sandbox](docs/vm-sandbox-beta.md) for the CLI and API
walkthroughs, retry recovery, and Hermes limitations. VMs default to the
`small` profile (0.5 CPU, 1024 MiB memory) and `--size large` selects the 3x
profile (1.5 CPU, 3072 MiB memory). Both use a 30 GiB thin-provisioned
workspace. VMs have outbound Internet
walkthroughs, retry recovery, and Hermes limitations. `--size` accepts
`small` (the default), `large`, `xl`, and `xxl`. XL and XXL require Starter
or organization access. If you retry a create with a saved idempotency key,
reuse the same size and other create options.

All sizes use a 30 GiB thin-provisioned workspace. VMs have outbound Internet
access by default, no automatic lifetime expiry, and no SSH access. A running
VM bills until it stops: stop it when done if you will reuse it, or delete it
when its files are no longer needed. Uploads are limited to 8 MiB; downloads
Expand Down
23 changes: 12 additions & 11 deletions docs/vm-sandbox-beta.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ workloads or always-on services, and running VMs bill until they stop.
omits the runtime selector and waits up to 180 seconds for `running` — plus
`upload` and `download`. Use `--vm --idempotency-key KEY` for an explicit VM
create with your own retry key and `--no-wait` for the receipt only. Every
sandbox is a VM; CLI 0.13.0 removed the retired `--gvisor` and `--cpu` options. CLI 0.5.0 or newer adds `--size
small|large` for the VM profile. The [CLI walkthrough](#cli-walkthrough-040-or-newer)
sandbox is a VM; CLI 0.13.0 removed the retired `--gvisor` and `--cpu` options.
CLI 0.5.0 added `--size small|large`. CLI 0.15.0 adds `xl` and `xxl` for
accounts with Starter or organization access. The [CLI walkthrough](#cli-walkthrough-040-or-newer)
uses browser login and the CLI's saved credential. The direct API walkthrough
uses a separately loaded account API key; do not extract the CLI's credential.
Experimental Tailcat SSH does not apply to VM sandboxes.
Expand All @@ -31,7 +32,7 @@ sizing (`size`) added September 17, 2026.
| --- | --- |
| Availability | Any authenticated account. No separate VM approval. |
| Selection | Every sandbox is a VM. Omitted `vmSandbox` or `true` creates one; `vmSandbox: false` is refused with `400 INVALID_REQUEST` since gVisor container sandboxes were retired. |
| Resources | Sizing is chosen at create with `size`. `small` (default) is 500m CPU (0.5 CPU), 1,024 MiB RAM; `large` is 1,536m CPU (1.5 CPU), 3,072 MiB RAM. Both get a 30 GiB thin-provisioned workspace. |
| Resources | Choose `small` (default), `large`, `xl`, or `xxl` at creation. XL and XXL require Starter or organization access. All sizes get a 30 GiB thin-provisioned workspace. See the [hosted VM size table](https://boxcompute.ai/docs/vm-sandbox-beta/#choose-a-vm-size) for CPU and memory. |
| Lifetime | No automatic expiry. The VM exists until you delete it and bills while it runs. A running VM stops, keeping its files, when you call stop or 30 minutes after its last start, execute, file call or preview request; reads, logs, operation polling and work inside the VM do not count. |
| Image | Immutable, server-selected approved minimal Ubuntu image. No arbitrary image override, library profile, or attached volumes. |
| User/runtime | Unprivileged user; `HOME=/workspace`. No sudo/root installation or SSH login. Check that your required executables are available; Node.js, uv and your tool's dependencies are not guaranteed. |
Expand Down Expand Up @@ -62,7 +63,7 @@ Run these steps in the same shell in a new local test directory.
### Create and check readiness

Generate and save a key **once** for this intended VM. The key is not a credential.
Keep the workspace ID and optional name unchanged when retrying:
Reuse the workspace ID, size, and optional name when retrying:

```bash
WORKSPACE_ID='REPLACE_WITH_OWNED_WORKSPACE_ID'
Expand All @@ -74,10 +75,10 @@ bxc --json sandbox start "$WORKSPACE_ID" > vm-create-response.json
For an explicit VM create with your own retry key, add
`--vm --idempotency-key "$CREATE_KEY"` (generate and save the key once) and
`--no-wait` to get the creation receipt immediately; the receipt can be
`pending`, and a successful exit does not prove readiness. Add
`--size large` for the 3x profile (1.5 CPU, 3,072 MiB RAM); the default is
`--size small` (0.5 CPU, 1,024 MiB RAM), and `size` is VM only. Either way, save
the returned sandbox ID separately:
`pending`, and a successful exit does not prove readiness. The default is
`--size small` (0.5 CPU, 1,024 MiB RAM). To select a larger VM, use
`--size large`, `--size xl`, or `--size xxl`. Save the returned sandbox ID
separately:

```bash
SANDBOX_ID=$(jq -er '.sandbox.id | strings | select(length > 0)' vm-create-response.json)
Expand Down Expand Up @@ -243,9 +244,9 @@ If your shell closes, restore `CREATE_KEY` from `vm-create-key.txt`, keep
generates a new key. Restore any saved sandbox ID from `vm-sandbox-id.txt`.

Only `workspaceId`, optional `name` (1–80 trimmed characters), `vmSandbox`,
`size` (VM only: `small` or `large`, default `small`), and `blockNetwork` (VM
only; omitted means outbound Internet) configure public creation. `small` is
0.5 CPU / 1,024 MiB and `large` is 1.5 CPU / 3,072 MiB. Unknown fields are
`size` (`small`, `large`, `xl`, or `xxl`, default `small`), and `blockNetwork`
(omitted means outbound Internet) configure public creation. XL and XXL
require Starter or organization access. Unknown fields are
currently discarded, not sizing controls. Do not send `image`, `backend`, `cpu`,
`memoryMiB`, `workspaceMiB`, `timeoutSeconds`,
`libraries`, or `volumes`.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@boxcompute/cli",
"version": "0.14.4",
"version": "0.15.0",
"description": "Connect local AI agents to BoxCompute sandboxes",
"keywords": [
"boxcompute",
Expand Down
21 changes: 11 additions & 10 deletions skills/boxcompute-sandbox/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ The returned sandbox `id` is the stable instance ID used by later commands.
VM is the default runtime: `bxc --json sandbox start WORKSPACE_ID` creates a VM
and waits up to 180 seconds for `state: running`, reporting the sandbox either
way. For an explicit VM create with your own retry key, add `--vm
--idempotency-key KEY`; reuse the same key, workspace, and optional `--name` on
retry, and save the returned ID even when pending. `--no-wait` returns the
--idempotency-key KEY`; reuse the same key, workspace, size, and optional `--name`
on retry, and save the returned ID even when pending. `--no-wait` returns the
creation receipt immediately. Every sandbox is a VM: there is no container option.
Never change keys to recover a stuck create.

Expand All @@ -47,14 +47,15 @@ use) wait a moment and run it again. Without it, a VM stops by itself 30
minutes after its last resume, exec, upload, download or preview; status,
logs, analytics, costs and processes running inside the VM do not count.

VMs are sized at create with `--size small|large` (default `small`): small is
0.5 CPU / 1024 MiB RAM and large is 1.5 CPU / 3072 MiB RAM, both with a 30 GiB
workspace. Use `--size large` only when the
task needs more than the default profile; it bills more. VMs have outbound
Internet access by default, no SSH, and no automatic lifetime expiry. A running
VM bills until it is stopped: stop it when finished if you will reuse it, or
delete it when its files are no longer needed. Execution does not replace an
expired VM. Probe executables; dependencies are not guaranteed.
Choose a size at creation with `--size small|large|xl|xxl` (default `small`).
XL and XXL require Starter or organization access. Report the server's
`FEATURE_ACCESS_DENIED` error if the requested size is unavailable to the
account. All sizes use a 30 GiB workspace. Larger sizes bill at higher rates.
VMs have outbound Internet access by default, no SSH, and no automatic
lifetime expiry. A running VM bills until it is stopped: stop it when finished
if you will reuse it, or delete it when its files are no longer needed.
Execution does not replace an expired VM. Probe executables; dependencies are
not guaranteed.

```sh
bxc sandbox upload SANDBOX_ID fixture.txt /workspace/fixture.txt
Expand Down
9 changes: 5 additions & 4 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
type Usage,
type Workspace,
} from "@boxcompute/sdk";
import { buildCreateSandboxRequest, createClient, type SandboxSize } from "./sdk.js";
import { buildCreateSandboxRequest, createClient, SANDBOX_SIZES } from "./sdk.js";
import { serviceAccessApi } from "./service-access.js";
import {
clearConnection,
Expand Down Expand Up @@ -174,8 +174,9 @@ Commands:

Start options:

--size small|large VM only: VM profile size (default: small).
--size ${SANDBOX_SIZES.join("|")} VM profile size (default: small).
small = 0.5 CPU / 1024 MiB; large = 1.5 CPU / 3072 MiB
xl and xxl require Starter or organization access
--vm Explicitly request a VM sandbox; requires
--idempotency-key, reused with the same options on retry
--idempotency-key KEY Required for --vm; reusable for any create
Expand Down Expand Up @@ -1398,13 +1399,13 @@ export async function runCli(argv: string[], supplied: CliDependencies = {}): Pr
const cpu = option(args, "cpu");
const vmSandbox = flag(args, "vm");
const gvisor = flag(args, "gvisor");
const size: SandboxSize = oneOf(option(args, "size"), "--size", ["small", "large"] as const) ?? "small";
const size = oneOf(option(args, "size"), "--size", SANDBOX_SIZES) ?? "small";
const idempotencyKey = option(args, "idempotency-key");
const name = option(args, "name");
const noWait = flag(args, "no-wait");
if (args.length) throw new UsageError(`Unknown sandbox start option: ${args[0]}`);
if (gvisor || cpu !== undefined) {
throw new UsageError("gVisor sandboxes are retired: every sandbox is a VM. Drop --gvisor and --cpu, and choose a size with --size small|large");
throw new UsageError(`gVisor sandboxes are retired: every sandbox is a VM. Drop --gvisor and --cpu, and choose a size with --size ${SANDBOX_SIZES.join("|")}`);
}
if (vmSandbox && !idempotencyKey) throw new UsageError("sandbox start --vm requires --idempotency-key; save and reuse it with the same options on retry");
let sandbox = await client.sandboxes.create(buildCreateSandboxRequest(id, {
Expand Down
7 changes: 4 additions & 3 deletions src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type { Connection } from "./config.js";

export const FILE_CHUNK_BYTES = 8_388_608;

/** VM compute size tier: `small` (0.5 vCPU / 1024 MiB) or `large` (1.5 vCPU / 3072 MiB). */
export type SandboxSize = "small" | "large";
export const SANDBOX_SIZES = ["small", "large", "xl", "xxl"] as const;
export type SandboxSize = (typeof SANDBOX_SIZES)[number];

export function validateFilePath(path: string): void {
if (path.length > 4096 || path.includes("\0") ||
Expand Down Expand Up @@ -44,7 +44,8 @@ export function buildCreateSandboxRequest(

const body: CreateSandboxRequest = { workspaceId };
if (input.vmSandbox) body.vmSandbox = true;
if (input.size !== undefined) body.size = input.size;
// SDK 0.4.0 types predate XL and XXL. Its create method sends the size unchanged.
if (input.size !== undefined) body.size = input.size as CreateSandboxRequest["size"];
if (name !== undefined) body.name = name;

return { ...body, ...(input.idempotencyKey ? { idempotencyKey: input.idempotencyKey } : {}) };
Expand Down
60 changes: 58 additions & 2 deletions test/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,63 @@ describe("bxc CLI", () => {
fetch: (async () => { throw new Error("should not fetch"); }) as unknown as typeof globalThis.fetch,
};
await expect(runCli(["sandbox", "start", "workspace-one", "--size", "medium"], rejected))
.rejects.toThrow("--size must be one of: small, large");
.rejects.toThrow("--size must be one of: small, large, xl, xxl");
});

it.each(["xl", "xxl"])("sends size %s and the same key on create retry", async (size) => {
const io = streams();
const requests: unknown[] = [];
const dependencies = {
io,
env: {},
loadConnection: async () => ({ url: "https://app.boxcompute.ai", token: "bc_live_test", tokenFile: "/credential" }),
fetch: (async (input: string | URL | Request, init?: RequestInit) => {
requests.push({
url: String(input),
method: init?.method,
key: new Headers(init?.headers).get("idempotency-key"),
body: JSON.parse(String(init?.body)),
});
const pending = requests.length === 1;
return Response.json({ sandbox: {
id: "sbx_one", vmSandbox: true, size, state: pending ? "pending" : "running",
} }, { status: pending ? 202 : 201 });
}) as typeof globalThis.fetch,
};
const args = [
"--json", "sandbox", "start", "workspace-one", "--vm", "--no-wait",
"--size", size, "--idempotency-key", "saved-key", "--name", "Build",
];

expect(await runCli(args, dependencies)).toBe(0);
expect(JSON.parse(output(io.stdout))).toEqual({ sandbox: { id: "sbx_one", vmSandbox: true, size, state: "pending" } });
expect(await runCli(args, dependencies)).toBe(0);
expect(JSON.parse(output(io.stdout))).toEqual({ sandbox: { id: "sbx_one", vmSandbox: true, size, state: "running" } });

const create = {
url: "https://app.boxcompute.ai/api/v2/sandboxes",
method: "POST",
key: "saved-key",
body: { workspaceId: "workspace-one", vmSandbox: true, size, name: "Build" },
};
expect(requests).toEqual([create, create]);
});

it("reports XL eligibility denial after one create request", async () => {
const io = streams();
const bodies: unknown[] = [];
const message = "XL VMs require Starter or organization access";
await expect(runCli(["--json", "sandbox", "start", "workspace-one", "--size", "xl"], {
io,
env: {},
loadConnection: async () => ({ url: "https://app.boxcompute.ai", token: "bc_live_test", tokenFile: "/credential" }),
fetch: (async (_input: string | URL | Request, init?: RequestInit) => {
bodies.push(JSON.parse(String(init?.body)));
return Response.json({ code: "FEATURE_ACCESS_DENIED", error: message }, { status: 403 });
}) as typeof globalThis.fetch,
})).rejects.toMatchObject({ status: 403, code: "FEATURE_ACCESS_DENIED", message });
expect(bodies).toEqual([{ workspaceId: "workspace-one", size: "xl" }]);
expect(output(io.stdout)).toBe("");
});

it("reads retained sandbox logs with filters without starting compute", async () => {
Expand Down Expand Up @@ -471,7 +527,7 @@ describe("bxc CLI", () => {
const sandboxHelp = output(sandboxIo.stdout);
expect(sandboxHelp).not.toContain("--cpu");
expect(sandboxHelp).not.toContain("--gvisor");
expect(sandboxHelp).toContain("--size small|large");
expect(sandboxHelp).toContain("--size small|large|xl|xxl");
expect(sandboxHelp).toContain("stop SANDBOX_ID");

const versionIo = streams();
Expand Down