Skip to content

rustbox

rustbox is a secure process isolation system for competitive programming judges, inspired by IOI Isolate. It provides kernel-enforced sandboxing for untrusted code execution with deterministic resource enforcement and evidence-backed verdict provenance.

Built for anyone running code from strangers on the internet - online judges, code playgrounds, interview platforms, educational tools.

  • Runs Python, C++, Java, JavaScript, and TypeScript in isolated sandboxes
  • Enforces CPU time, wall time, memory, and process limits via the kernel (not userspace polling)
  • Classifies verdicts (AC, TLE, MLE, RE, SIG) from kernel evidence, not guesswork
  • Exposes a REST API with async polling, sync ?wait=true, and webhook delivery
  • Ships as a 2.8MB static binary. No Docker, no VMs, no JVM dependency.
rustboxJudge0Isolate (IOI)
Isolation8 kernel layersDocker containercgroups + mount
Compile-time safetyTypestate chainNoneNone
Verdict provenanceKernel evidence bundleExit code heuristicsExit code heuristics
Webhook supportStandard Webhooks + HMACNoNo
Sync mode?wait=trueNoNo
Binary size2.8MBDocker image (~1GB)~200KB (C)
Setupcargo buildDocker Compose + Redis + PostgreSQLmake install
LayerPrimitiveWhat it prevents
1PID namespaceSeeing host processes
2Mount namespace + chrootAccessing host filesystem
3Network namespaceNetwork access
4Cgroups v1/v2Memory bombs, fork bombs, CPU hogging
5Seccomp-BPFDangerous syscalls (ptrace, mount, bpf)
6Capability dropPrivilege escalation
7Credential dropRunning as root
8NO_NEW_PRIVSRegaining privileges via setuid

Terminal window
cargo build --release

Three binaries, same codebase:

  • target/release/judge - judge-focused commands (recommended)
  • target/release/isolate - sandbox-only commands
  • target/release/rustbox - accepts all commands
  • Linux with cgroups v2 (or v1 fallback)
  • Python 3, g++, OpenJDK 21 for the respective languages
  • Root access for strict mode (permissive works without it)
Terminal window
judge check-deps --verbose

No root needed. Start with permissive mode.

Terminal window
# Python
judge execute-code --permissive --language python --code 'print(2 ** 10)'
# C++
judge execute-code --permissive --language cpp --code '#include<iostream>
int main(){std::cout<<42<<std::endl;}'
# Java
judge execute-code --permissive --language java --code 'public class Main {
public static void main(String[] args) {
System.out.println(42);
}
}'

The output is a JSON verdict with stdout, stderr, timing, memory usage, and exit code.

PermissiveStrict
Needs rootNoYes
NamespacesSkippedPID + mount + network
CgroupsBest-effortEnforced
SeccompAppliedApplied
Credential dropSkipped (can’t without root)Enforced
Use caseDevelopment, CIProduction
Terminal window
sudo judge execute-code --strict --language python --code 'print(1)'

Strict mode fails closed. If any security control can’t be applied, the execution is rejected outright. There’s no “try anyway” path.