Piston
Self-hostable, high-performance engine for running untrusted code in many languages via a simple REST API.
Tags
Description
Piston executes untrusted, possibly malicious code in isolation and exposes runtimes, package management and execute endpoints over HTTP (plus an interactive WebSocket endpoint when self-hosted). Language runtimes are installed as packages. Wrappers exist for Node, Python and Java. Since 15 Feb 2026 the public emkc.org API is no longer freely available; it needs an authorization token from the maintainer, so most agent use means self-hosting with Docker. Self-hosting defaults (api/src/config.js and docs/configuration.md): the API binds to 0.0.0.0:2000, compile and run memory limits are -1 (unlimited), and max processes per job is 64 (the readme still says 256). The API has no authentication, including the POST and DELETE /api/v2/packages endpoints that install and remove runtimes, so do not expose it publicly.
Agent access
Related
- Judge0: Open-source sandboxed code execution system for 90+ languages; self-host or use Judge0 Cloud (via Rapid or direct).
- LLM Sandbox: Python library and MCP server for running LLM-generated code in isolated backends (Docker, Kubernetes, Podman, Bubblewrap, NsJail, Windows) behind one API.
- E2B: Open-source, secure cloud sandboxes for AI agents: an isolated machine per agent to run code, browse and use tools.
Guides & comparisons
- Self-host a code-execution API for agents with Piston or Judge0 (Guide): Run Piston or Judge0 on your own server to give an agent a stateless run_code tool for many languages: what each one isolates, the host requirements that decide between them, the limits to set, and a tested tool wrapper.
Sources
- https://github.com/engineer-man/piston
- https://github.com/engineer-man/piston#public-api
- https://github.com/engineer-man/piston/blob/master/api/src/config.js
- https://github.com/engineer-man/piston/blob/master/docs/configuration.md
Machine-readable
- JSON
- Markdown
- Source file on GitHub (edit via pull request)