sandbox-fallback-execution
하는 일
이 스킬은 샌드박스가 실패하거나 시간 초과될 때 AI 에이전트가 쓸 수 있는 간단한 Python 대체 방법을 보여 줍니다. 샌드박스 없이 짧은 Python 작업을 끝내야 하는 사람을 위한 스킬입니다.
사용하는 경우
- ✓코드 샌드박스가 알 수 없는 오류를 내거나 시간 초과될 때.
- ✓같은 작업에서 샌드박스가 두 번 넘게 실패했을 때.
- ✓코드를 실행하기 전에 Python 패키지를 설치해야 할 때.
스킬 링크
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-fallback-execution/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“샌드박스가 제 스크립트에서 알 수 없는 오류를 냈습니다. 필요하면 pandas를 설치하고 셸에서 코드를 실행해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 필요한 패키지를 pip로 설치한 다음, heredoc을 사용해 셸에서 Python 코드를 실행합니다. 다음 단계로 넘어가기 전에 성공 메시지나 오류를 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Sandbox Fallback Execution
When to Use This Skill
Use this pattern when execute_code_sandbox fails with unknown errors, timeouts, or persistent execution failures. This fallback bypasses sandbox restrictions by using run_shell with a Python heredoc script.
Pattern Overview
execute_code_sandbox fails → run_shell with pip install → Python heredoc execution
Step-by-Step Instructions
Step 1: Detect Sandbox Failure
Monitor for these failure indicators from execute_code_sandbox:
- Unknown or unexplained errors
- Repeated execution failures (>2 attempts)
- Timeout errors
- Environment/package availability issues
Step 2: Install Required Dependencies (If Needed)
Use run_shell to install any required Python packages:
pip install <package_name>
For multiple packages:
pip install package1 package2 package3
Step 3: Execute Python via Heredoc
Run Python code using a heredoc script with run_shell:
python3 << 'EOF'
# Your Python code here
import sys
print("Hello from fallback execution")
EOF
Key heredoc syntax notes:
- Use
<< 'EOF'(quoted) to prevent shell variable expansion - Use
<< EOF(unquoted) if you need shell variable interpolation - Close with
EOFon its own line
Step 4: Verify and Iterate
- Check stdout/stderr for success indicators
- If errors persist, inspect output and adjust the script
- Capture any generated artifacts (files, outputs) for verification
Complete Example
Scenario: Need to create a Word document but execute_code_sandbox keeps failing.
# Step 1: Install required package
pip install python-docx
# Step 2: Execute Python script via heredoc
python3 << 'EOF'
from docx import Document
doc = Document()
doc.add_heading('Proposal Document', 0)
doc.add_paragraph('This is the proposal content.')
doc.save('proposal.docx')
print("Document created successfully")
EOF
Best Practices
- Quote the heredoc delimiter (
'EOF') to avoid unintended shell expansion of Python code - Install packages first before running the script to ensure availability
- Print status messages in your script for easier debugging
- Save outputs to files when possible for verification
- Keep scripts focused - break complex tasks into multiple heredoc executions if needed
Troubleshooting
| Issue | Solution |
|---|---|
pip not found |
Try pip3 or python3 -m pip install |
| Script hangs | Add timeout to run_shell command |
| Permission errors | Check file paths are writable |
| Import errors | Verify package was installed successfully |
Related Tools
run_shell: Execute shell commands directlyexecute_code_sandbox: Primary Python execution tool (try first)shell_agent: For more complex multi-step shell tasks
자주 묻는 질문
따옴표가 있는 EOF와 없는 EOF는 어떻게 다른가요?
따옴표가 있는 종료 표시는 셸이 변수를 바꾸지 못하게 하고, 따옴표가 없으면 셸이 값을 채워 넣습니다.
에이전트가 패키지를 설치하나요?
네, 코드에 패키지가 필요하면 스킬은 먼저 pip로 설치하라고 안내합니다.
오류가 남아 있으면 어떻게 하나요?
스킬은 출력을 읽고, 코드를 고친 뒤 다시 실행하라고 안내합니다.
상세 정보
작성자의 원본 설명
Fallback workflow for executing Python code when execute_code_sandbox fails
repo: HKUDS/AgentPilot
인기도
- GitHub 스타
- 7.8k
- 순위
- #12990
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
agentpilot
7.8k작업을 준비하고 AgentPilot 루프를 실행해 변경을 제안, 테스트, 점수화하면서 프로젝트를 단계적으로 개선하도록 돕습니다.
openspace
7.8k에이전트 스킬을 저장하고 가져오는 도구인 OpenSpace를 설정하고, MCP를 통해 AI 앱에 연결하도록 돕습니다.
rsi-arena
7.8kAIME나 Terminal-Bench 같은 표준 AI 벤치마크 테스트를 설정하고 실행해 서로 다른 개선 방법을 비교하도록 돕습니다.
experiment-guide
7.8k프로그램을 개선하는 방법을 조사하면서 작은 실험을 계획하고, 결과를 읽고, 발견 사항을 기록하도록 돕습니다.