- Hard expiry (
expires_at): Fixed at creation + 24 hours (Unix milliseconds). Nothing—notStart,Stop,touch(), foregroundexec(), or disabling idle auto-stop—can extendexpires_at. - Idle auto-stop (
idle_timeout_seconds): Defaults to 1,800 seconds (30 minutes) without recognized activity. Stopping saves running Memory while preserving the Sandbox disk untilexpires_at.
Lifecycle outcomes
Read current policy and remaining time
Recognized activity vs. background processes
- Counts as activity: A foreground
execcall (while running), an explicitsandbox.touch()call, and changing idle policy viasandbox.idle.set(...). - Does NOT count as activity: Background CPU usage, daemons, detached background jobs, or network traffic alone. A background build can be idle-stopped unless idle timeout is raised or disabled.
Configure or disable idle auto-stop
In the Console, open Settings → Stop when idle (30 minutes, 60 minutes, or Never) or click I’m still using it (touch()).
Through the SDK, idle_timeout_seconds accepts 60 through 86,400 seconds, or omit the field ({}) to disable idle auto-stop:
- Set timeout (e.g., 1 hour)
- Disable idle auto-stop
- Refresh activity (Touch)
Resume after idle Stop
Ifstate === "stopped" and enough time remains before expires_at, call sandbox.start() explicitly. Like Computers, Start is a cold boot on the same disk—old process IDs and TCP sockets do not resume, and current Account entitlement + running Memory must still admit it.
Diagnose Sandbox lifecycle issues
Always budget time to export artifacts before
expires_at, and choose a Computer whenever work needs more than 24 hours or persistent retention. See Sandbox overview and Errors.