Sandboxes

An AI agent sandbox on a server you already run.

Each sandbox runs one command in a fresh Firecracker microVM or Docker container, with no network unless you allow it. After the command ends, FlatRun collects its output and the files you asked for, then removes the instance. Your agent starts it and reads the results through the API.

Open source, MIT licensed · Runs on any Linux server with Docker

Sound familiar?

Your agent needs somewhere to execute the code it writes.

A Docker container shares your server's kernel with the code it runs. A Firecracker microVM gives each sandbox its own kernel, so the code cannot reach the host kernel directly.

How it works

Three steps, on a server you control.

  1. 01

    Send an image and a command

    Post them to the API with a timeout of up to an hour. Missing images are pulled.

  2. 02

    Choose the runtime

    Firecracker gives each sandbox its own kernel and no network unless you turn it on. Docker is there for code you trust.

  3. 03

    Read the result

    Values passed through secret_env are replaced by [REDACTED] in the output. Up to 16 paths are saved as archives, without redaction.

Output

New sandbox

Before you get started.

Does a sandbox stay running between calls?

No. Each one runs a single command and is removed when it finishes, times out or is cancelled. Its record, output and files stay.

What does Firecracker need?

A Linux host with /dev/kvm and the agent running as root, plus the binaries, guest kernel and guest init listed in the Runs and Firecracker guide. Until then, sandboxes that ask for Firecracker are refused and Docker ones keep working.

How does my agent call it?

Send POST /api/runs with an API key that has the runs:write permission. Reading the output and files needs runs:read.

More of FlatRun

Star us on GitHub