Expose a single unified remote environment to chat.letta.com while isolating every Letta conversation (conversation_id) inside its own ephemeral Microsandbox (msb) microVM running an unmodified letta server.
Works on macOS (Apple Silicon) and Linux (KVM) using the official multi-arch ghcr.io/letta-ai/letta-code:latest OCI image, with host-side secret injection so your LETTA_API_KEY stays on the host and never enters the microVM.
- macOS on Apple Silicon, or Linux with KVM
- Bun 1.4+
Install globally from GitHub with Bun (includes both the bundled Letta CLI and Microsandbox runtime—no separate letta or msb install required):
# Latest release
bun install -g github:kaaloo/lettabox#lettabox-v0.4.0
# Or latest main
bun install -g github:kaaloo/lettaboxOr install from a local clone for development:
git clone https://github.com/kaaloo/lettabox.git
cd lettabox
bun install --frozen-lockfile
bun linklettaboxOn startup, lettabox:
- Loads your Letta token from
LETTA_API_KEYor~/.letta/settings.json(in an interactive terminal, automatically runsletta loginif you aren't signed in yet). - Starts a managed local control-plane
letta server. - Verifies the matching Microsandbox runtime under
~/.lettabox/microsandbox(isolated from any existing~/.microsandboxinstall), pre-pullsghcr.io/letta-ai/letta-code:latestif not cached, caches the pinned official LinuxghCLI binary (SHA-256 verified) under$MSB_HOME/cache/gh/and injects it into every microVM at/usr/local/bin/ghbefore boot, and pre-warms a standby microVM so the first conversation hands off immediately. - Connects to Letta Cloud—your computer appears under Computers on
chat.letta.comwith a📦status subtitle (e.g.📦 MacBook Pro · Apple M5 Pro · 24 GB).
Every conversation gets its own isolated microVM and is automatically reaped after 30 minutes of inactivity (never mid-turn).
To inspect active microVMs from a local clone (or query /status with --status-port):
MSB_HOME="$HOME/.lettabox/microsandbox" bunx msb list --label letta-sandbox.managed=truelettabox is a drop-in replacement for letta server in desktop wrappers such as letta-server-macos-menubar:
- Supports
--computer-name <name>and--lifecycle-output jsonl(lettaLifecycleProtocol: 1state transitions:starting→ready↔working/reconnecting/error/stopped). - Exposes an optional loopback-only HTTP status server via
--status-port:
lettabox --computer-name "My MacBook Pro" --status-port 4590GET http://127.0.0.1:4590/healthz→200 okGET http://127.0.0.1:4590/status→ JSON snapshot (connectionName,sandboxMode,upstreamReady,uptimeMs,activeSandboxes[])
Warning
The status server has no authentication and binds to loopback (127.0.0.1) only. Do not expose it to a network or reverse proxy.
Run lettabox --help for the full flag list.
| Flag / Alias | Environment Variable | Default | Description |
|---|---|---|---|
--name, --computer-name |
LETTA_CONNECTION_NAME |
lettabox-<hostname> |
Display name shown in chat.letta.com |
--mode |
SANDBOX_MODE |
microsandbox (CLI) / static |
microsandbox (msb) or static (WORKER_URLS) |
--image |
SANDBOX_IMAGE |
ghcr.io/letta-ai/letta-code:latest |
OCI image for ephemeral conversation microVMs |
--memory |
SANDBOX_MEMORY_LIMIT |
2G |
Memory limit per microVM |
--cpus |
SANDBOX_CPU_LIMIT |
2 |
vCPU limit per microVM |
--idle-timeout |
SANDBOX_IDLE_TIMEOUT_MS |
1800000 (30m) |
Idle duration before an inactive conversation microVM is reaped |
| — | SANDBOX_WARM_POOL_SIZE |
1 |
Number of pre-warmed standby microVMs kept ready (0 to disable) |
--control-plane-url |
CONTROL_PLANE_URL |
(auto-spawned) | Attach to an existing letta server --listen instead of auto-spawning |
--status-port |
STATUS_PORT |
(disabled) | Expose local http://127.0.0.1:<port>/status JSON endpoint |
--lifecycle-output jsonl |
— | (disabled) | Emit lettaLifecycleProtocol: 1 JSONL state transitions on stdout |
--msb-path |
MSB_PATH |
(SDK-bundled runtime) | Advanced override for the msb runtime binary |
| — | MSB_HOME |
~/.lettabox/microsandbox |
Microsandbox runtime/state home, isolated from existing ~/.microsandbox |
--letta-bin |
LETTA_BIN |
(bundled @letta-ai/letta-code) |
Override the bundled letta binary for the control-plane and letta login |
--debug |
DEBUG_FRAMES |
false |
Log routed frame envelope summaries and event_seq rewrites |
| — | LETTA_API_KEY |
~/.letta/settings.json |
Letta Cloud API key (auto-loaded from letta login settings if unset) |
| — | MSB_SECRET_INJECTION |
true |
Inject LETTA_API_KEY at the host network boundary for HTTPS Letta servers |
| — | WORKER_URLS |
(empty) | Comma-separated static worker URLs when --mode static |
.env.example documents placeholder-only local configuration. Never commit real credentials; .env, key material, and private/ are gitignored.
flowchart TB
Cloud["chat.letta.com / Letta Cloud Relay"]
Mux["lettabox\n(Envelope Router + monotonic event_seq)"]
CP["Control-Plane\n1 managed letta server --listen"]
VM1["Microsandbox microVM A\nconv-A • letta server --listen"]
VM2["Microsandbox microVM B\nconv-B • letta server --listen"]
Cloud <-->|"1 paired-generation split WS\n(control + stream)"| Mux
Mux <-->|"unscoped / conv=default /\nstateless CRUD / PTY"| CP
Mux <-->|"conv-A frames"| VM1
Mux <-->|"conv-B frames"| VM2
- Architecture & Protocol RFC for Letta — design overview, live Protocol V2 findings, security model, and upstream integration options.
- Milestone 1: Protocol Inspection Notes — verified upstream
letta-ai/letta-codetransport, registration, split-channel, heartbeat, routing envelope, andevent_seqfindings. - Original POC Specification — initial goals and milestones.
Prerequisites: Bun 1.4.4 (pinned in package.json), uv (for pre-commit), and Go (for the Gitleaks hook).
bun install --frozen-lockfile
uv tool install pre-commit
pre-commit install --install-hooksRun the same checks as CI:
bunx biome ci .
bun run typecheck
bun test
bun run smokeUse bun run check --write to apply Biome formatting and lint fixes. There is no separate build step; Bun executes the TypeScript CLI directly.
To run the security hooks manually:
pre-commit run gitleaks
pre-commit run cve-lite --all-files --hook-stage pre-push- CI: PRs and
mainpushes run Biome, TypeScript, Bun tests, a CLI smoke check, full-history Gitleaks, and OSV-Scanner (also scheduled weekly). - Dependencies: Bun enforces a seven-day minimum release age, saves exact versions, and restricts lifecycle scripts to
trustedDependencies. Dependabot covers Bun, pre-commit, and GitHub Actions with the same cooldown. - Releases:
release-pleasemaintains versioned GitHub Release PRs onmain(this repo runs locally and pulls the official Letta Code OCI image at runtime).
Report vulnerabilities privately through GitHub's Security → Advisories → Report a vulnerability flow. See SECURITY.md for scope and reporting details.
MIT; see LICENSE.