sandbox-fallback-execution-048d5a
できること
このスキルは、サンドボックスで繰り返しエラーが出た後、AIエージェントがサンドボックスの外でPythonを実行する方法を示します。サンドボックスの隔離が不要なコード向けです。
使う場面
- ✓サンドボックスで何度か試した後も、e2b関連のエラーが出るとき。
- ✓コードを安全に実行するためにサンドボックスの隔離が必要ないとき。
- ✓Pythonでスプレッドシートを作る必要があるのに、サンドボックスがまだ使えないとき。
スキルのリンク
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-fallback-execution-048d5a/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“サンドボックスで3回e2bエラーが出ました。代わりに、私のExcelスクリプトをシェルで直接実行してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、Pythonコードをワークスペースフォルダーのファイルに書き、時間制限付きでシェルからpython3を実行します。その後、出力を読んでエラーやファイル作成のメッセージを確認します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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
よくある質問
e2bとは何ですか?
サンドボックスサービスの名前です。スキルは、そのエラーを切り替えの合図として扱っています。
サンドボックスの外でコードを実行しても安全ですか?
スキルは、隔離が必要ないコード向けだと述べています。信頼できるコードだけに使ってください。
スクリプトはどこに保存すべきですか?
スキルはワークスペースフォルダーと完全なパスを使い、出力ファイルが既知の場所に保存されるようにしています。
詳細
作者による元の説明
Fallback method to execute Python code when execute_code_sandbox fails with e2b errors
repo: HKUDS/AgentPilot
人気
- GitHubのスター
- 7.8k
- ランキング
- #12988
- ライセンス
- MIT
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
agentpilot
7.8kエージェントが、作業を準備し、変更案を提案してテストし、評価するAgentPilotのループを実行することで、プロジェクトを段階的に改善できるよう支援します。
openspace
7.8kエージェントが、スキルを保存し取り出すツールであるOpenSpaceをセットアップし、MCPを通じてAIアプリに接続できるよう支援します。
rsi-arena
7.8kエージェントが、AIMEやTerminal-Benchなどの標準的なAIベンチマークテストをセットアップして実行し、異なる改善方法を比較できるよう支援します。
experiment-guide
7.8kエージェントが、プログラムを改善する方法を調べる間に、小さな実験を計画し、その結果を読み、発見を記録できるよう支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。