What is idle pause?
Idle pause suspends a sandbox or VM after a set time with no activity, keeping its state, so nobody pays compute for a machine left open.
On Runtime idlePauseSeconds pauses a sandbox with its files, memory and
running processes, and the next request wakes it, usually in about half a
second. A 2 vCPU, 4 GiB sandbox left 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 on its model between
commands, and a user who opened a session goes to lunch without closing it.
Code that forgets to 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, without the agent having to remember anything.
Pausing is 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 behaviour | Detail |
|---|---|
idlePauseSeconds |
60 to 86,400 seconds; 0 turns it off |
| What counts as activity | An exec, file, process, terminal, desktop or preview request |
| Default | 300 seconds until first use, with no timeoutSeconds, image or snapshot |
idlePauseUnusedOnly |
true for that default; false for an idle time you set |
| 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 |
An idle time you set counts from the last request. The default only catches a sandbox that was created and never used (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 requestawait 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 the lease
Idle pause answers "nobody is using it". The lease
answers "it has run long enough": timeoutSeconds ends the run at a fixed time
whatever is happening, then pauses or stops as onLeaseEnd says. Most agent
sandboxes want both. A wake from idle gets a fresh lease of the sandbox's own
timeoutSeconds and is billed from the moment it runs again
(wake on request).
Related
- How to pause and resume a sandbox
- What is a sandbox lease?
- How to preview apps an AI agent builds
- What is a warm pool?
Facts on this page were checked on 25 September 2026.