Skip to content

Commit f563d23

Browse files
Sandbox updates (#2783)
Co-authored-by: Jo Franchetti <jofranchetti@gmail.com>
1 parent c844d43 commit f563d23

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

sandboxes/_data.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ export const sidebar = [
5959
title: "Examples",
6060
href: "/examples/#sandboxes",
6161
},
62+
{
63+
title: "Pricing",
64+
href: "https://deno.com/deploy/pricing/",
65+
},
6266
],
6367
},
6468
] satisfies Sidebar;

sandboxes/create.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,22 @@ process. You can tailor the sandbox by passing an options object.
2323
| Option | Description |
2424
| ---------- | ----------------------------------------------------------------------------------------------------------------------- |
2525
| `region` | Eg `ams` or `ord` |
26+
| `allowNet` | Array of hosts that can receive requests from the sandbox. If specified, any hosts not listed are unreachable. |
2627
| `memoryMb` | Allocate between 768 and 4096 MB of RAM for memory-heavy tasks or tighter budgets. |
2728
| `lifetime` | [How long the sandbox stays alive](./lifetimes) in (m) or (s) such as `5m` |
2829
| `labels` | Attach arbitrary key/value labels to help identify and manage sandboxes |
2930
| `env` | Set initial environment variables inside the sandbox. Secrets should still be managed via Deploy’s secret substitution. |
3031

3132
## Example configurations
3233

34+
### Allow outbound traffic to specific APIs
35+
36+
```tsx
37+
const sandbox = await Sandbox.create({
38+
allowNet: ["api.openai.com", "api.stripe.com"],
39+
});
40+
```
41+
3342
### Run in a specific region with more memory
3443

3544
```tsx
@@ -63,6 +72,7 @@ const sandbox = await Sandbox.create({
6372

6473
## Tips
6574

75+
- Keep `allowNet` as narrow as possible to block exfiltration attempts.
6676
- Use metadata keys such as `agentId` or `customerId` to trace sandboxes in the
6777
Deploy dashboard.
6878
- Let `await using` (or dropping the last reference) dispose of the sandbox

sandboxes/getting_started.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,15 @@ Details about the sandbox will be shown in its **Event log**.
8787
When creating a sandbox witb `Sandbox.create()`, you can configure it with the
8888
following options:
8989

90+
- `allowNet`: List of hosts that can receive outbound traffic from the sandbox.
9091
- `region`: Deploy region where the sandbox will be created.
9192
- `memoryMb`: Amount of memory allocated to the sandbox.
9293
- `lifetime`: Lifetime of the sandbox.
9394
- `labels`: Arbitrary key/value tags to help identify and manage sandboxes
9495

9596
```tsx
9697
await using sandbox = await Sandbox.create({
98+
allowNet: ["api.stripe.com", "api.openai.com"], // optional: list of hosts that this sandbox can communicate with
9799
region: "sjc", // optional: choose the Deploy region
98100
memoryMb: 1024, // optional: pick the RAM size (768-4096)
99101
});

sandboxes/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ Sandboxes have the following limits:
128128
- **Lifetime:** Configurable per sandbox and bound to a session, up to 30
129129
minutes
130130
- **Disk**: 10 GB of ephemeral storage
131+
- **Concurrency**: 5 concurrent sandboxes per organization (This is the default
132+
concurrency limit during the pre-release phase of Sandboxes. Contact
133+
[deploy@deno.com](mailto:deploy@deno.com) to request a higher limit.)
131134

132135
Exceeding these limits may result in throttling or termination of your sandbox.
133136

0 commit comments

Comments
 (0)