muse template with Muse Code already installed.
CLI
Create a sandbox with the E2B CLI.Run headless
Usemuse exec for non-interactive mode and --yolo to skip approval prompts, disable Muse Code’s own OS sandbox, and trust the workspace. The E2B sandbox is the isolation boundary here, so Muse Code’s built-in sandbox is not needed. The sandbox isolates the agent from your host machine, but sandboxes can reach the open internet by default; restrict outbound traffic with network rules. Muse Code authenticates with an API key from the Meta Model API dashboard via the META_API_KEY environment variable.
Auto-approving tool calls is contained by the sandbox: the agent cannot touch your host machine, local files, or credentials. It can still make outbound network requests, since internet access is enabled by default. To limit where an auto-approved agent can connect, configure outbound network rules (
allowInternetAccess, plus allow/deny lists by CIDR or hostname). Hostname rules apply to HTTP(S) traffic only; use CIDR rules for other protocols.--json to emit machine-readable JSONL events instead of plain text, and --max-model-steps to cap a run that would otherwise loop.
Example: work on a cloned repository
Build a custom template
If you need to customize the environment (e.g. pre-install dependencies, add config files), build your own template on top of the pre-builtmuse template.
Related guides
Sandbox persistence
Auto-pause, resume, and manage sandbox lifecycle
Git integration
Clone repos, manage branches, and push changes
SSH access
Connect to the sandbox via SSH for interactive sessions