You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sandbox.mdx
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,20 +8,26 @@ description: "E2B sandboxes are persistent, secure cloud environments for AI age
8
8
An E2B sandbox is a persistent, secure cloud environment where your AI agents execute code, run commands, manage files, and access the internet. Every sandbox supports **pause and resume** — when a sandbox times out, it can automatically pause and preserve its full state (filesystem and memory), then resume exactly where it left off when activity arrives.
9
9
10
10
```mermaid actions={false}
11
-
flowchart LR
12
-
start(( )) -->|create| Running
13
-
Running -->|timeout or pause| Paused
14
-
Paused -->|connect or auto‑resume| Running
15
-
Running -->|snapshot| Snapshotting
16
-
Snapshotting -->|complete| Running
11
+
flowchart TD
12
+
start(( )) -->|Sandbox.create| Running
13
+
14
+
Running["<b>Running</b><br/>• Active execution<br/>• Consumes resources"]
15
+
Paused["<b>Paused</b><br/>• Preserves memory and files<br/>• Cannot execute code"]
Killed["<b>Killed</b><br/>• Resources released<br/>• Cannot be resumed"]
18
+
19
+
Running -->|pause| Paused
20
+
Running -->|createSnapshot| Snapshotting
21
+
Paused -->|connect| Running
22
+
Snapshotting -->|snapshot complete| Running
17
23
Running -->|kill| Killed
18
24
Paused -->|kill| Killed
19
25
```
20
26
21
27
## Key characteristics
22
28
23
29
-**Persistent by default** — configure `onTimeout: 'pause'` and sandboxes preserve their full state (filesystem + memory) indefinitely. Resume at any time.
24
-
-**Auto-resume** — paused sandboxes wake automatically when SDK calls or HTTP traffic arrive. No manual state management needed.
30
+
-**Auto-resume** — when [enabled](/docs/sandbox/persistence#auto-pause-and-auto-resume), paused sandboxes wake automatically when SDK calls or HTTP traffic arrive. No manual state management needed.
25
31
-**Snapshots** — capture a running sandbox's state and spawn multiple new sandboxes from it. Useful for checkpointing, forking, and rollback.
26
32
-**Configurable timeouts** — sandboxes run for up to 24 hours (Pro) or 1 hour (Base) continuously. Pausing resets the runtime window.
27
33
-**Isolated and secure** — each sandbox runs in its own microVM with network controls, access tokens, and rate limits.
0 commit comments