HN 표시: 로컬 샌드박스에서 Claude 코드 실행

hackernews | | 📦 오픈소스
#ai 딜 #ai 에이전트 #anthropic #claude #gemini #openai #보안 #샌드박스 #코드 실행
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

로컬 환경에서 AI 에이전트가 실행하는 코드를 샌드박스 내에서 안전하게 격리 실행할 수 있는 오픈 소스 도구 'CodeRunner'가 소개되었습니다. 이 도구는 애플 실리콘이 장착된 맥(Mac) 환경을 기반으로 하며, macOS 컨테이너 기술을 활용해 VM 수준의 격리성을 제공하여 데이터 유출이나 시스템 손상을 방지합니다. 특히 Claude Code, Claude Desktop, OpenAI Agents, Gemini-CLI, Amazon Kiro 등 다양한 AI 플랫폼과 통합하여 사용자가 로컬 머신의 안전한 환경에서 파이썬 코드를 실행하거나 PDF 및 이미지 처리 등의 작업을 수행할 수 있게 지원합니다.

본문

CodeRunner helps you sandbox your AI agents and its actions inside a sandbox. Key use case: You can run multiple Claude Code or AI agents in our sandbox without any fear of data loss and exfilteration. Prerequisites: Mac with macOS and Apple Silicon (M1/M2/M3/M4), Python 3.10+ git clone https://github.com/instavm/coderunner.git cd coderunner chmod +x install.sh ./install.sh ./install.sh (if not already done) container exec -it coderunner /bin/bash root@coderunner:/app# npm install -g @anthropic-ai/claude-code MCP server will be available at: http://coderunner.local:8222/mcp Install required packages (use virtualenv and note the python path): pip install -r examples/requirements.txt Configure Claude Desktop to use CodeRunner as an MCP server: - Copy the example configuration: cd examples cp claude_desktop/claude_desktop_config.example.json claude_desktop/claude_desktop_config.json - Edit the configuration file and replace the placeholder paths: - Replace /path/to/your/python with your actual Python path (e.g.,/usr/bin/python3 or/opt/homebrew/bin/python3 ) - Replace /path/to/coderunner with the actual path to your cloned repository Example after editing: { "mcpServers": { "coderunner": { "command": "/opt/homebrew/bin/python3", "args": ["/Users/yourname/coderunner/examples/claude_desktop/mcpproxy.py"] } } } - Replace - Update Claude Desktop configuration: - Open Claude Desktop - Go to Settings → Developer - Add the MCP server configuration - Restart Claude Desktop - Start using CodeRunner in Claude: You can now ask Claude to execute code, and it will run safely in the sandbox! Use CodeRunner with Claude Code CLI for terminal-based AI assistance: Quick Start: # 1. Install and start CodeRunner (one-time setup) git clone https://github.com/instavm/coderunner.git cd coderunner sudo ./install.sh # 2. Install the Claude Code plugin claude plugin marketplace add https://github.com/instavm/coderunner-plugin claude plugin install instavm-coderunner # 3. Reconnect to MCP servers /mcp Installation Steps: That's it! Claude Code now has access to all CodeRunner tools: - execute_python_code - Run Python code in persistent Jupyter kernel - navigate_and_get_all_visible_text - Web scraping with Playwright - list_skills - List available skills (docx, xlsx, pptx, pdf, image processing, etc.) - get_skill_info - Get documentation for specific skills - get_skill_file - Read skill files and examples Learn more: See the plugin repository for detailed documentation. Configure OpenCode to use CodeRunner as an MCP server: Create or edit ~/.config/opencode/opencode.json : { "$schema": "https://opencode.ai/config.json", "mcp": { "coderunner": { "type": "remote", "url": "http://coderunner.local:8222/mcp", "enabled": true } } } After saving the configuration: - Restart OpenCode - CodeRunner tools will be available automatically - Start executing Python code with full access to the sandboxed environment Use CodeRunner with OpenAI's Python agents library: - Set your OpenAI API key: export OPENAI_API_KEY="your-openai-api-key-here" - Run the client: python examples/openai_agents/openai_client.py - Start coding: Enter prompts like "write python code to generate 100 prime numbers" and watch it execute safely in the sandbox! Gemini CLI is recently launched by Google. ~/.gemini/settings.json { "theme": "Default", "selectedAuthType": "oauth-personal", "mcpServers": { "coderunner": { "httpUrl": "http://coderunner.local:8222/mcp" } } } Kiro is recently launched by Amazon. ~/.kiro/settings/mcp.json { "mcpServers": { "coderunner": { "command": "/path/to/venv/bin/python", "args": [ "/path/to/coderunner/examples/claude_desktop/mcpproxy.py" ], "disabled": false, "autoApprove": [ "execute_python_code" ] } } } Coderunner-UI is our own offline AI workspace tool designed for full privacy and local processing. Code runs in an isolated container with VM-level isolation. Your host system and files outside the sandbox remain protected. From @apple/container: Each container has the isolation properties of a full VM, using a minimal set of core utilities and dynamic libraries to reduce resource utilization and attack surface. CodeRunner includes a built-in skills system that provides pre-packaged tools for common tasks. Skills are organized into two categories: The following skills are included in every CodeRunner installation: - pdf-text-replace - Replace text in fillable PDF forms - image-crop-rotate - Crop and rotate images Skills are accessed through MCP tools: # List all available skills result = await list_skills() # Get documentation for a specific skill info = await get_skill_info("pdf-text-replace") # Execute a skill's script code = """ import subprocess subprocess.run([ 'python', '/app/uploads/skills/public/pdf-text-replace/scripts/replace_text_in_pdf.py', '/app/uploads/input.pdf', 'OLD TEXT', 'NEW TEXT', '/app/uploads/output.pdf' ]) """ result = await execute_python_code(code) Users can add their own skills to the ~/.coderunner/assets/skills/user/ directo

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →