sandbox-fallback-execution-048d5a
What it does
This skill tells the AI agent to run Python outside the sandbox after repeated sandbox errors. It is for code that does not need the isolation of the sandbox.
When to use it
- ✓When the code sandbox fails with e2b-related errors after several tries.
- ✓When the code does not need sandbox isolation to run safely.
- ✓When you need a spreadsheet made from Python and the sandbox is still down.
Skill link
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-fallback-execution-048d5a/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“The sandbox has failed three times with e2b errors. Run my Excel script directly in the shell instead.”
5 new skills a week. 1 minute to read.
How it works
The agent writes the Python code to a file in the workspace folder and runs it with python3 through the shell, with a time limit. It then reads the output to check for errors or file creation messages.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Sandbox Fallback Execution
When execute_code_sandbox repeatedly fails with e2b sandbox errors, use this fallback pattern to execute Python code directly on the host system.
When to Use
Use this skill when:
execute_code_sandboxfails with e2b-related errors- Multiple retry attempts (3+) have not resolved the issue
- The code does not require sandbox isolation
Steps
Step 1: Write Python Script to File
Use write_file to save your Python code as a .py file:
Tool: write_file
path: /workspace/script_name.py
content: |
# Your Python code here
import pandas as pd
# ... rest of code
Step 2: Execute via Shell
Use run_shell with explicit python3 path:
Tool: run_shell
command: python3 /workspace/script_name.py
timeout: 120
Step 3: Verify Output
Check the stdout/stderr from run_shell for:
- Successful execution messages
- Expected output or file creation confirmations
- Any errors that need debugging
Complete Example
# Instead of this (failing):
Tool: execute_code_sandbox
code: |
import pandas as pd
df = pd.DataFrame({'a': [1,2,3]})
df.to_excel('output.xlsx')
# Use this fallback:
Tool: write_file
path: /workspace/generate_report.py
content: |
import pandas as pd
# Create sample data
df = pd.DataFrame({'a': [1,2,3], 'b': [4,5,6]})
# Save to Excel
df.to_excel('/workspace/output.xlsx', index=False)
print('File created successfully')
Tool: run_shell
command: python3 /workspace/generate_report.py
timeout: 120
Tips
- Use absolute paths in your Python script when reading/writing files
- Add print statements for debugging since you won't get interactive output
- Increase timeout if the script performs heavy computation
- Check working directory - scripts run from the workspace root by default
- Handle errors explicitly with try/except blocks and meaningful error messages
Common e2b Errors That Trigger This Fallback
E2B execution errorSandbox timeoutConnection refusedSandbox initialization failed- Repeated retry failures (3+ attempts)
When NOT to Use This Fallback
- When sandbox isolation is required for security
- When the code needs specific sandbox environment variables
- On first failure only - try
execute_code_sandboxretry first
FAQ
What does e2b refer to here?
It is the name of the sandbox service, and the skill treats its errors as the trigger to switch.
Is it safe to run code outside the sandbox?
The skill says this is for code that does not need isolation, so use it only for code you trust.
Where should the script be saved?
The skill uses a workspace folder and full paths so output files land in a known place.
Details
Original description by the author
Fallback method to execute Python code when execute_code_sandbox fails with e2b errors
repo: HKUDS/AgentPilot
Popularity
- GitHub stars
- 7.8k
- Ranking position
- #12988
- License
- MIT
- Updated
- 11/1/2026
Comments
- …
More skills from this repository
agentpilot
7.8kHelps your agent improve a project step by step by preparing a task and running the AgentPilot loop that proposes, tests and scores changes.
openspace
7.8kHelps your agent set up OpenSpace, a tool that stores and fetches agent skills, and connect it to your AI app through MCP.
rsi-arena
7.8kHelps your agent set up and run standard AI benchmark tests, such as AIME and Terminal-Bench, to compare different improvement methods.
experiment-guide
7.8kHelps your agent plan small experiments, read their results and record findings while it investigates how to improve a program.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.