---
agent:
  instructions: "Use this search API to find Volcano documentation, blog posts, and cookbook recipes with keywords or a natural-language question, instead of crawling individual pages. Results are markdown: the best-matching pages with the sections that matched, and a link to each page's full markdown."
  endpoint: "https://volcano.dev/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://volcano.dev/docs/cli/docs-search#search-from-an-agent-over-http"
---

# Sandboxes for AI Agents | Volcano

URL: https://volcano.dev/features/sandboxes

> Run LLM-generated code in an isolated VM. Keep files across commands, suspend between tasks, and use Python, Node.js, or custom dependencies.

## Give your agent a computer

Each session is an isolated VM where your agent runs code, edits files and previews apps.

Image: The Volcano dashboard listing sandbox sessions and their state.

## Generated code gets its own place to run

Run one snippet in a temporary sandbox, or keep a session and reuse its files and processes across steps.

- **Isolated**: Each hosted session runs in its own VM.
- **Persistent**: Files in /workspace survive between commands.
- **Suspendable**: Pause between tasks; suspended time is not charged.

Image: The Volcano dashboard listing sandbox sessions and their state.

## What you need

- **A Volcano account**: Sign up from the CLI.
- **Volcano CLI**: Install with npm.
- **A preset**: python3.12 or node22 to start.

## Try it

### 1. Run one command

A temporary VM is created and terminated when the command finishes.

bash

```bash
volcano cloud sandboxes exec --preset python3.12 -- python -c 'print(6 * 7)'
```

### 2. Keep a session

Files and processes stay in place across commands.

bash

```bash
volcano cloud sandboxes run --preset node22
volcano cloud sandboxes exec SESSION_ID -- node -e 'console.log(process.version)'
```

### 3. Suspend and resume

Pick up where the agent left off.

bash

```bash
volcano cloud sandboxes suspend SESSION_ID
volcano cloud sandboxes resume SESSION_ID
```

## Check it works

- The one-shot command prints 42, then its VM is terminated.
- Write a file in one command and read it in the next.
- After you suspend and resume, your files are still in /workspace.

## Works with

- [Functions](https://volcano.dev/features/edge-functions): Manage sessions with a key kept on the server.
- [Durable functions](https://volcano.dev/features/durable-functions): Retry workflow steps without running code twice.
- [Authentication](https://volcano.dev/features/authentication): Grant signed-in users access to one session.
- [File storage](https://volcano.dev/features/file-storage): Save results before the session is terminated.

## Frequently asked questions

### How do I run LLM-generated code safely?

Run it in a hosted sandbox, where each session gets its own VM. Local sandboxes from volcano start are Docker containers that share your kernel.

### When should I use a session instead of one-shot execution?

Use a session when commands need to share files or a running process. Use one-shot execution for a single snippet.

### What are the memory and time limits for a sandbox?

Hobby allows 1 GiB and a one-hour lifetime. Superagent allows 2 GiB and eight hours. The lifetime keeps counting while suspended.

## Get started

Build with Sandboxes. Create a free account at https://volcano.dev/signup, or have your coding agent follow the setup playbook at https://volcano.dev/setup.md.
