Skip to content

Capabilities ​

The package exposes a provider-neutral sandbox contract and a Docker implementation.

SurfaceCapability
PresetsDockerSandbox.node(), .python(), and .deno() choose maintained base-image defaults
CommandsBuffered exec and event-based execStream, stdin, env, cwd, timeout, abort signal, output bounds
FilesBinary/text read and write, listing, bounded paged text reads, manifest seeding
WorkspacesEphemeral directories or named persistent Docker volumes
ProcessesStart, list, read bounded logs, and stop long-running processes
PortsPublish declared ports to random loopback host ports and wait for readiness
Agent toolsCommand, file, process, port, and readiness tools with selection and policy limits
HooksObserve session create/destroy, command start/end, and file writes
Image CLIGenerate and optionally build composed runtime images with create-image

Optional capability guards, isSandboxPortSession and isSandboxProcessSession, keep application code compatible with future providers that may not implement Docker's full surface.

Image builder ​

sh
pnpm dlx @anvia/sandbox create-image \
  --name reports \
  --runtime node \
  --runtime python \
  --feature artifacts

The CLI supports curated runtime/features plus explicit apt, npm, and uv packages. --dry-run prints without writing or building; --no-build writes the Docker context only. Generated custom package versions can drift unless pinned.

Boundaries ​

The package does not provide a remote sandbox service, job scheduler, artifact registry, secret manager, or complete hostile-code guarantee. Docker and host configuration remain part of the real isolation boundary.

See lifecycle, security, and the API reference.

Built for Anvia.