Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions templates/presets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# E2B Policy Presets (experimental)

Opinionated, enterprise-ready sandbox policy presets. Select a preset by name
instead of hand-editing source.

| Preset | Internet | Code exec | GPU | Intended use |
|---|---|---|---|---|
| `locked-down` | blocked | restricted | no | regulated / offline evaluation |
| `internet-enabled` | allowed | standard | no | research assistants, web tools |
| `gpu-enabled` | allowed | standard | yes | training, inference, vision |

Presets are JSON files in this directory. A preset is a documented *contract*,
not a runtime; the platform integration layer reads the file and applies the
corresponding sandbox flags.

## Selecting a preset

```bash
# future CLI (planned)
e2b template create --preset locked-down my-template

# today: reference the JSON file directly in your template config
cat templates/presets/locked-down.json
```

## Status

Minimum delighter slice (Wave 3 P1). Presets are documented and testable but
are not yet wired into the sandbox runtime. See `tests/presets.test.json` for
schema coverage.
24 changes: 24 additions & 0 deletions templates/presets/gpu-enabled.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "gpu-enabled",
"description": "GPU-attached environment for training, inference, and vision workloads. Outbound internet allowed.",
"network": {
"egress": "allow",
"allowlist": ["*"],
"audit": true
},
"runtime": {
"allow_shell": true,
"allow_package_install": true,
"max_processes": 128,
"max_memory_mb": 16384
},
"gpu": {
"enabled": true,
"min_vram_gb": 16
},
"audit": {
"log_stdout": true,
"log_stderr": true,
"retention_days": 14
}
}
23 changes: 23 additions & 0 deletions templates/presets/internet-enabled.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "internet-enabled",
"description": "Outbound internet allowed with an egress audit log. Standard code execution. No GPU.",
"network": {
"egress": "allow",
"allowlist": ["*"],
"audit": true
},
"runtime": {
"allow_shell": true,
"allow_package_install": true,
"max_processes": 64,
"max_memory_mb": 4096
},
"gpu": {
"enabled": false
},
"audit": {
"log_stdout": true,
"log_stderr": true,
"retention_days": 14
}
}
22 changes: 22 additions & 0 deletions templates/presets/locked-down.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "locked-down",
"description": "Offline, no network egress, restricted code execution. For regulated workloads and evaluation harnesses.",
"network": {
"egress": "deny",
"allowlist": []
},
"runtime": {
"allow_shell": false,
"allow_package_install": false,
"max_processes": 16,
"max_memory_mb": 2048
},
"gpu": {
"enabled": false
},
"audit": {
"log_stdout": true,
"log_stderr": true,
"retention_days": 30
}
}
5 changes: 5 additions & 0 deletions templates/presets/presets.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$comment": "Minimal schema coverage for policy presets. Asserts required keys on every preset.",
"required_keys": ["name", "description", "network", "runtime", "gpu", "audit"],
"presets": ["locked-down", "internet-enabled", "gpu-enabled"]
}
Loading