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_here with 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#

RustboxTypical setup
Protection8 layers, checked when rustbox is builtContainer defaults
Blocked actions51, chosen for running code safely300 generic rules
ResultsFrom what really happened, like memory running outGuessed from the exit code
SetupOne API callSeveral 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.

#ProtectionWhat it stopsTechnical name
1Own processesSeeing or touching other programsPID + IPC + UTS namespaces
2Private filesReading anything outside its folderMount namespace + chroot
3No internetConnections, DNS, the cloud's secret addressNetwork namespace
4Memory and CPU limitsEating all memory, copying itself forever, hogging the CPUCgroups v2
551 risky actions blockedSpying on other programs, mounting disks, loading kernel codeSeccomp-BPF (51 rules)
6No special powersTaking admin powersAll capability sets zeroed
7Runs as a normal userRunning as admin (root)Credential drop to unprivileged UID
8No way to gain powersUpgrading itself to admin laterNO_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.