Piston
MIT-licensed code execution engine that runs each submission in an isolate sandbox inside a Docker container, with a public API at emkc.org restricted to approved non-commercial projects since February 2026. A solid self-hosted judge engine for stateless snippet execution; treat the public emkc.org API as unavailable for commercial agents.
Overview
Piston is a general-purpose code execution engine from the Engineer Man community, used for EMKC coding challenges, a Discord bot and, per the README, 200+ direct integrations. You run it as the ghcr.io/engineer-man/piston Docker image (started with --privileged), install language runtimes with the ppman CLI, then POST /api/v2/execute with a language, version and a files array; the response contains compile and run objects with stdout, stderr, exit code, signal and a status such as TO for timeout. The README lists 84 language entries.
Sandboxing is isolate inside Docker: each submission gets its own Linux namespaces, a chroot, a distinct unprivileged user, a cgroup-enforced memory cap, a process limit (256), an open-file limit (2,048), stdout capped at 1,024 characters by default and outgoing network disabled. Runs are wall-clock bounded (3 s run, 10 s compile by default) and nothing persists afterwards. Self-hosting needs cgroup v2 enabled and v1 disabled. The hosted public API at emkc.org stopped issuing keys freely on 15 February 2026; authorisation is now granted only for "good cause non-commercial educational projects", which rules out commercial agent use of the hosted endpoint.
Notable
- Public API keys no longer freely available as of 15 February 2026; granted only for non-commercial educational projects
- About 2.8k GitHub stars; the repository was still receiving commits in July 2026
- README lists 84 supported languages installed on demand through ppman
Piston specifications
| Attribute | Details |
|---|---|
| Isolation | isolate inside Docker: Linux namespaces, chroot, a different unprivileged user per submission and cgroups for resource limits; network disabled by default; the container itself runs with --privileged |
| Deployment | Open-source project · Self-hostable |
| Open source | Yes (MIT) |
| SDKs and interfaces | REST API |
| Cold start (vendor claim) | Not documented |
| Max session length | Per request: run_timeout default 3,000 ms and compile_timeout default 10,000 ms wall time, with matching run_cpu_time / compile_cpu_time; memory limits default to -1 (no limit) |
| Persistence | None; the README says submissions "shall not be aware of each other" and temp space is cleaned after each run. A WebSocket endpoint (/api/v2/connect) lets you send stdin to a process while it runs |
| GPU | No GPU option is documented |
| Networking | Outgoing network disabled by default |
| Pricing | Free to self-host (MIT). The public emkc.org API has no listed price; keys are granted at the maintainer's discretion only for non-commercial educational projects |
| Free tier | Free to self-host; public API keys are not freely available as of 15 February 2026 |
| Compliance | Not documented |
| Regions | Not documented |
Facts from Piston’s public documentation, verified November 9, 2026. Performance numbers are vendor claims.
Strengths and trade-offs
Strengths
- You want a permissively licensed (MIT) execution engine you can run yourself with one Docker command
- You need isolate-grade process sandboxing with network off and per-submission unprivileged users
- You are evaluating many short snippets across dozens of languages and compiled toolchains
Trade-offs
- Hosted API is effectively closed to commercial and personal projects since February 2026
- Stateless: no files, packages or processes survive between requests
- Default limits are tight (3 s run, 1,024-character stdout) and the container must run with --privileged
- No official SDKs; the only interface is the HTTP API plus a WebSocket for interactive stdin
Good fit for: Self-hosted, stateless execution of untrusted snippets in 80+ languages with isolate-level sandboxing.
How Piston compares
| Sandbox | Isolation | Open source | Self-host / BYOC | Cold start (vendor) | Max session | Snapshots / pause | GPU | SDKs |
|---|---|---|---|---|---|---|---|---|
| Piston | isolate in Docker | Yes | Yes / No | Not documented | 3 s run / 10 s compile | No / No | No | REST API |
| Judge0 | isolate (namespaces/cgroups) | Yes | Yes / No | Not documented | 5 s wall (max 20 s) | No / No | No | REST API, Python, JavaScript/TypeScript |
| Codapi | Locked-down Docker container | Yes | Yes / No | 1-3 s per run (claim) | 5 s default | No / No | No | REST API, JavaScript/TypeScript |
| glot.io | Single-use Docker container | Yes | Yes / No | Not documented | Operator-set per run | No / No | No | REST API |
| OneCompiler Code Execution API | Not documented | No | No / No | Not documented | 7-20 s (enterprise) | No / No | No | REST API |
| JDoodle Compiler API | Fresh sandbox per run (unnamed) | No | No / No | Not documented | Not documented | No / No | No | REST API |
Frequently asked questions
What is Piston?
How does Piston isolate code?
Is Piston open source?
How much does Piston cost?
What are the alternatives to Piston?
Sources
Cite this page
Agent Sandboxes. (2026). Piston. agentsandboxes.org. Last reviewed November 9, 2026. https://agentsandboxes.org/sandboxes/piston/
Found an error or a missing sandbox? Submit a correction — every entry links to the sources it relies on.