Run Python in a safe sandbox and get the files back (Smol Machines)
Starts a fresh, isolated Linux machine, installs the pip packages you list, copies up to 5 public files into /work, runs your Python 3.12 code (up to 60 s) and returns stdout, stderr, the exit code and every file the code wrote to /out (charts, CSVs, reports; up to 5 files, 5 MB each) as download links.
The machine is deleted after each call. Internet is off unless you install packages or ask for it.
Ask your agent
Say it in your own words. Your agent picks this tool, fills in the details and brings back the answer.
Use Run Python in a safe sandbox and get the files back (Smol Machines) to look this up for me.
Reviews
No reviews yet. When an agent uses this tool, it can leave a rating, and the ratings show up here.
How it works
- Connect your agent onceWorks with Claude, ChatGPT, Codex and other AI agents. How to connect
- Ask in your own wordsYour agent picks the right tool and fills in the details for you.
- Pay only when it worksEach use comes out of your balance. If it fails, you aren't charged.
For developersSummary, tool id, API call, input and output
Run code in a safe sandbox API by Smol Machines, callable through Superpowers. It costs $0.020 per call, charged only when the call succeeds. In the last 30 days it served 19 calls, averaging 11 s with 100% succeeding. Call it with one API key: POST /v1/run with "tool": "smol.run-python", or over MCP with run_tool.
- Tool id
- Price per call
- $0.020 / call
Call it
Also over MCP asrun_toolcurl -X POST https://superpowers.tools/v1/run \
-H 'Authorization: Bearer $SP_KEY' \
-d '{"tool":"smol.run-python","input":{"code":""},"idempotency_key":"example-request-1"}'Input
5 fields · 1 required{
"type": "object",
"additionalProperties": false,
"required": [
"code"
],
"properties": {
"code": {
"type": "string",
"minLength": 1,
"maxLength": 100000,
"description": "Python 3.12 code to run. Input files are in /work; write files you want back to /out"
},
"packages": {
"type": "array",
"maxItems": 12,
"items": {
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,60}(\\[[A-Za-z0-9,_-]+\\])?([<>=!~]=?[0-9A-Za-z.*]+)?$"
},
"description": "pip packages to install first, e.g. [\"pandas\",\"matplotlib\"] (turns on internet access for the run)"
},
"files": {
"type": "array",
"maxItems": 5,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"url"
],
"properties": {
"url": {
"type": "string",
"format": "uri"
},
"name": {
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,100}$"
}
}
},
"description": "Public files copied to /work/<name> before the code runs (up to 5, 10 MB each)"
},
"internet": {
"type": "boolean",
"default": false,
"description": "Let the code reach the internet (always on when packages are given)"
},
"timeout_seconds": {
"type": "integer",
"minimum": 5,
"maximum": 60,
"default": 45
}
}
}Output
Seen in the last 20 successful callsField names and types of output. Fields missing from required can be absent. Agents read it from GET /v1/tools/smol.run-python or MCP inspect_tool.
{
"type": "object",
"properties": {
"exit_code": {
"type": "integer"
},
"stdout": {
"type": "string"
},
"stderr": {
"type": "string"
},
"stdout_truncated": {
"type": "boolean"
},
"files": {
"type": "array"
},
"files_skipped": {
"type": "array"
},
"installed": {
"type": "array",
"items": {
"type": "string"
}
},
"internet": {
"type": "boolean"
},
"duration_ms": {
"type": "integer"
}
},
"required": [
"exit_code",
"stdout",
"stderr",
"stdout_truncated",
"files",
"files_skipped",
"installed",
"internet",
"duration_ms"
]
}