Rustbox#
A safe place to run code you don't trust. Send a program and its test cases, and get a result for each test case, with proof of what happened inside the box. Built for coding platforms, assessments, AI evaluations and AI training rewards.
curl -s -X POST "https://api.rustbox.sh/api/submit?wait=true" \
-H "Content-Type: application/json" \
-H "X-API-Key: rb_live_your_key_here" \
-d '{"language": "python", "code": "print(42)"}' | jq{
"id": "f2c6c5f7-1203-46e5-8a4f-a619c12bfeb0",
"schema_version": "2.0",
"language": "python",
"profile": "judge",
"status": "completed",
"timestamps": {
"created_at": "2026-04-03T08:05:23.540110+00:00",
"started_at": "2026-04-03T08:05:23.540218+00:00",
"completed_at": "2026-04-03T08:05:23.570195+00:00"
},
"result": {
"verdict": "AC",
"cause": "normal_exit",
"actor": "runtime",
"exit_code": 0,
"signal": null,
"error_message": null
},
"output": {
"stdout": "42\n",
"stderr": "",
"integrity": "complete"
},
"metrics": {
"cpu_time_secs": 0.009142,
"wall_time_secs": 0.01,
"memory_peak_bytes": 3862528,
"cpu_wall_ratio": 0.9,
"divergence": "cpu_bound"
},
"evidence": {
"isolation": {
"mode": "strict",
"controls_applied": ["pid_namespace", "mount_namespace", "network_namespace", "memory_limit", "process_limit", "no_new_privileges"],
"controls_missing": [],
"proc_policy": "hardened",
"sys_policy": "builtin-deny",
"pidfd_mode": "native",
"reason": "All configured controls applied"
},
"limits": {
"rlimits": {
"cpu_secs": { "soft": 4, "hard": 4 },
"as_bytes": { "soft": 1073741824, "hard": 1073741824 },
"nofile": { "soft": 32, "hard": 32 },
"nproc": { "soft": 10, "hard": 10 }
},
"cgroup_backend": "cgroup_v2",
"cgroup": {
"memory_limit_bytes": 268435456,
"memory_peak_bytes": 3862528,
"oom_events": 0,
"oom_kill_events": 0,
"cpu_usage_usec": 9142,
"process_count": 0,
"process_limit": 10
}
},
"teardown": {
"reap_status": "clean",
"descendant_containment": "ok",
"zombie_count": 0,
"cleanup_verified": true,
"residual_mounts": [],
"collection_errors": []
}
}
}Replace
rb_live_your_key_herewith your own API key. Sign up to get one.
About 70 ms from sending the code to getting the result (typical run, measured on the live service). 8 languages. Every run locked down. Every result backed by proof.
Why Rustbox#
| Rustbox | Typical setup | |
|---|---|---|
| Protection | 8 layers, checked when rustbox is built | Container defaults |
| Blocked actions | 51, chosen for running code safely | 300 generic rules |
| Results | From what really happened, like memory running out | Guessed from the exit code |
| Setup | One API call | Several services to wire together |
Judge limits#
Every run gets 256 MB of memory (512 MB for Java and JavaScript), a time limit per language and no internet. Tight limits, fast results. Limits per language.
To run one program against many test cases in a single call, use POST /api/judge.
8 layers of security#
Every run gets a fresh box with 8 separate layers of protection. To break out, code would have to beat all eight at once.
| # | Protection | What it stops | Technical name |
|---|---|---|---|
| 1 | Own processes | Seeing or touching other programs | PID + IPC + UTS namespaces |
| 2 | Private files | Reading anything outside its folder | Mount namespace + chroot |
| 3 | No internet | Connections, DNS, the cloud's secret address | Network namespace |
| 4 | Memory and CPU limits | Eating all memory, copying itself forever, hogging the CPU | Cgroups v2 |
| 5 | 51 risky actions blocked | Spying on other programs, mounting disks, loading kernel code | Seccomp-BPF (51 rules) |
| 6 | No special powers | Taking admin powers | All capability sets zeroed |
| 7 | Runs as a normal user | Running as admin (root) | Credential drop to unprivileged UID |
| 8 | No way to gain powers | Upgrading itself to admin later | NO_NEW_PRIVS |
147 attack tests across all 8 languages: programs that eat memory or copy themselves forever, try to leave their folder, get around the blocked actions or make themselves admin. 0 break-outs across 22 kinds of attack in 8 languages. Security details.
8 languages#
Python, C, C++, Java, JavaScript, TypeScript, Go, Rust. Full language reference.
Open beta - Sign up to get your API key and start building today.
Quickstart - From API key to a working integration in 5 minutes.
SDKs - TypeScript, Python, Go, Rust. One-line install.
API Reference - Every endpoint, every field.
Security - How the 8 layers work, in detail.