What to run in an AI agent sandbox
Flashbox fits the commands an agent runs between model calls: short, frequent and mostly waiting. These are the patterns it is built for.
A web-fetch tool for your agent
const r = await sb.run("curl -sL https://news.ycombinator.com | grep -o 'titleline.\\{0,120\\}' | head -5");
Read and search a repository
await sb.run("git clone -q --depth 1 https://github.com/expressjs/express");
const hits = await sb.run("rg -n 'req.query' express -g '*.js' | head -20");
Small data jobs in Python or Node
await sb.files.write("data.csv", csv);
const r = await sb.run("python3 -c \"import csv,sys; print(sum(float(r['amount']) for r in csv.DictReader(open('data.csv'))))\"");
Try, undo, try again
const before = await sb.run("cp config.json config.bak");
await sb.run(agentProposedEdit);
if ((await sb.run("node validate.js")).exitCode !== 0) await sb.rollback(before.checkpoint.id);
Explore approaches in parallel
const base = await sb.run("echo ready");
const forks = await fb.fork(base.checkpoint.id, 4);
await Promise.all(forks.map((f, i) => f.run(plans[i])));
Building something heavier? Package installs, builds and test suites belong on a full machine; see the comparisons.