comeonoliver/skillshub/agent-sandboxes
Claude Code and agent skill by comeonoliver/skillshub
- community
Checking that the SKILL.md file is still in the repository.
Operate E2B agent sandboxes using the CLI. Use when user needs to run code in isolation, test packages, execute commands safely, or work with binary files in a sandbox environment. Keywords: sandbox, e2b, isolated environment, run code, test code, safe execution.
Install
npx vskill@latest install comeonoliver/skillshub/agent-sandboxesSKILL.md
Agent Sandboxes
This skill provides access to E2B sandboxes through a streamlined CLI for safe code execution and file operations in isolated environments.
Variables
- E2B_API_KEY: The environment variable containing the E2B API key (stored in the environment file)
- SANDBOX_CLI_PATH:
.claude/skills/agent-sandboxes/sandbox_cli/ - ENVIRONMENT_FILE_PATH:
../../../../.env - TIMEOUT_DURATION_IN_SECONDS:
43200(12 hours)
Prerequisites
Before using sandbox operations, validate the environment:
- Check for E2B_API_KEY:
``bash # Verify the API key is set grep "E2B_API_KEY" ENVIRONMENT_FILE_PATH ``
If missing, instruct the user: ``` Error: E2B_API_KEY not found in .env file
Please add your E2B API key to the .env file in the project root: echo "E2B_API_KEY=your_api_key_here" >> .env
Get your API key from: https://e2b.dev/docs ```
- Verify CLI is available:
The sandbox CLI is located at SANDBOX_CLI_PATH The .env file is automatically loaded from the project root.
Instructions
- IMPORTANT: Don't create files locally, always use the sandbox. Only do this if the user explicitly asks you to do so.
- ALWAYS USE --timeout TIMEOUT_DURATION_IN_SECONDS
- CAPTURE AND REMEMBER SANDBOX ID - Store it in your context, don't use shell variables or files
- Multi-agent safe - Each agent tracks its own sandbox ID independently
- Always validate E2B_API_KEY first - Don't proceed without it
- Change directory to SANDBOX_CLI_PATH - All commands must be run from there
- Use --shell for complex commands - Enables pipes, redirections, wildcards
- Use --cwd instead of cd - More reliable for working directory changes
- Binary files - Use
upload/downloadfor images, PDFs, executables - Never delete the sandbox unless you're explicitly asked to do so - Sandboxes auto-timeout after TIMEOUT_DURATION_IN_SECONDS
Template Tiers
Pre-built templates with different resource levels. Use --template flag with sbx init:
| Template | vCPU | RAM | Cost | Best For | |
|---|---|---|---|---|---|
fullstack-vue-fastapi-node22 | 2 | 2GB | $0.13/hr | Simple apps (default) | |
fullstack-vue-fastapi-node22-lite | 2 | 4GB | $0.15/hr | Browser tests | |
fullstack-vue-fastapi-node22-standard | 4 | 4GB | $0.27/hr | Parallel builds | |
fullstack-vue-fastapi-node22-heavy | 4 | 8GB | $0.33/hr | Multi-browser | |
fullstack-vue-fastapi-node22-max | 8 | 8GB | $0.44/hr | Fastest |
Build new templates: uv run build_template.py --tier <tier> or --list-tiers to see options.
When to Use Sandboxes
Use agent sandboxes when the user needs to:
- Run untrusted or experimental code safely
- Test packages or dependencies without affecting the local system
- Execute system commands in an isolated environment
- Work with binary files (images, PDFs, executables)
- Clone and test repositories in isolation
- Install and test different package versions
- Run long-running processes without blocking
CLI Overview
The sandbox CLI has four core command groups:
- `sbx init` - Quick sandbox initialization
- `sbx sandbox` - Lifecycle management (create, connect, kill, pause, extend-lifetime, info)
- `sbx files` - File operations (ls, read, write, upload, download, rm, mkdir, mv)
- `sbx exec` - Unified command execution (the most powerful command)
- `sbx browser` - Browser automation for UI validation (visual testing)
Get CLI Help: Use sbx --help to see all available commands and options:
Key Command: sbx exec
The exec command is the primary interface for running commands in sandboxes:
Important: All commands must be run from SANDBOX_CLI_PATH directory.
Key Command: sbx browser
Browser automation for visual validation of sandbox applications using Playwright's isolated Chromium.
Commands (all support --port PORT for parallel agents):
For parallel agents: Use --port flag with unique ports (9222-9999).
Multi-Agent Considerations
CRITICAL: Multiple agents may be running sandboxes simultaneously. Each agent MUST:
- Always use `--timeout TIMEOUT_DURATION_IN_SECONDS` when initializing (unless the user specifies a different timeout)
- Capture the sandbox ID from
sbx initoutput and remember it in your context - DO NOT use shell variables like
export SANDBOX_ID=...(conflicts with other agents) - DO NOT rely on `.sandbox_id` file (gets overwritten by other agents)
- Track the sandbox ID yourself and use it directly in all subsequent commands
- Report the sandbox ID to the user when done
Example of proper ID handling:
Cookbook
Extended documentation for specific features. Read these when you need to use the feature.
| Feature | When to Read | Documentation | |
|---|---|---|---|
| Browser Automation | When validating UIs, taking screenshots, or interacting with web pages | cookbook/browser.md |
Workflow
Step 1: Validate Environment
Always start by checking for the E2B_API_KEY:
If not found, stop and request the user to add their API key.
Step 2: Initialize Sandbox and Capture ID
Create a new sandbox and capture the sandbox ID from the output:
CRITICAL:
- Always use `--timeout TIMEOUT_DURATION_IN_SECONDS`
- The command will output a sandbox ID (e.g.,
sbx_abc123def456) - Capture this ID and remember it in your context
- DO NOT use environment variables or files to store it
- Use this exact ID in all subsequent commands
Additional options (optional):
--template NAME- Use a specific template (default: base)--env KEY=VALUE- Set environment variables
Example:
Step 3: Perform Operations
Use the appropriate command based on the task, using the sandbox ID you captured:
Run commands (replace <sandbox_id> with your captured ID):
File operations:
Download directories (clone sandbox code locally):
IMPORTANT - Writing Files with Special Characters: The sbx files write command has limitations with special characters like brackets [] when passing content as an argument due to shell glob expansion. Use one of these workarounds:
Option 1: Use --stdin flag (recommended):
Option 2: Write locally, then upload:
Option 3: Use sbx exec with heredoc or Python:
Install packages:
Step 4: Expose Frontend (If Applicable)
When building applications with a frontend/UI, create a lightweight server to host your work and expose it:
4.1: Start the Server
Always default to port 5173 and ensure your frontend is configured to use this port:
Key points:
- Use
--backgroundflag to keep server running - Port 5173 is the default - use this unless you have a specific reason not to
- Ensure your frontend code is configured for the same port
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/disler/agent-sandbox-skill/agent-sandboxes/SKILL.md
Popularity
- Repository stars
- 66
- Repository forks
- 24
- 7-day trend score
- 26
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/comeonoliver/skillshub/agent-sandboxes)