Skip to content

Interfaces

SandboxOpts

Options for Sandbox.create.

optional client?: Client

An existing client; by default one is created with the default login and the organization from instance.


optional document?: string | Uint8Array<ArrayBufferLike>

A full environment document instead of packages/egress.


optional egress?: readonly string[]

Outbound allowlist (hostnames; “” allows all). Default [“”]. Cloud metadata, loopback and private ranges are always blocked.


optional egressPolicy?: "deny" | "destroy"

What happens outside the allowlist: “deny” (refuse the connection, default) or “destroy” (stop the sandbox).


optional envs?: Record<string, string>

Environment variables for every command (kept client-side, on this handle).


optional instance?: string

The organization ID (used when client is unset). If unset, $CHAINCTL_SANDBOX_INSTANCE is used; if that’s empty too, the organization is auto-detected when you belong to exactly one ($CHAINGUARD_SANDBOX_NO_DETECT_INSTANCE=1 turns that off). List IDs with listOrganizations(), chainguard-sandbox orgs or chainctl iam organizations list.


optional name?: string

Label; the display name becomes <name>/<word-word>. Default “sandbox”.


optional packages?: readonly string[]

Chainguard package names (default DEFAULT_PACKAGES). Unknown packages fail create.


optional source?: object

Start from a GitHub repository (cloned into /work) instead of an empty tree.

optional revision?: string

url: string


optional startTimeoutMs?: number

How long to wait for the guest to start (ms, default 180000).