briqbriq

Sandbox

A machine for the agent's own code: scripts, tests, builds, anything that should not run on your computer. Ubuntu with Python, Node, git and a C toolchain, plus the psql, redis-cli and sqlite3 clients. Commands run with briq_exec. The :full tag adds pandoc, ffmpeg, the Python data libraries and Playwright with Chromium.

  • sandbox
  • testing

Guide: Run code in a sandbox

Run it

stack: app
services:
  sandbox:
    recipe: sandbox
    # its defaults, each a field you can set:
    # image: ghcr.io/briq-cloud/sandbox:latest
    # size: small
    # volume: { gb: 2 }

Fields

NameTypeOptionsDefault
imagestring—"ghcr.io/briq-cloud/sandbox:latest"
envunknown—{}
cmdstring | string[]——
sizeenumnano, small, medium, large"small"
volumeobject{ gb? }{"gb":2}
filesunknown——

Outputs

Returned by briq_run once the stack is healthy. Hosts resolve inside your team network; secrets are generated per run.

SANDBOX_HOST
sandbox.<stack>.internal
WORKDIR
/work
PORT
8080

What it runs

BriqImagePortsSizeVolume
sandboxghcr.io/briq-cloud/sandbox:latest8080small2 GB at /work

When to use it

  • Code the agent wrote, or code it does not trust, that should not run on your computer: a script, a test suite, a build, a tool to try.
  • Code that needs a real service: a Postgres or a Redis in the same stack.
  • Work that should stop on its own: the sandbox sleeps after its sleep window, and costs nothing asleep.

Step by step: Run code in a sandbox.

Tips

  • Files in, commands, files out: briq_files_put to /work/…, briq_exec with ["sh", "-c", "cd /work && …"], briq_files_get for what it wrote. Over a minute: async: true (Run a long command).
  • A repo: git clone it from inside with briq_exec. Uploads are capped at 1 MB a file.
  • What the image has: every tool and its version on the sandbox reference. image: "ghcr.io/briq-cloud/sandbox:full" adds document and media tools, the Python data libraries and a browser. Another image: "golang:1.25", "ubuntu:24.04", anything with sh.
  • Credentials as secrets: env: { GITHUB_TOKEN: { secret: "GITHUB_TOKEN", value: "…" } }. The commands read $GITHUB_TOKEN; status and audit show its name only. Make the token for the task (read-only, expiring), never a key to your cloud: the code runs with an open internet.
  • A server it starts gets a URL: expose: "private" at run; whatever listens on $PORT (8080) serves at URL.
  • Prepare once, run many: install the dependencies, then briq_fork for each attempt. The forks start with /work as it was.
  • small for scripts and tests; medium or large for a build.
  • It can reach the internet and the team's other briqs: see Security.

On this page

Free to try

Let your agent try it, on us.

Every new account starts with €10 of credits. No card.

Connect your agent

How can we help?

Message to the briq team
hello@briq.cloud