kosa8 docs Dashboard
esc
↑ ↓ move↵ openRuns in your browser; nothing you type is sent anywhere.

Core concepts

Sandboxes

A sandbox is a microVM with its own kernel, filesystem and network, made for one agent, one task or one rollout. You make it, run things in it, and delete it, or let its deadline delete it for you.

# Create: deleted on its own after 30 minutes, asleep after 5 idle
ID=$(kosa8 cloud sandbox create --template python --ttl 30m --sleep-after 5m --json | jq -r .sandbox.id)

kosa8 cloud sandbox get $ID          # state, size, region, timers
kosa8 cloud sandbox exec $ID -- python3 --version
kosa8 cloud sandbox rm $ID           # its disk is wiped
API=https://api.kosa8.com/v1
AUTH="Authorization: Bearer $KOSA8_API_KEY"

# Create: deleted on its own after 30 minutes, asleep after 5 idle
SBX=$(curl -s $API/sandboxes -H "$AUTH" -H 'Content-Type: application/json' \
  -d '{"template":"python","ttl_s":1800,"sleep_after_s":300}' | jq -r .sandbox.id)

curl -s $API/sandboxes/$SBX -H "$AUTH" | jq '.sandbox | {id, state, cpus, mem_mb, region}'

# Push the deadline out to two hours from now
curl -s -X PATCH $API/sandboxes/$SBX -H "$AUTH" -H 'Content-Type: application/json' \
  -d '{"ttl_s":7200}' | jq '.sandbox.delete_after'

curl -s -X DELETE $API/sandboxes/$SBX -H "$AUTH"
from kosa8 import Kosa8Cloud

cloud = Kosa8Cloud()

box = cloud.sandboxes.create(template="python", ttl_s=1800, sleep_after_s=300)
print(box.id, box.state)             # sbx_… running

box.update(ttl_s=7200)               # push the deadline out to two hours
same = cloud.sandboxes.get(box.id)   # look it up again by id
print(same.state)                    # running

box.delete()
import { Kosa8Cloud } from '@kosa8/sdk';

const cloud = new Kosa8Cloud();

const box = await cloud.sandboxes.create({ template: 'python', ttlS: 1800, sleepAfterS: 300 });
console.log(box.id, box.state);            // sbx_… running

await box.update({ ttlS: 7200 });          // push the deadline out to two hours
const same = await cloud.sandboxes.get(box.id);
console.log(same.state);                   // running

await box.delete();

Create#

POST /v1/sandboxes with an empty body gives you a base sandbox (Alpine, 1 vCPU, 256 MiB). The fields you will use most:

FieldWhat it does
templatebase, python, node, a universal-* size, or your own. See sizes and templates
imageAny public OCI image instead, such as python:3.12-slim
size0.25x0.5 up to 16x32 (vCPUs x GiB)
ttl_sDelete it this many seconds from now: 60 s to 90 days, or null for never
sleep_after_sPut it to sleep after this many idle seconds (0 = never, up to 7 days)
name, labelsFind it again later: GET /v1/sandboxes?label=team=ml
envEnvironment for every command
persistentKeep one container across execs, so installed packages and running processes stay
snapshotStart from a snapshot instead

Send an Idempotency-Key header and a retried create returns the first sandbox instead of a second one. Every field is in the API reference.

States#

creatingThe microVM is booting.
runningReady for exec, files, fork and checkpoints.
sleepingSaved and stopped. The next exec wakes it, memory included.
deletedGone, with its disk. Its record stays in the audit log.

You may also see expired (its ttl_s ran out), error, and paused or stopped; the API reference lists them all.

What lives where#

Each exec runs in the sandbox's container. Files under /workspace are kept for the whole life of the sandbox, and are what checkpoints, forks and snapshots carry. For processes that keep running between commands, create with persistent: true or use a background command.

Limits#

How many sandboxes can run at once, and how big, depends on your plan. A create past a limit is refused with 402 plan_limit and an upgrade_url, never silently queued. See limits.

Something wrong or missing? Edit this page, or write to contact@kosa8.com.

The kosa8 weekly

Agent security news, one industry deep-dive and a hands-on challenge, every Monday. Unsubscribe in one click.

© 2026 kosa8 · kosa8.com · AI Agent Sandbox: Secure and Sovereign for Enterprise · Local models served by llamay · Agent gateway: MAQPNA