본문으로 건너뛰기
Skillpedia
일반 코딩7.8k · #12983

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-exec-fallback/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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: python3 in 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:

  1. write_file with path="generate_spreadsheet.py" and the code above as content
  2. run_shell with command="python3 generate_spreadsheet.py"
  3. Verify output.xlsx was created with list_dir

Tips

  • Increase timeout for 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬