Code Interpreter Tool Guide
Tool Purpose
Provides an isolated sandbox environment for executing agent-written code (Python, JavaScript, and other languages) safely.
When to Use
- Running Unit Test Generator output to verify tests pass
- Executing code snippets for debugging or validation
- Testing algorithms before committing
- Running data analysis scripts safely
- Self-checking generated code before PR submission
How to Use
- Write or paste the code to execute
- Specify the language/runtime
- Provide any required input data or environment variables
- The tool runs the code in an isolated container
- Results log stdout/stderr, return values, and execution time
Limitations
- No persistent filesystem (ephemeral per execution)
- No network access for security reasons
- Execution timeout of 60 seconds
- Limited to standard library packages (no arbitrary pip installs)
- Cannot access secrets or credentials
Output
stdout, stderr, return code, execution time, and any output files generated.