# Sandboxes

A sandbox is an isolated machine in the cloud that runs code away from your own. You, your code or an agent **creates** one, then **runs** commands in it. A sandbox offers a shell to run commands, files to read and write and an address to serve on.

## Before you start

You need a Veryfront account. [Sign in](/sign-in) or create one.

## What a sandbox has

| Part    | What it does                                                                           |
| ------- | -------------------------------------------------------------------------------------- |
| Shell   | Runs commands in `/workspace`                                                          |
| Files   | Temporary: they can go when it restarts or stops, unless it has a persistent workspace |
| Address | Serves what runs in it, such as `https://3218467769.sandbox.veryfront.com`             |

## Ways to use one

| From          | With                                           |
| ------------- | ---------------------------------------------- |
| Studio        | **Runtime** > **Sandboxes**, and its **Shell** |
| Your code     | `Sandbox` from `veryfront/sandbox`             |
| The API       | `POST /sandboxes`                              |
| An MCP client | `veryfront__create_sandbox`                    |

A new sandbox takes a minute or two to read **Running**, and runs commands from then.

## Sharing and billing

| Sharing          | Who can use it                      |
| ---------------- | ----------------------------------- |
| **Only me**      | You, who created it                 |
| **With my team** | Everyone with access to the project |

Every sandbox belongs to a project, and the project's owner is billed for it.

## Lifetime

| Lifetime                | The sandbox stops                                        |
| ----------------------- | -------------------------------------------------------- |
| Stop after idle timeout | When it idles. A heartbeat from your code keeps it alive |
| Stop after 4 hours      | After 4 hours, or up to 24 from the API                  |
| Always on               | Never, until you delete it (**With my team** only)       |

## Choose a task

* [Run code](/docs/sandboxes/run-code.md)

  Run commands from your own code.

* [Open a sandbox shell](/docs/sandboxes/project.md)

  Run commands in a shell in Studio.

## Next steps

* [Run code](/docs/sandboxes/run-code.md)
