SandboxFusion

Security & Safety 💻 Python ⚖️ Apache-2.0 🟡 Quiet lately
1.1k stars

SandboxFusion is a secure sandbox service for running and judging code generated by LLMs. It supports multiple programming languages and provides an online judge for evaluation and reinforcement learning datasets. It is intended for developers and researchers working with LLM code generation and evaluation.

✨ Key features

  • Run code snippets in 20+ languages including Python, C++, Java, Go, Rust, and more.
  • Supports Jupyter mode for Python3.
  • Online judge implementations for popular benchmarks like HumanEval, MBPP, CodeContests, and more.
  • GPU support for CUDA and Python GPU execution.
  • Docker and manual installation options with local service binding.
  • Unit testing and development tools with hot reload.

🎯 Use cases

  • Evaluate LLM-generated code against standard benchmarks like HumanEval and MBPP.
  • Run code snippets in a secure sandbox for testing or execution.
  • Implement custom evaluation pipelines for code generation models.
  • Support reinforcement learning environments that require code execution.
  • Run unit tests for code in multiple languages.

📦 Installation

🧰 Requirements: Requires Docker or conda and poetry for manual installation; Linux host-network mode recommended for Docker; service binds to 127.0.0.1:8080 by default.

Docker

Build the image locally:

docker build -f ./scripts/Dockerfile.base -t code_sandbox:base .
change the base image in Dockerfile.server
sed -i '1s/.*/FROM code_sandbox:base/' ./scripts/Dockerfile.server
docker build -f ./scripts/Dockerfile.server -t code_sandbox:server .
Linux host-network mode keeps the service local-only at 127.0.0.1:8080
docker run -d --rm --network host code_sandbox:server

Manual

Prerequisites: conda, poetry

To install the sandbox service:

conda create -n sandbox -y python=3.12
conda activate sandbox
poetry install
to build the real docs, run `cd docs && npm ci && npm run build`
mkdir -p docs/build
make run

By default, the service now binds to 127.0.0.1:8080.

For local development with hot reload:

make run-dev

🚀 Usage

The README does not provide a minimal code example for using the service. It only describes installation and testing commands. For usage, refer to the documentation at https://bytedance.github.io/SandboxFusion/.

❓ FAQ

What languages are supported?

The sandbox supports Python, C++, C#, Go, Java, NodeJS, TypeScript, Scala, Kotlin, PHP, Rust, Bash, Lua, R, Perl, D, Ruby, Julia, Verilog, and CUDA (GPU), plus Python (GPU).

How do I run the service?

You can either build and run a Docker image or install manually with conda and poetry. After installation, run make run to start the service on 127.0.0.1:8080.

Can I use it for online judge tasks?

Yes, it includes implementations for evaluation datasets like HumanEval, MBPP, CodeContests, and more, which require code execution.

Is there a way to run tests?

Yes, you can run all unit tests with make test, a specific test with make test-case CASE=test_name, or with pdb using make test-case-pdb CASE=test_name.

📊 Repository

Stars★ 1,062
Forks🍴 104
Open issues🐛 28
Last commit🕒 Jul 14, 2026
Created📅 Oct 2024
Language💻 Python
License⚖️ Apache-2.0

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.