Python Code Sandbox

•
1
•

Provides a secure, isolated environment for executing Python code in ephemeral Docker containers with automatic dependency management and file persistence.

The Python Code Sandbox is a robust server designed to execute Python code in secure, isolated Docker containers. It offers both one-shot ephemeral runs for quick scripts and persistent sessions for multi-step tasks, ensuring a clean environment every time. With automatic on-the-fly pip dependency installation and efficient caching, users can rapidly test and run code requiring various libraries. Enhanced security features like controlled resource limits, non-root execution, and automatic file and image retrieval make it an ideal solution for safely running untrusted or experimental Python code, particularly when integrated with AI agents or desktop applications.

Key Features

01Isolated execution of Python code in ephemeral Docker containers
021 GitHub stars
03Support for both one-shot and session-based execution modes
04Automatic on-the-fly pip dependency installation and ultra-fast caching
05Secure execution with controlled CPU/memory limits and non-root processes
06Automatic retrieval of generated files and images from sandbox runs

Use Cases

01Rapidly prototyping and testing Python scripts with dynamic dependency installation
02Securely executing arbitrary or untrusted Python code in an isolated environment
03Integrating safe Python code execution capabilities into AI agents or applications