Skip to main content
Every sandbox has a maximum lifetime, controlled by the timeout setting. When the timeout expires, the sandbox is stopped. By default, a new sandbox stays alive for 5 minutes.
Timeout vs. Idle timeout — don’t confuse them:
  • Timeout is the maximum lifetime of the sandbox. It starts counting down from creation, regardless of activity, and always takes effect when it expires.
  • Idle timeout only fires when no client is connected for the configured duration.

Create a sandbox with a timeout

Update the timeout

You can use setTimeout / set_timeout to reset how much longer the sandbox should stay alive.

Lifecycle behavior

You can combine timeout with lifecycle to choose whether the sandbox is killed or paused when the timeout expires.
If you do not pass lifecycle, the sandbox is killed when the timeout expires.
Last modified on August 5, 2026