System diagram
Component breakdown
Control plane (Helm-deployed)
| Component | Path | Role |
|---|---|---|
| Sandbox Manager | infra/sandbox-manager/ | REST API (Gin framework) on port 8080, authentication, sandbox + template CRUD, tier enforcement |
| Node Collector | infra/node-collector/ | Worker state repository on port 8090, tracks live sandboxes across orchestrator nodes |
| Guardrails | infra/guardrails/ | FastAPI ML scanner service on port 8000 — PII, prompt injection, toxicity, code security, invisible text |
| Shared | infra/shared/ | Common Go library — models, auth, blobstore, telemetry |
Orchestration (bare metal)
| Component | Path | Role |
|---|---|---|
| Orchestrator | infra/orchestrator/ | Firecracker VM lifecycle on port 9090, network namespace management, per-sandbox security proxy, template caching |
| envd | infra/orchestrator/envd/ | In-VM daemon, ConnectRPC on port 49983, filesystem API, process management, PTY support — bundled into the rootfs image |
SDKs
| Module | Path | Role |
|---|---|---|
| Python — sync | python-sdk/declaw/sandbox_sync/ | Synchronous sandbox API |
| Python — async | python-sdk/declaw/sandbox_async/ | Async mirror of all sync APIs |
| Python — security | python-sdk/declaw/security/ | SecurityPolicy, PIIConfig, NetworkPolicy, etc. |
| TypeScript | ts-sdk/src/ | Promise-based sandbox API with full TS types |
Request flow
End-to-end flow forSandbox.create() followed by sandbox.commands.run():
Monorepo structure
Key design decisions
Firecracker for isolation (not Docker)
Firecracker for isolation (not Docker)
Docker containers share the host kernel. A container escape exploit gives an attacker access to the host. Firecracker microVMs have a hardware isolation boundary — each VM has its own kernel, memory space, and I/O devices. A compromised sandbox cannot escape to the host or to other sandboxes.
Per-sandbox network namespaces
Per-sandbox network namespaces
Each sandbox gets its own Linux network namespace with a dedicated veth pair and TAP device. Sandboxes cannot see each other’s network traffic, cannot reach each other’s IPs, and cannot intercept host-level network interfaces.
In-VM security proxy (not host-level)
In-VM security proxy (not host-level)
The security proxy runs inside each Firecracker VM, not on the host. This means the security policy enforcement is co-located with the workload — it cannot be bypassed by the orchestrator or other components. The per-sandbox CA certificate is generated fresh for each sandbox and injected into the VM trust store at boot.
OverlayFS for rootfs isolation
OverlayFS for rootfs isolation
The base rootfs image is read-only and shared across all sandboxes. Each sandbox gets a writable overlay layer (ext4 image) on top. This makes sandbox creation fast (no full copy) and guarantees filesystem isolation. Destroying a sandbox deletes only the overlay layer.
Fail-fast on proxy errors
Fail-fast on proxy errors
If the security proxy fails to start or configure iptables, the sandbox creation fails with an error. There is no “log and continue” path — a sandbox without a functioning security proxy is considered unsafe and never reaches the
running state.Architecture sub-pages
| Page | What it covers |
|---|---|
| Firecracker | MicroVM internals: rootfs, TAP networking, boot process, envd |
| Security Proxy | MITM TLS, certificate generation, scanning pipeline |
| Packet Flow | Network packet diagrams: iptables, TCP proxy, HTTP/HTTPS flows |