Skip to content
Wardcase Docs

Sandboxes

A sandbox is an isolated Linux machine for one task. It is a gVisor container on a host in the region you choose, with its own network namespace and limits on CPU, memory, processes and disk. Its root filesystem is read-only; /work is its writable volume and home directory. See Images. Its id starts with sbx_, for example sbx_4f9k2m8q1z7x3c5v.

FieldDefaultMeaning
imagebaseThe filesystem it starts from. See Images.
sizesmallvCPU, memory and disk. See Sizes.
regionus-eastWhere it runs. Always pass it: the default may have no host. See Regions.
idle_timeout_s600Seconds without activity before it is destroyed. See Timeouts.
hard_timeout_s3600Seconds after creation when it is destroyed regardless.
egress_policy_idnoneWhich outbound connections are allowed, on top of the built-in deny-list.
envnoneEnvironment variables for commands and SSH sessions in the sandbox. The control plane does not store them.
metadatanoneUp to 20 string key and value pairs of your own, returned with the sandbox.
snapshot_idnoneStart from a snapshot instead of the image.
Terminal window
curl https://api.wardcase.com/v1/sandboxes \
-H "Authorization: Bearer $VIVARIUM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"image":"python","size":"small","region":"eu-west","idle_timeout_s":600}'

The response is the sandbox with status creating. It moves to running when its host reports it ready.

Besides the fields above, a sandbox carries its status, created_at, ready_at, last_activity_at, expires_at (when the hard timeout will destroy it), and ssh_command, for example ssh sbx_4f9k2m8q1z7x3c5v@ssh.wardcase.com. When it ends, ended_at and end_reason say when and why: api, idle_timeout, hard_timeout, abuse, host_lost or failed.

  • You destroy it with DELETE /v1/sandboxes/{id}, or kill() in the SDKs. The API answers 202 and the status moves to stopping, then stopped.
  • Its idle timeout or hard timeout passes.
  • Abuse detection kills it.
  • Its host is lost.

Everything in the sandbox’s filesystem is deleted when it ends. Take a snapshot first if you need it later. Usage stops being metered at the same time.

See Statuses for every state a sandbox can be in.

  • API: https://api.wardcase.com/v1/sandboxes/{id}
  • SSH: ssh.wardcase.com, username is the sandbox id
  • Exposed ports: https://8000-4f9k2m8q1z7x3c5v.wardcase.com for port 8000 of sbx_4f9k2m8q1z7x3c5v