The Runtime blog
How to build and run AI agents on Runtime: sandboxes, apps, CI/CD and jobs, with code that runs.
35 pages
- Sandbox cold start benchmarks: what the published numbers leave outPublished sandbox start times differ in where the clock runs, where it stops, the shape and the percentile.
- Computer use on a Linux desktop: run a computer-use agent safelyStart a desktop in a sandbox, send its screenshots to the model, and turn each action it returns into one click, key press or screenshot.
- Move files in and out of agent sandboxes: uploads, volumes and bucketsUpload the inputs, let the sandbox fetch big public data itself, keep reused data on a volume or bucket, and download only what changed.
- Scheduled AI agents: run an agent every night without a serverSchedule a job that starts a new sandbox on a cron line, runs the agent, writes its result to storage that persists, and exits.
- Stateful Python for agents: what survives a call, a pause and a crashGive each agent one long-lived Python session, keep the cells that build its state on disk, and replay them when the session restarts.
- What happens when your AI agent runs rm -rf: four setups comparedIt deletes whatever the command can reach: on a laptop, your work; in a sandbox with no credentials, a copy you rebuild in seconds.
- Don't merge what you didn't run: a test gate for agent-written codeA test gate reruns the agent's change on a clean machine and checks the tests themselves were not weakened, before anyone reviews it.
- Let your agent install its own tools: apt, pip and npm in a sandboxGive the agent an install tool that checks each name, uses the right package manager, and runs in a sandbox that can reach only registries.
- Multi-tenant AI apps: how to isolate each customer's codeGive every tenant's code its own microVM, tag it with the tenant, and check that tag on every request your backend makes for a user.
- See exactly what your AI agent did: commands, files and networkRecord every command and its output in your own code.
- The agent loop in 40 lines: a model, a sandbox and a stop conditionAn agent is a loop: call the model, run the tools it asks for, send the results back, and stop on a rule you wrote down first.
- Agent sandbox or serverless function: when each one fitsUse a serverless function for short, trusted steps that you wrote.
- Build a coding agent on an open model such as DeepSeek or QwenA coding agent is a loop: send the task and four tools to any OpenAI-compatible model, run each tool call in a sandbox, and stop at finish.
- Let an AI agent query your database without risking itGive the agent a read-only login on a copy of the data.
- Live previews for AI-built apps: serve a dev server from a sandboxRun the app's dev server in the agent's sandbox with spawn, share its port as a preview, and return the server's errors to the agent.
- Make your repo agent-ready: setup script, test command and imageA repository is agent-ready when one command sets it up, one command tests it, and a prebuilt image starts every agent there.
- AI agents that run for hours: time limits, checkpoints and recoveryAn agent that runs for hours needs a time limit on every machine, a checkpoint after every step, and a supervisor that restarts it.
- An undo button for AI agents: snapshot before every risky stepBefore an agent runs a step that could break its machine, save a copy; if the step fails, carry on from the copy.
- Five ways AI agents run up your cloud bill, and the limit for eachAn agent runs up a cloud bill through forgotten machines, runaway loops, busy processes, piled-up storage and traffic out.
- Give your AI agent a browser: Playwright in a sandboxRun Chromium in a sandbox.
- How to keep API keys away from AI agentsLet an agent use a key it never holds.
- Build a GitHub issue-to-pull-request agent that handles reviewLabel an issue and a webhook starts an agent in that issue's own sandbox, which opens a draft pull request and wakes for each review.
- Build an AI data analyst that gets the numbers right on any CSVLoad the CSV into a sandboxed Python session, show the model a profile before it writes code, and reject any number it did not compute.
- One sandbox per project: the architecture behind AI app buildersAn AI app builder gives each project its own sandbox, pauses it between sessions, and keeps git, not the sandbox, as the record of the code.
- Reproducible agent evals: why every task needs a fresh machineAn agent eval is reproducible when each attempt starts on an identical, recorded machine, and you run enough trials to see past the noise.
- 12 questions to ask any agent sandbox provider, with Runtime's answersAsk a sandbox provider about isolation, measured speed, idle cost, pause, network, keys, limits, forks, images, uptime and switching.
- Best-of-N coding agents: run five attempts, keep the one that passesRun the same coding task in five sandboxes at the same time.
- Build a code interpreter tool for any LLM in under 100 linesA code interpreter tool is one function that the model can call.
- Cold starts in agent loops: why milliseconds per tool call add upAn agent makes dozens of tool calls per task, so per-call overhead multiplies; keep one warm sandbox per task and run the loop near it.
- Why your agent's sandbox shouldn't reach the whole internetGive an agent's sandbox an allow list of the few hosts its task needs.
- How prompt injection becomes code execution, and how to contain itPrompt injection becomes code execution when an agent with a shell obeys text it read.
- How to give an AI agent its own computer: four ways comparedGive an AI agent a disposable machine of its own: your laptop, a Docker container, a virtual machine, or a cloud sandbox made for agents.
- Pause, don't delete: why agent sandboxes should sleep between turnsPause an agent's sandbox between turns.
- Run Claude Code overnight in the cloud and wake up to a pull requestStart Claude Code headless in a cloud sandbox.
- What 1,000 AI agent runs cost, line by lineA thousand five-minute agent runs on 2 vCPU, 4 GiB sandboxes cost $3.54 on Runtime: CPU used plus memory held.