Agent Sandboxesagentsandboxes.org
Sandbox profile · Open-source project

Piston

Answer in brief

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.

By the Agent Sandboxes editors · Updated

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

AttributeDetails
Isolationisolate 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
DeploymentOpen-source project · Self-hostable
Open sourceYes (MIT)
SDKs and interfacesREST API
Cold start (vendor claim)Not documented
Max session lengthPer 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)
PersistenceNone; 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
GPUNo GPU option is documented
NetworkingOutgoing network disabled by default
PricingFree 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 tierFree to self-host; public API keys are not freely available as of 15 February 2026
ComplianceNot documented
RegionsNot 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

SandboxIsolationOpen sourceSelf-host / BYOCCold start (vendor)Max sessionSnapshots / pauseGPUSDKs
Pistonisolate in DockerYesYes / NoNot documented3 s run / 10 s compileNo / NoNoREST API
Judge0isolate (namespaces/cgroups)YesYes / NoNot documented5 s wall (max 20 s)No / NoNoREST API, Python, JavaScript/TypeScript
CodapiLocked-down Docker containerYesYes / No1-3 s per run (claim)5 s defaultNo / NoNoREST API, JavaScript/TypeScript
glot.ioSingle-use Docker containerYesYes / NoNot documentedOperator-set per runNo / NoNoREST API
OneCompiler Code Execution APINot documentedNoNo / NoNot documented7-20 s (enterprise)No / NoNoREST API
JDoodle Compiler APIFresh sandbox per run (unnamed)NoNo / NoNot documentedNot documentedNo / NoNoREST API

See all Piston alternatives →

Frequently asked questions

What is 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.
How does Piston isolate code?
Piston documents its isolation as: 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.
Is Piston open source?
Yes (MIT). It can be self-hosted.
How much does Piston cost?
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 Check the official pricing page for current rates.
What are the alternatives to Piston?
Common alternatives include Judge0, Codapi, glot.io, OneCompiler Code Execution API, JDoodle Compiler API. See Piston alternatives for a full comparison.

Sources

  1. github.com/engineer-man/piston
  2. raw.githubusercontent.com/engineer-man/piston/master/readme.md

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.