Sandbox Sdk

2026-01-23
ContainersSandbox SDKBuilt on Containers
Cloudflare

Batteries Included

All the common abstractions you'd build on Containers, ready to use directly and extend

Commands & Processes

Shell execution, streaming output, background services

await sandbox.exec(
'npm install'
)

Also: execStream(), startProcess(), killProcess()

Files

Full filesystem API with binary support

await sandbox.writeFile(
'/config.json', data
)

Also: readFile(), listFiles(), mkdir()

Expose Services

Run services inside, access from outside via preview URLs

const res = await sandbox
.exposePort(3000)
const url = res.url

Also: proxyToSandbox(), wsConnect()

Code Interpreter

Python, JS, TS with rich outputs — charts, tables, images

await sandbox.runCode(
'print(df.head())'
)

Also: runCodeStream()

Storage

Mount buckets as local filesystem, persists across lifecycles

await sandbox.mountBucket(
'r2-data', '/mnt'
)

Also: R2, S3, GCS compatible

Coming Soon

Full pseudo terminal support for interactive shells

const pty = await sandbox.pty(
{ cols: 80, rows: 24 }
)

Also: HTTP-based SDKs, Tools for agents