execute_code
Execute Python code in a sandboxed macOS environment with no network access, restricted filesystem writes, and automatic timeout. Returns stdout, stderr, and exit code for safe autonomous agent use.
Instructions
Execute Python code in a sandboxed environment on macOS.
Uses macOS Seatbelt (sandbox-exec) to isolate code execution:
No network access
No filesystem writes outside sandbox temp
No access to user home directory
Hard timeout (kills process if exceeded)
Safe for autonomous agent tool-use. Returns stdout, stderr, and exit code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python source code to execute. | |
| timeout | No | Maximum execution time in seconds (1-15, default 15). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |