Back to catalog
Cortexa research tool·code data·python_executor
Python Code Executor
Execute Python code snippets safely in sandboxed environment with timeout and resource limits. Supports variable passing and result extraction.
Livelast probed 2026-04-30 23:07Z· 115msCortexa
Status
The most recent probe succeeded. Safe to call from the agent today.
- Last probed
- 1d ago
- Last success
- 1d ago
- Last latency
- 115ms
Schema
JSON Schema the agent (or your API call) must match.
{
"properties": {
"allowed_imports": {
"description": "Additional allowed modules beyond the default safe set (math, json, datetime, etc.)",
"items": {
"type": "string"
},
"type": "array"
},
"arguments": {
"additionalProperties": true,
"description": "Variables to pass into execution environment as dictionary. Keys become variable names in the code.",
"type": "object"
},
"auto_install_dependencies": {
"default": false,
"description": "Whether to automatically install missing dependencies without user confirmation",
"type": "boolean"
},
"code": {
"description": "Python code to execute. Can use variables from 'arguments' parameter. Use 'result = ...' to return values.",
"type": "string"
},
"dependencies": {
"description": "List of Python packages that the code depends on. Will be checked and optionally installed before execution.",
"items": {
"type": "string"
},
"type": "array"
},
"require_confirmation": {
"default": true,
"description": "Whether to require user confirmation before installing packages",
"type": "boolean"
},
"return_variable": {
"default": "result",
"description": "Variable name to extract as result from the executed code",
"type": "string"
},
"timeout": {
"default": 30,
"description": "Execution timeout in seconds",
"maximum": 300,
"minimum": 1,
"type": "integer"
}
},
"required": [
"code"
],
"type": "object"
}Examples (1)
Default Python Code Executor call
public-safeinput
{
"allowed_imports": [],
"auto_install_dependencies": false,
"code": "",
"dependencies": [],
"require_confirmation": false,
"timeout": 1
}Expected response keys: success
Anonymous-safe example. Rate-limited; no sign-in required.
Identifiers
- Catalog ID
- tu_python_code_executor
- Tool name
- python_code_executor
- Added
- 2026-04-30 22:47Z
- Tags
- tooluniverse