New

Sandboxes, in private preview: isolated microVMs for AI agents, compatible with the E2B SDKs.Read more

Serenity Edge

Serenity Edge Sandboxes

Isolated microVMs for your AI agents

Private preview

Sandboxes gives the code your agents write a machine of its own: a Linux microVM with its own kernel, memory and disk, created through an API and gone when you kill it. It is compatible with E2B, so the official E2B SDKs work with your Serenity Edge API key.

Sandboxes is in private preview: access is on request and enabled per account.

Already on E2B? Change two lines
pip install e2b    # Python
npm install e2b    # TypeScript

export E2B_DOMAIN="serenityedge.ai"
export E2B_API_KEY="$SERENITY_EDGE_API_KEY"

The rest of your code does not change. The SDK manages your sandboxes through https://api.serenityedge.ai, the same API and key as inference, and reaches each sandbox at the address the API gives it.

Compatible with E2B
The official E2B SDKs for Python and TypeScript work as they are: point them at the Serenity Edge domain and use your Serenity Edge API key.
One machine per sandbox
Each sandbox is a microVM of its own, with its own kernel, memory and disk, so the code it runs stays away from your systems.
Billed per second
Reserved vCPU and memory are billed per second while a sandbox runs, with no minimum. A paused sandbox keeps its files, memory and running processes.

Your first sandbox, step by step

The quickstart’s whole lifecycle with the official E2B SDK: create a sandbox, run a command, pause it, resume it and kill it. The panel shows what the program prints, what the sandbox keeps at each step and what it is billed.

PythonRunningPausedKilledWhole run
from e2b import Sandbox sandbox = Sandbox.create(timeout=300)result = sandbox.commands.run("echo hello from the sandbox")print(result.stdout) sandbox.commands.run("echo kept across the pause > /home/user/note.txt")sandbox.pause() sandbox = Sandbox.connect(sandbox.sandbox_id, timeout=300)print(sandbox.commands.run("cat /home/user/note.txt").stdout) sandbox.kill()

Output

hello from the sandboxkept across the pause

In the sandbox

  • note.txt
  • Memory
  • Processes

A paused sandbox keeps its files, memory and running processes, and resumes as it was.

A fresh machine from the default template.

The second command wrote /home/user/note.txt.

Paused: files, memory and processes are kept.

Resumed as it was: /home/user/note.txt is still there.

Killed: memory and disk are discarded.

Running
930 s
Paused
48 h
Billed (USD)
0.03704016

At the published prices: 0.000037 USD per second running (2 vCPU and 2 GiB), 0.08 USD per GiB-month paused. The times and amounts are the documentation’s worked example, sped up, not measurements: 630 s running, 48 hours paused with 0.5 GiB stored and 300 s running again, 0.03704016 USD in all. See the worked example

TypeScript
import { Sandbox } from 'e2b'

let sandbox = await Sandbox.create({ timeoutMs: 300_000 })
const result = await sandbox.commands.run('echo hello from the sandbox')
console.log(result.stdout)

await sandbox.commands.run('echo kept across the pause > /home/user/note.txt')
await sandbox.pause()

sandbox = await Sandbox.connect(sandbox.sandboxId, { timeoutMs: 300_000 })
console.log((await sandbox.commands.run('cat /home/user/note.txt')).stdout)

await sandbox.kill()

The preview is tested with the official E2B SDK for Python, version 2.63.0. Every endpoint and option is in the quickstart.The whole lifecycle in Python, JavaScript and curl

What your agents can do in a sandbox

A sandbox is where an agent carries out what it decides, with no access to your infrastructure. Each use leads to an example: a live demo in the playground or the section of the documentation that shows it.

  • Run the code an agent writes

    The agent writes a script, runs it in a sandbox and reads the output and the errors, with the state kept from one step to the next.

  • Analyse data

    Upload a file, run Python on it and return the result, without giving the agent access to your own servers.

  • Browse with a headless browser

    Open public websites with the template’s headless browser to read pages, check content or test a web app.

  • Run build and test jobs

    Clone a repository over HTTPS, install its dependencies, build it and run its tests in a clean machine every time, as a CI job would.

  • Give an agent a shell and files

    Commands, a file system and an interactive terminal that an agent can use as tools, with the state kept between calls.

  • Pause long tasks

    Pause a sandbox while the agent waits for a person or for another system, and resume it with its memory, disk and processes as they were.

Live in the playground

A sandbox reads today’s web

A real sandbox of the default template opens a page of today with its headless browser, reads it and is deleted, and a model writes a short note from what it read. Each step shows as it happens, with what it cost.

Try it in the playground

How it works

  1. Step 1

    Request access

    Ask for Sandboxes on your account. Once it is enabled, your Serenity Edge API key works for sandboxes as well as for inference.

  2. Step 2

    Point the E2B SDK at Serenity Edge

    Set E2B_DOMAIN to the Serenity Edge domain and E2B_API_KEY to your key. The rest of your code does not change.

  3. Step 3

    Create, run, pause and kill

    Create a sandbox, run commands and work with its files through the SDK. Pause it to keep its files, memory and running processes, resume it later, and kill it when the task is done.

The default template

Unless you name a desktop template (below), every sandbox starts from this template, made for agents.

vCPU
2
Memory
2 GiB
Disk
20 GB
System
Ubuntu 24.04
Tools for agents
git, Python, Node.js, compilers and a headless browser
Inside a sandbox
Commands, files and a terminal through the SDK, over HTTPS. No SSH.
Outbound access
HTTP and HTTPS only, to public addresses. Private address ranges are refused.
Pause and resume
A paused sandbox keeps its files, memory and running processes for up to 30 days, and resumes as it was. It is billed until you kill it or it expires.

Everything the template includes

Desktops for computer use

Private preview

A desktop sandbox is a sandbox with a full Linux desktop, for agents that work as a person does: take a screenshot, decide where to click or what to type, act and look again. It is an isolated microVM like every sandbox, with the same domain and key.

  • Ubuntu 24.04 with XFCE, Firefox ESR, Chromium and LibreOffice, and everything in the default template.
  • Driven with the official E2B desktop SDK: e2b-desktop for Python and @e2b/desktop for TypeScript.
  • A pause keeps the whole desktop, with its applications and windows as they were.
Desktop templates
TemplateSizePer hour running (USD)
desktop4 vCPU, 4 GiB0.2664
desktop-lite2 vCPU, 4 GiB0.1656

Billed like any sandbox of the same size, per second, at the prices below.

Isolation and security

How a sandbox is kept apart, as the documentation states it. The independent security testing of the preview is not finished yet: see what to know about the preview below.

  • One microVM per sandboxA sandbox shares no kernel, memory or disk with any other sandbox, of your account or of another.
  • Your account onlyOnly the account that created a sandbox can manage it, with its API key. Any other key is answered as if the sandbox did not exist.
  • Tokens per sandboxCommands, files and ports need that sandbox’s own access tokens. Nothing inside a sandbox needs your API key, so keep it outside.
  • Internet only if you want itPublic websites and APIs over HTTP and HTTPS, through Serenity Edge’s egress proxy, or no internet access at all, chosen when you create the sandbox.
  • Your work is not loggedThe commands you run, their arguments, environment variables and the contents of files are not written to Serenity Edge’s logs.
  • Network access and securityData protection at Serenity Edge

Limits and location

Each account has these limits during the preview. They may change while the preview lasts.

Running at once
48 sandboxes
Per account. Paused sandboxes do not count.
Created per minute
60 sandboxes
Per account.
Longest run
24 hours
Per sandbox. Set a timeout on each one: it is killed when the timeout runs out.
Where they run
European Union
One site, on Substrate AI’s own infrastructure.

All limits and quotas

What to know about the private preview

Private preview

The preview is for development and evaluation. Plan for these limitations:

  • Security testing is not finished yet: do not put production secrets or personal data in a sandbox.
  • No backups yet: if the site’s storage fails, paused sandboxes can be lost with their files and memory. Keep anything you need outside the sandbox.
  • One site, in the European Union.
  • Limits may change during the preview.
  • No service level during the preview.
  • Three public templates, each with its own size: the default template and the two desktops.
  • Your own templates, saved from a sandbox you have set up, are enabled on request, per account.

Prices

You pay for the vCPU and memory reserved for a sandbox while it runs, and for what a paused sandbox stores.

Sandboxes prices
What is billedWhenPrice (USD)
Reserved vCPURunning0.0504per vCPU-hour
Reserved memoryRunning0.0162per GiB-hour
StoragePaused0.08per GiB-month
Storage of your own templates, on requestSaved template0.08per GiB-month
  • Billed per second, with no minimum: a sandbox that runs for three seconds is billed for three seconds.
  • For scale, a sandbox of the default template costs 0.1332 USD for each hour it runs.
  • There is no welcome credit for Sandboxes.
  • Your own templates are enabled on request, per account. What a template stores, its memory and the changes to its disk, is billed at the price of a paused sandbox until you delete it.

Pricing and usage, with a worked example

Questions about Sandboxes

Do I need a separate key for sandboxes?

No. Once Sandboxes is enabled on your account, the Serenity Edge API key you use for inference works for sandboxes too. Sandboxes take Serenity Edge API keys only.

What changes in my E2B code?

Two settings: E2B_DOMAIN set to serenityedge.ai and E2B_API_KEY set to your Serenity Edge API key. The official E2B SDKs do the rest; the preview is tested with the SDK for Python, version 2.63.0.

What can a sandbox reach?

Public websites and APIs over HTTP and HTTPS, and nothing else: no SSH, no other ports and no private address ranges, so clone repositories and install packages over HTTPS. You can also create a sandbox with no internet access at all.

What does a paused sandbox keep, and for how long?

Its files, memory and running processes, for up to 30 days. It is billed for what it stores until you resume it, kill it or it expires. During the preview paused sandboxes are not backed up: keep anything you need outside the sandbox.

How do I make sure I stop paying?

Kill a sandbox when its task is done: billing stops there. Set a timeout on each sandbox, after which it is killed; a sandbox runs for 24 hours at most. The preview has no spending cap.

Can I use my own template or a bigger sandbox?

Your own templates, yes, on request: once they are enabled on your account, save a sandbox you have set up as a private template and create sandboxes from it, each with the size of the sandbox it was saved from. A bigger sandbox, not in the preview: a sandbox has the size of its template, 2 vCPU and 2 GiB of memory for the default template, or the size of one of the two desktop templates.

Where do sandboxes run?

In the European Union, in one site on Substrate AI’s own infrastructure.

Can an agent use a graphical desktop?

Yes: create a sandbox from one of the desktop templates with the official E2B desktop SDK. The agent sees the screen in screenshots and acts with the pointer and the keyboard.

Request access to the private preview

Tell us what your agents will run. Sandboxes is enabled per account, and your Serenity Edge API key then works for both inference and sandboxes.