Features
- Code execution in a sandboxed environment
- Iterative problem-solving
- Error handling and retry logic
Complete Code
How It Works
- Problem Statement - User describes what they want to compute
- Code Generation - AI writes Python code to solve the problem
- Execution - Code runs in a sandboxed environment
- Result - AI explains the output
Sample Output
Security Considerations
Safer Alternatives
Docker containers
Docker containers
Run code in isolated Docker containers with resource limits.
RestrictedPython
RestrictedPython
Use the
RestrictedPython library for safer execution.Remote execution
Remote execution
Send code to a sandboxed execution service.
Restricted Builtins
The example limits available functions:Customization Ideas
Add file I/O
Add file I/O
Add tools for reading/writing files in a sandboxed directory.
Support packages
Support packages
Allow importing specific safe packages like
math or json.Interactive mode
Interactive mode
Create a REPL-style interface for iterative coding.