On Runtime, every sandbox pauses itself after 300 seconds of inactivity. Its files, memory and running processes are kept. The next request wakes it. A 2 vCPU, 4 GiB sandbox that stays running with nothing to do costs $0.03125 an hour. Paused, it costs $0.08 per GB of saved state per 30-day month (pricing).
Why it matters for AI agents
Agents are idle most of the time. A coding agent waits for its model between
commands. A user who opened a session may leave without closing it. Code that
does not call stop() after an error leaves a machine running until someone
notices. Idle pause is a timer on the server that catches all of these cases.
The agent does not have to remember anything.
Pausing works better than stopping for this job, because nothing is lost. A dev server, an open REPL or a half-built project is still there after the wake.
Runtime's idle pause
| Setting or behavior | Detail |
|---|---|
idlePauseSeconds |
60 to 86,400 seconds; 0 turns it off |
| What counts as activity | A request, a command or terminal running, an open connection, traffic or CPU use |
| Default | 300 seconds, for every sandbox that can pause |
idlePauseUnusedOnly |
true only for the old default of a sandbox made before 27 September 2026 |
| After the pause | The next request wakes it, unless autoWake is false |
| A visit to a preview | Wakes it behind a short "Waking up" page that reloads itself |
| Change it later | sbx.update({ idlePauseSeconds }), or the API's :update |
The idle time counts from the last activity. A background job that computes or downloads keeps the sandbox awake. A job that only sleeps does not (API).
Set it
TypeScriptimport { Sandbox } from "withruntime";const sbx = await Sandbox.create({ idlePauseSeconds: 600 }); // ten quiet minutesconsole.log(sbx.info.idlePauseUnusedOnly); // false: counts from the last activityawait sbx.update({ idlePauseSeconds: 0 }); // never pause for idlenessawait sbx.stop();Pythonfrom withruntime import Sandboxsbx = Sandbox.create(idle_pause_seconds=600)sbx.update(idle_pause_seconds=0)sbx.stop()Idle pause and a time limit
Idle pause asks one question: "is anyone using it?" On Runtime, it is what ends
a sandbox that nobody uses. There is no time limit unless you set one. A
time limit answers a different
question: "has it run long enough?" timeoutSeconds ends the run at a fixed
time, whatever is happening. Then the sandbox pauses or stops, as onLeaseEnd
says. Most agent sandboxes need idle pause alone. Billing starts when a sandbox
runs again after a wake (wake on request).
Related
- How to pause and resume a sandbox
- How to extend a sandbox's time limit
- How to preview apps an AI agent builds
- What is a warm pool?
Facts on this page were checked on 25 October 2026.