Run AI Code and Apps
Secure, elastic infrastructure for AI-generated code and the apps it becomes - on a real Linux machine, not a throwaway container.
import { Sandbox } from "@buddy-works/sandbox-sdk";
const sandbox = await Sandbox.create({
identifier: "agent-run-42",
os: "ubuntu:24.04",
});
await sandbox.start();
await sandbox.runCommand({ command: "npm test" });
await sandbox.stop();- sandbox: my-sandbox
name: My Sandbox
os: ubuntu:24.04
resources: 2x4
timeout: 3600
app_dir: /buddy
apps:
- npm start
endpoints:
- name: www
endpoint: 3000
type: HTTPTrusted by the world's leading engineering teams
Every Sandbox, by the Numbers
A Stateful VM That Survives the Run.
Other cloud sandboxes hand your code a container that forgets everything, dies on a clock and has no address. Buddy gives you a whole Linux machine that stays yours - your own disk, root access, a public URL.
Persistent disk
Come back a week later to your files, packages and warm caches, untouched.
Root permissions
Install anything with passwordless sudo, run Docker inside, add system users.
SSH access
Connect with the keys already on your Buddy profile, or attach VS Code Remote-SSH.
Auto start/stop
Stops itself when idle and wakes on the next request to an endpoint.
Snapshots
Start every agent from a prepared state instead of waiting on npm install.
Preinstalled toolchain
Boots with node, docker, go, python3, git and popular coding agents preinstalled.
Built for Agents.
Your agents write the code. Buddy gives them a real machine to run it on, reachable from the tools they already drive.
Your Agent Tests What It Just Shipped.
Your agent runs the application, then checks it - no print statements in your code, no logs pasted into a chat window.
- 01
It runs the app
Supervised, restarts on boot, and no timeout unless you set one.
bdy sb app add my-sandbox "npm start" - 02
It gets a URL to hit
Hits the app over HTTP, optionally behind Buddy sign-in.
bdy sb ep add my-sandbox -e 3000 --buddy - 03
It reads what the app did
Each app keeps its own log stream, separate from command output.
bdy sb app logs my-sandbox - 04
It sees whether the request even arrived
Turn on request logging and every request reaching the endpoint becomes a log of its own.
Sandbox logs
Commands, Files, Git, and Apps.
Every operation is an API call - one Sandbox from your terminal, or a fleet from your own product.
REST API: run a commandconst cmd = await sandbox.runCommand({
command: "npm test",
stdout: process.stdout,
});
await cmd.wait();
console.log(cmd.data.exit_code);await sandbox.fs.uploadFile("./dist.tar", "/buddy/dist.tar");
const files = await sandbox.fs.listFiles("/buddy");
const report = await sandbox.fs.downloadFile("/buddy/out.json");
await sandbox.fs.deleteFile("/buddy/tmp");for (const app of sandbox.data.apps ?? []) {
console.log(app.command, app.app_status);
}
await sandbox.startApp(appId);
const { logs } = await sandbox.getAppLogs(appId);await Sandbox.create({
identifier: "task-42",
fetch: [{
type: "PROJECT_REPO",
ref: "feat/checkout",
build_command: "npm ci",
}],
});bdy sb exec command my-sandbox "npm test" --wait
bdy sb exec command my-sandbox "print(1+1)" --runtime PYTHON
bdy sb exec logs my-sandbox <command-id>bdy sb cp ./dist my-sandbox:/buddy --ignore "node_modules/**"
bdy sb cp my-sandbox:/buddy/out.json ./out.jsonbdy sb app add my-sandbox "npm run worker"
bdy sb app list my-sandbox
bdy sb app logs my-sandbox workerbdy sb create -i task-42 --fetch feat/checkout
bdy sb create --fetch "path=/buddy,artifact=web@1.4.0"Pay by the Minute.
Set the workload you actually run and see what the same machine costs elsewhere.
How does Buddy compare?
Compute only, at your settings - competitors bundle a disk with the machine, so storage stays out of this chart.
Competitor rates as published on 31 July 2026 · vercel.com · e2b.dev · daytona.io
Straight Answers.
What survives a restart?
The disk. Files, installed packages, database contents and build caches are all there when the machine comes back. Memory does not: running processes are terminated when a Sandbox stops. Apps defined in the Sandbox configuration start again on the next boot - anything you launched by hand from the terminal does not.
How is this different from a container?
A Sandbox is a machine you keep for as long as you want it: a persistent disk, passwordless sudo, Docker inside, and no lifetime cap unless you set a timeout. There are no volumes to attach, because the disk is local and durable by default.
Do I need a Dockerfile?
No. Set one machine up properly: system packages, runtimes, cloned repositories, warm dependency caches. Save it as a snapshot, and create every new Sandbox from that state. Nothing to build, nothing to push to a registry.
What happens when a Sandbox stops?
Compute stops being charged. The disk you keep is billed at the storage rate. Traffic on one of its endpoints starts it automatically, serves the request, and it goes back to sleep once the timeout elapses with no further activity. Running a command wakes it up too.
Who cleans Sandboxes up?
You do, on a rule you write. Buddy deletes nothing on a schedule of its own. Trigger a pipeline on the Sandbox: Time out event or on a branch being deleted, scope it by tag or identifier pattern, and it removes exactly what you decided it should.
How isolated is one Sandbox from another?
Each Sandbox is an isolated machine with its own filesystem, processes and network; code running in one does not see another. Inside a single Sandbox, standard Linux users are the boundary - give each parallel workload its own system user.
What is already installed?
Ubuntu 22.04 or 24.04 LTS, the buddy user with passwordless sudo, and node, docker, go, python3, git, curl, wget, jq, rsync, ripgrep, unzip, nano plus the bdy CLI - and popular AI coding agents.
How does an agent get access to my repository?
Access is granted on the resource, not on the machine: open the Project repository target and give the Sandbox read, or read-write if it should push. Fetching a private repository then needs no tokens inside the Sandbox, and a push needs no keys.
Who can see what my agent publishes?
Only who you decide. An endpoint can require Buddy sign-in, so a preview URL is as private as you make it. With Identity the app also knows who is looking - role and groups included - without a login flow of its own.