sandbox-exec-fallback
하는 일
이 스킬은 AI 에이전트에게 코드 샌드박스에서 벗어나 셸에서 저장된 Python 파일을 실행하라고 안내합니다. 스프레드시트, CSV 파일 또는 Python으로 만드는 다른 결과물이 필요한 사람을 위한 스킬입니다.
사용하는 경우
- ✓코드 샌드박스가 스프레드시트나 CSV 파일을 만드는 중 실패할 때.
- ✓데이터 처리 작업이 샌드박스에서 실패했지만 결과물은 꼭 필요할 때.
- ✓길거나 메모리를 많이 쓰는 Python 작업에 샌드박스가 허용하는 시간보다 더 오래 걸릴 때.
스킬 링크
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-exec-fallback/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“지출 스프레드시트를 만드는 중 샌드박스가 실패했습니다. Python 코드를 파일로 저장해 실행하고, 스프레드시트가 만들어졌는지 확인해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 전체 Python 코드를 스크립트 파일에 씁니다. 그다음 셸에서 제한 시간을 두고 python3로 실행하고, 출력된 내용을 확인합니다. 마지막으로 폴더를 살펴 스크립트가 만든 파일을 찾습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Sandbox Execution Fallback
When to Use
Use this skill when execute_code_sandbox fails during Python code execution, particularly for tasks involving:
- Spreadsheet generation (xlsx, csv)
- Data processing and transformations
- File output operations
- Complex computations requiring libraries
Recovery Pattern
When execute_code_sandbox returns an error or fails to produce expected output:
Step 1: Write Python Code to File
Use write_file to save your Python script to a file:
# Use write_file tool with:
path: "script.py"
content: <your complete Python code as a string>
Step 2: Execute via Shell
Use run_shell to execute the script:
# Use run_shell tool with:
command: "python3 script.py"
timeout: <appropriate timeout, e.g., 300 for long-running tasks>
Step 3: Verify Output
Check the shell output for:
- Success messages or printed results
- Error messages (if any, diagnose and fix the script)
- File creation confirmations
Step 4: Access Generated Files
If the script creates output files (e.g., spreadsheets), they will be in the current working directory. Use list_dir to confirm, then read_file to access if needed.
Why This Works
- Same Python Environment:
python3in the shell uses the same environment as the sandbox - More Robust: Shell execution handles long-running or memory-intensive tasks better
- Debuggable: Errors are captured in stdout/stderr for easier diagnosis
- Identical Results: Produces the same output as sandbox execution when successful
Example: Spreadsheet Generation
Original code that failed in execute_code_sandbox:
import pandas as pd
data = {'A': [1, 2, 3], 'B': [4, 5, 6]}
df = pd.DataFrame(data)
df.to_excel('output.xlsx', index=False)
print("File created successfully")
Recovery Execution:
write_filewith path="generate_spreadsheet.py" and the code above as contentrun_shellwith command="python3 generate_spreadsheet.py"- Verify output.xlsx was created with
list_dir
Tips
- Increase
timeoutfor complex operations (default 30s may be insufficient) - Add explicit print statements for debugging
- Handle exceptions in your script and print error messages
- Clean up temporary script files after successful execution if needed
자주 묻는 질문
출력 파일은 어디에 생기나요?
스킬에 따르면 출력 파일은 현재 작업 폴더에 생기므로, 에이전트는 그 폴더를 확인해 파일을 찾습니다.
스크립트는 얼마나 오래 실행할 수 있나요?
스킬은 오래 걸리는 작업을 위해 300초 같은 더 긴 제한 시간을 권합니다.
스크립트가 여전히 실패하면 어떻게 하나요?
스킬은 오류 메시지를 읽고, 스크립트를 고친 뒤 다시 실행하라고 안내합니다.
상세 정보
작성자의 원본 설명
Fallback pattern for executing Python code when execute_code_sandbox fails by writing to file and running via shell
repo: HKUDS/AgentPilot
인기도
- GitHub 스타
- 7.8k
- 순위
- #12983
- 라이선스
- 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프로그램을 개선하는 방법을 조사하면서 작은 실험을 계획하고, 결과를 읽고, 발견 사항을 기록하도록 돕습니다.