silicube
Async Rust library for sandboxed code execution using IOI Isolate.
Features
- Sandboxed execution — Pool-based lifecycle for running untrusted code safely using Isolate
- Multi-language — Supports both compiled and interpreted languages
- TOML configuration — Flexible per-language compiler/runtime settings
- Interactive execution — FIFO-based sessions for interactive programs
- Resource limits — Enforce CPU time, memory, wall time, processes, and output constraints
- cgroup v2 support — Memory limiting in container environments
Usage
use ;
let config = default;
let pool = new;
let sandbox = pool.acquire.await?;
let runner = new;
let language = config.get_language.unwrap;
// Write source and run
sandbox.write_file.await?;
let result = runner.run.await?;
Requirements
- Linux (Isolate uses kernel namespaces and cgroups)
- Root privileges or equivalent capabilities
isolatebinary on$PATH