unsandbox.com

Anonymous remote code, compile, & execution API for humans & machine learning agents.

Docs 📚 View Pricing →
unsandbox.
CLI

A fast command-line client for executing code and running interactive sessions in unsandbox. Auto-detects languages, supports 42+ programming languages, and 30+ shells/REPLs.

Quick Start

# Download binary (Linux x86_64)
wget https://unsandbox.com/downloads/un
chmod +x un

# Set API key
export UNSANDBOX_API_KEY=usk_your_key_here

# Run any code file
./un script.py

# Start interactive session
./un session

Features

  • 42+ languages - Python, JavaScript, Go, Rust, C, C++, Java, Ruby, PHP, and more
  • Interactive sessions - Full shell access with 30+ shells and REPLs
  • Two-way file transfer - Send files in, collect artifacts out
  • Session recording - Full audit trail with --audit flag
  • Auto-detection - Detects language from file extensions and shebangs
  • Network modes - Zero-trust isolation or semitrusted with network access

Downloads

Pre-compiled Binary

Linux x86_64 (850KB)

Download un
Source Code

C source (45KB)

Download un.c

Documentation clarifications

Man Page (PDF)

Full reference manual

Download PDF
Man Page (HTML)

Online reference

View Online
Man Page (Source)

For local installation

Download un.1

Build from Source

# Requirements: GCC, libcurl-dev, and libwebsockets-dev
sudo apt-get install build-essential libcurl4-openssl-dev libwebsockets-dev  # Debian/Ubuntu
sudo dnf install gcc libcurl-devel libwebsockets-devel  # Fedora/RHEL

# Download and compile
wget https://unsandbox.com/downloads/un.c
gcc -Wall -O2 -o un un.c -lcurl -lwebsockets

# Install system-wide (optional)
sudo cp un /usr/local/bin/

Demo

Execute Code

Run a Script

./un hello.py
./un app.js
./un main.rs

With Environment Variables

./un -e DEBUG=1 -e NAME=World script.py

With Input Files (teleport files into sandbox)

./un -f data.csv -f config.json process.py

Get Compiled Binary (teleport artifacts out)

./un -a -o ./bin main.c

Interactive Sessions

Start a Shell Session

# Default bash shell
./un session

# Choose your shell
./un session --shell zsh
./un session --shell fish

# Jump into a REPL
./un session --shell python3
./un session --shell node
./un session --shell julia

Session with Network Access

./un session -n semitrusted

Session Auditing (full terminal recording)

# Record everything (including vim, interactive programs)
./un session --audit -o ./logs

# Replay session later
zcat session.log*.gz | less -R

Collect Artifacts from Session

# Files in /tmp/artifacts/ are collected on exit
./un session -a -o ./outputs

Session Persistence (tmux/screen)

# Default: session terminates on disconnect (clean exit)
./un session

# With tmux: session persists, can reconnect later
./un session --tmux
# Press Ctrl+b then d to detach

# With screen: alternative multiplexer
./un session --screen
# Press Ctrl+a then d to detach

List Active Sessions

./un session --list

# Output:
# Active sessions: 2
#
# SESSION ID                               CONTAINER            SHELL      TTL      STATUS
# abc123...                                unsb-vm-12345        python3    45m30s   active
# def456...                                unsb-vm-67890        bash       1h2m     active

Reconnect to Existing Session

# Reconnect by container name (requires --tmux or --screen)
./un session --attach unsb-vm-12345

# Use exit to terminate session, or detach to keep it running

Terminate a Session

./un session --kill unsb-vm-12345

Available Shells & REPLs

Shells: bash, dash, sh, zsh, fish, ksh, tcsh, csh, elvish, xonsh, ash

REPLs:  python3, bpython, ipython    # Python
        node                          # JavaScript
        ruby, irb                     # Ruby
        lua                           # Lua
        php                           # PHP
        perl                          # Perl
        guile, scheme                 # Scheme
        ghci                          # Haskell
        erl, iex                      # Erlang/Elixir
        sbcl, clisp                   # Common Lisp
        r                             # R
        julia                         # Julia
        clojure                       # Clojure

Usage Reference

Usage: ./un [options] <source_file>
       ./un session [options]

Commands:
  (default)        Execute source file in sandbox
  session          Open interactive shell/REPL session

Options:
  -e KEY=VALUE     Set environment variable (can use multiple times)
  -f FILE          Add input file (can use multiple times)
  -a               Return and save artifacts from /tmp/artifacts/
  -o DIR           Output directory for artifacts (default: current dir)
  -k KEY           API key (or set UNSANDBOX_API_KEY env var)
  -n MODE          Network mode: zerotrust (default) or semitrusted
  -h               Show this help

Session options:
  -s, --shell SHELL  Shell/REPL to use (default: bash)
  -l, --list         List active sessions
  --attach ID        Reconnect to existing session (ID or container name)
  --kill ID          Terminate a session (ID or container name)
  --audit            Record full session for auditing
  --tmux             Enable session persistence with tmux (allows reconnect)
  --screen           Enable session persistence with screen (allows reconnect)

Examples:
  ./un script.py                       # execute Python script
  ./un -e DEBUG=1 script.py            # with environment variable
  ./un -f data.csv process.py          # with input file
  ./un -a -o ./bin main.c              # save compiled artifacts
  ./un session                         # interactive bash session
  ./un session --list                  # list active sessions
  ./un session --attach unsb-vm-12345  # reconnect to session
  ./un session --kill unsb-vm-12345    # terminate a session
  ./un session --shell python3         # Python REPL
  ./un session --shell node            # Node.js REPL
  ./un session -n semitrusted          # session with network access
  ./un session --audit -o ./logs       # record session for auditing