Prototyping sandboxes optimized for cold start.
Traforato is a Go prototype for short-lived sandbox lifecycle management.
It is split into:
broker(control plane): chooses a worker and redirects requests.worker(data plane): owns sandbox state, execution, files, and warm-pool behavior.
If you want internals and schematics, go straight to ARCHITECTURE.md.
Prerequisites:
- Go
1.24+ curljq(optional, used in examples)
Start broker + worker together:
go run ./cmd/devDefault local endpoints:
- Broker:
http://localhost:8080 - Worker:
http://localhost:8081
Create a sandbox through the broker (it redirects to the worker):
SANDBOX_ID=$(
curl -sS -L -X POST http://localhost:8080/sandboxes \
-H 'content-type: application/json' \
-d '{"image":"alpine:3.20","cpu":1}' \
| jq -r '.sandbox_id'
)
echo "$SANDBOX_ID"Run code in that sandbox:
curl -sS -L -X POST "http://localhost:8080/sandboxes/$SANDBOX_ID/exec/code" \
-H 'content-type: application/json' \
-d '{"runtime":"python","code":"print(\"hello from traforato\")"}'Delete the sandbox:
curl -sS -L -X DELETE "http://localhost:8080/sandboxes/$SANDBOX_ID"Start broker:
go run ./cmd/brokerStart worker:
go run ./cmd/workerStart worker with a YAML config:
go run ./cmd/worker --file ./worker.yamlMinimal worker.yaml example:
broker-id: broker_local
broker-control-url: http://localhost:8080
worker-id: worker_local
hostname: localhost
hardware-sku: cpu-standard
virtualization: vetu
total-cores: 8
total-memory-mib: 16384
max-live-sandboxes: 6
default-ttl: 30m
registration-heartbeat: 30s
registration-jitter-percent: 20cmd/dev also accepts --file (or TRAFORATO_DEV_WORKER_CONFIG) and applies worker config values in local development.
| Mode | Condition | Behavior |
|---|---|---|
dev |
TRAFORATO_JWT_SECRET is empty |
No JWT enforcement (local dev default). |
prod |
TRAFORATO_JWT_SECRET is set |
JWT validation + ownership checks on worker APIs. |
Optional auth env vars:
TRAFORATO_JWT_SECRETTRAFORATO_JWT_ISSUERTRAFORATO_JWT_AUDIENCE
Main public routes:
POST /sandboxesGET /sandboxes/{sandbox_id}PATCH /sandboxes/{sandbox_id}/leaseDELETE /sandboxes/{sandbox_id}PUT|GET|DELETE /sandboxes/{sandbox_id}/files?path=...GET /sandboxes/{sandbox_id}/files/stat?path=...GET /sandboxes/{sandbox_id}/files/list?path=...POST /sandboxes/{sandbox_id}/files/mkdirPOST /sandboxes/{sandbox_id}/execPOST /sandboxes/{sandbox_id}/exec/codeGET /sandboxes/{sandbox_id}/exec/{exec_id}GET /sandboxes/{sandbox_id}/exec/{exec_id}/framesANY /sandboxes/{sandbox_id}/proxy/{port}[/{path...}]GET /sandboxes/{sandbox_id}/ports/{port}/url?protocol=http|https|ws|wssGET /metrics/sandboxes(unauthenticated broker availability metrics)
Full endpoint list, routing behavior, and internal control-plane APIs are documented in ARCHITECTURE.md.
Create defaults:
virtualizationdefaults tovetu.- If
virtualization=tartandimageis omitted,imagedefaults toghcr.io/cirruslabs/macos-tahoe-base:latest.
Tagging vX.Y.Z triggers release automation:
- Goreleaser builds
traforato-brokerandtraforato-worker. - Docker Buildx publishes multi-arch images to GHCR (
:vX.Y.Zand:latest).
Dry-run release validation runs on PRs and non-tag pushes to main.
This is a v1 prototype with:
- In-memory state
- Single active broker model