_ _ | | (_) | | _ __ _ _ __ | | | |/ _` | '_ \ | |____| | (_| | | | | |______|_|\__,_|_| |_| Time-travelable AI Agents Sandbox Runtime ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ QUICK START ─────────────────────────────────────────────────────────────────────────────── # 1. Build the CLI git clone https://github.com/anthropics/harness.git && cd harness cargo build --release -p harness-cli # 2. Set your token (contact admin for access) export HARNESS_TOKEN=harness_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 3. Create a sandbox ./target/release/harness create --name my-sandbox # 4. Run commands ./target/release/harness exec -- uname -a ./target/release/harness exec -- curl https://httpbin.org/ip # 5. Interactive shell ./target/release/harness exec --pty -- /bin/bash # 6. Clean up ./target/release/harness rm ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ CLI COMMANDS ─────────────────────────────────────────────────────────────────────────────── Sandbox Management: harness create [--name NAME] Create a new sandbox harness ls List all sandboxes harness use NAME Set current sandbox harness current Show current sandbox harness get [NAME] Get sandbox details harness rm [NAME] Remove a sandbox Command Execution: harness exec [NAME] -- CMD Run command in sandbox harness exec --pty -- CMD Interactive PTY session Time Travel (Snapshots & Branches): harness commit [-m MSG] Create a snapshot (commit) harness log Show commit history harness branch NAME Create branch at current commit harness branches List all branches harness checkout TARGET Switch to branch or commit ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ AUTHENTICATION ─────────────────────────────────────────────────────────────────────────────── Token can be provided via: 1. CLI flag: harness --token TOKEN ls 2. Environment: HARNESS_TOKEN=TOKEN harness ls 3. Config file: ~/.harness/config.toml token = "harness_xxx" Guest requests from inside VMs use the vsock proxy (X-Harness-Sandbox-Id) and bypass bearer auth. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ API ENDPOINTS ─────────────────────────────────────────────────────────────────────────────── GET /health Health check (no auth) POST /sandboxes Create sandbox GET /sandboxes List sandboxes GET /sandboxes/{id} Get sandbox DEL /sandboxes/{id} Destroy sandbox POST /sandboxes/{id}/exec Execute command GET /sandboxes/{id}/exec/ws WebSocket exec (PTY) POST /sandboxes/{id}/snapshots Create snapshot GET /sandboxes/{id}/snapshots List snapshots DEL /sandboxes/{id}/snapshots/{snapshot_id} Delete snapshot POST /sandboxes/{id}/branches Create branch GET /sandboxes/{id}/branches List branches GET /sandboxes/{id}/branches/{name} Get branch by name POST /sandboxes/{id}/branch Checkout (restore) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ NOTES ─────────────────────────────────────────────────────────────────────────────── Sandbox status values are normalized: starting | ready | error WebSocket exec uses binary frames (see crates/harness-protocol) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━