Freestyle provides performant ephemeral VMs that are full linux systems. Freestyle is ideal when you want to give your AI a whole computer, not just run code snippets. This guide shows the full end-to-end flow: use the Mesa SDK outside the sandbox to set up resources, then use the Freestyle SDK to configure and mount Mesa inside the sandbox. The general flow for any sandbox integration is:Documentation Index
Fetch the complete documentation index at: https://docs.mesa.dev/llms.txt
Use this file to discover all available pages before exploring further.
- Outside the sandbox — use the Mesa SDK (TypeScript or Python) to create repos, manage API keys, and orchestrate your workflow.
- Inside the sandbox — install the
mesaCLI, configure it with your API key, and runmesa mount --daemonizeto mount your repos as local directories. - Run your agent —
cdinto the mount path and launch your agent (e.g. Claude Code, Codex, or a custom agent). Any file edits are automatically persisted back to Mesa.
Setup
The example uses three environment variables:Example Code
Freestyle sandboxes are Debian-based by default, so the standard Mesa install script works out of the box.Tips
- Prefer short-lived scoped keys in production. The example uses
MESA_API_KEYdirectly to stay small, but production flows should mint an ephemeral key outside the VM and pass that intoMESA_ORGS. See Auth and Permissions for details. - Install Mesa ahead of time when startup time matters. Installing at runtime is fine for a demo, but preinstalling Mesa and its dependencies makes VM startup faster and more predictable.
- Always use
--daemonize. This keeps Mesa mounted while your shell or agent continues to run. - Don’t forget
user_allow_other. See CLI Mounts for the most common FUSE setup issue in sandbox environments. - Expect mount paths to depend on the VM user. In this example the VM runs as
root, so Mesa mounts under/root/.local/share/mesa/mnt.

