- Outside the sandbox — use the Mesa SDK (TypeScript or Python) to create repos, sign a short-lived access token, and orchestrate your workflow.
- Inside the sandbox — install the
mesaCLI, pass the token in asMESA_ACCESS_TOKEN, and runmesa mount --daemonize. - Run your agent —
cdinto the mount path and launch your agent (ex. Claude Code, Codex, or a custom agent). Any file edits are automatically persisted back to Mesa.
Sandbox setup
Superserve sandboxes run on a FUSE-enabled kernel, and the Mesa installer apt-installsfuse3 as a dependency, so the standard Mesa install script works on every Superserve template out of the box. Because Superserve sandboxes are full Firecracker microVMs, you don’t need user_allow_other or chmod 666 /dev/fuse.
The layout scopes the token: it can reach the repositories the layout declares
and nothing else. A plain
mesa mount then shows exactly those repositories
under the organization browse tree. To mount the layout’s own paths instead,
serialize workspace.layout() with JSON.stringify(...) in TypeScript or
json.dumps(...) in Python, write it into the sandbox, and mount with
mesa mount --layout <file>.Custom template
For faster startup, pre-install the Mesa CLI into a custom Superserve template so each sandbox boots with the Mesa CLI already installed:Tips
- Use scoped, short-lived access tokens. Sign a dedicated token for each sandbox session with only the scopes it needs. It’s signed locally with your private key (which never enters the sandbox) and expires on its own. See Authentication for details.
- Pick a TTL that covers the session. Tokens default to a 15 minute TTL and max out at 4 hours, and a mount keeps the token it started with for its whole lifetime. If the token expires mid-session, filesystem operations in the sandbox start failing with authentication errors; mint a fresh token on the host and remount.
- Use
--daemonize. Always runmesa mount --daemonizein sandbox environments so Mesa runs as a background process and doesn’t block your agent’s terminal. - Build a custom template for production use. Pre-installing the Mesa CLI avoids the install overhead on every sandbox creation.
- Mount path follows
$HOME. Superserve’s guest agent setsHOME=/home/user, so the mount lands at/home/user/.local/share/mesa/mnt/<org>/<repo>. Use~/.local/share/mesa/mnt/...and it resolves correctly.

