When you create a Devbox, it is automatically given a maximum
lifetime. This prevents unwanted charges by leaving Devboxes running
when they are not needed. The default lifetime is 1 hour, but this can
be configured when you create the Devbox:
Configure either keep_alive_time_seconds or an idle policy, not both. Use
keep_alive_time_seconds when you want a fixed maximum lifetime for the Devbox.
Use lifecycle.after_idle with on_idle when you want Runloop to act only after
the Devbox becomes idle. Mixed configurations are not recommended for normal use:
depending on the API or client path, the request may be rejected or the idle policy
may take precedence over the fixed keep-alive timeout.
You can also configure your Devboxes to automatically shutdown or
suspend when they are idle using the lifecycle.after_idle launch parameter.
By default, Runloop will do nothing if your Devbox is idle. on_idle only applies to RUNNING Devboxes and the action won’t be taken if the Devbox is not in RUNNING state.
You can restrict what network resources a Devbox can access by applying a Network Policy. This is useful for security, compliance, and controlling costs.
# Create a policy that only allows specific hostspolicy = await runloop.network_policies.create( name="restricted-policy", allow_all=False, allowed_hostnames=["github.com", "api.openai.com"])# Create a devbox with the network policydevbox = await runloop.devbox.create( launch_parameters={ "network_policy_id": policy.id })
// Create a policy that only allows specific hostsconst policy = await runloop.networkPolicy.create({ name: "restricted-policy", allow_all: false, allowed_hostnames: ["github.com", "api.openai.com"]});// Create a devbox with the network policyconst devbox = await runloop.devbox.create({ launch_parameters: { network_policy_id: policy.id }});
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Runloop AI Docs","colors":{"primary":"#118362","light":"#118362","dark":"#118362"},"logo":{"light":"https://mintcdn.com/runloopai/Us2eHV2_UnUki3-j/logo/runloop-logo.png?fit=max\u0026auto=format\u0026n=Us2eHV2_UnUki3-j\u0026q=85\u0026s=f3caaf67e1c45f535be611579f752bad","dark":"https://mintcdn.com/runloopai/Us2eHV2_UnUki3-j/logo/runloop-logo.png?fit=max\u0026auto=format\u0026n=Us2eHV2_UnUki3-j\u0026q=85\u0026s=f3caaf67e1c45f535be611579f752bad","href":"https://runloop.ai"},"favicon":"https://mintcdn.com/runloopai/fWPbnslqIgBTzYjS/icon.svg?fit=max\u0026auto=format\u0026n=fWPbnslqIgBTzYjS\u0026q=85\u0026s=42689e938126fab53c09e6aefd2125a7","appearance":{"default":"dark"},"background":{"color":{"light":"#F9F9F9","dark":"#191B2E"}},"navbar":{"links":[{"href":"mailto:support@runloop.ai","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://platform.runloop.ai"}},"footer":{"socials":{"github":"https://github.com/runloopai","linkedin":"https://www.linkedin.com/company/runloopai","youtube":"https://www.youtube.com/@runloop-ai","x":"https://x.com/RunloopAI"}},"fonts":{"family":"Inter"},"styling":{"latex":false},"integrations":{"gtm":{"tagId":"G-DHKMJC9ETL"},"mixpanel":{"projectToken":"332c39ec74c2f00fba90d9e5cfd67791"},"posthog":{"apiKey":"phc_vW06f31Rk74Ey1ZbIS8Mfxx4oIQA3fIxTVn29qVr42c","sessionRecording":true}},"banner":{"content":"Runloop is winding down its services. Support for existing customers continues through November 13, 2026 at 11:59 PM PT. [Transition guides](/docs/transitions/overview).","dismissible":false},"contextual":{"options":["chatgpt","claude","copy"],"display":"header"},"interaction":{"drilldown":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"runloopai","hasAudioNarration":false,"actualSubdomain":"runloopai","customDomains":["docs.runloop.ai"],"gitSource":{"type":"github","owner":"runloopai","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6add1e0f29f48133ead15d81","collectionId":"90fcf6c3-4dd4-4d17-8ab9-583c417733c2","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6add1e0f29f48133ead15d81"},"feedback":{"edits":false,"thumbs":true,"issues":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6add1e0f29f48133ead15d81","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"default","tag":"API Reference","count":106},{"language":"default","tag":"Documentation","count":70},{"language":"default","tag":"Devbox","count":44},{"language":"default","tag":"Components","count":41},{"language":"default","tag":"Devboxes","count":22},{"language":"default","tag":"Overview","count":16},{"language":"default","tag":"axons","count":12},{"language":"default","tag":"Blueprint","count":11},{"language":"default","tag":"objects","count":9},{"language":"default","tag":"Transitions","count":8}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"theme.css","content":"code,pre{font-size:.85rem!important;line-height:1.4!important}"}],"page":{"pagePath":"docs/devboxes/start-stop","slug":"/docs/devboxes/start-stop","pageMetadata":{"title":"Devbox Lifetime Management","icon":"power-off","sidebarTitle":"Lifetime Management","description":"Control devbox automatic shutdown and idle behaviors","href":"/docs/devboxes/start-stop"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Control devbox automatic shutdown and idle behaviors\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(Tip,{children:[`Start with the `,_jsx(_components.a,{href:`/docs/tutorials/quickstart`,children:`Runloop Quickstart`}),` to use the examples below.`]}),`\n`,_jsx(Heading,{level:`3`,id:`manual-stopping`,children:`Manual Stopping`}),`\n`,_jsxs(_components.p,{children:[`You can stop a running Devbox any time using the `,_jsx(_components.code,{children:`devbox.shutdown`}),`\ncall in the client SDK.`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,numberOfLines:`3`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`devbox `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` runloop.devbox.create()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`...`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` devbox.shutdown()`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,numberOfLines:`3`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` devbox`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` runloop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`devbox`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`...`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` devbox`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`shutdown`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`3`,id:`devbox-max-lifetime`,children:`Devbox Max Lifetime`}),`\n`,_jsx(_components.p,{children:`When you create a Devbox, it is automatically given a maximum\nlifetime. This prevents unwanted charges by leaving Devboxes running\nwhen they are not needed. The default lifetime is 1 hour, but this can\nbe configured when you create the Devbox:`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,numberOfLines:`5`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`devbox `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` runloop.devbox.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` launch_parameters`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"keep_alive_time_seconds\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1800`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,numberOfLines:`5`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` devbox`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` runloop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`devbox`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` launch_parameters:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` keep_alive_time_seconds:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1800`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Configure either `,_jsx(_components.code,{children:`keep_alive_time_seconds`}),` or an idle policy, not both. Use\n`,_jsx(_components.code,{children:`keep_alive_time_seconds`}),` when you want a fixed maximum lifetime for the Devbox.\nUse `,_jsx(_components.code,{children:`lifecycle.after_idle`}),` with `,_jsx(_components.code,{children:`on_idle`}),` when you want Runloop to act only after\nthe Devbox becomes idle. Mixed configurations are not recommended for normal use:\ndepending on the API or client path, the request may be rejected or the idle policy\nmay take precedence over the fixed keep-alive timeout.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`idle-behavior`,children:`Idle Behavior`}),`\n`,_jsxs(_components.p,{children:[`You can also configure your Devboxes to automatically shutdown or\nsuspend when they are idle using the `,_jsx(_components.code,{children:`lifecycle.after_idle`}),` launch parameter.\nBy default, Runloop will do nothing if your Devbox is idle. `,_jsx(_components.code,{children:`on_idle`}),` only applies to `,_jsx(_components.code,{children:`RUNNING`}),` Devboxes and the action won’t be taken if the Devbox is not in `,_jsx(_components.code,{children:`RUNNING`}),` state.`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,numberOfLines:`7`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`devbox `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` runloop.devbox.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` launch_parameters`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"lifecycle\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"after_idle\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"idle_time_seconds\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1800`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"on_idle\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"suspend\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,numberOfLines:`7`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` devbox`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` runloop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`devbox`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` launch_parameters:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` lifecycle:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` after_idle:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`idle_time_seconds:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1800`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`on_idle:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"suspend\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`3`,id:`network-access-control`,children:`Network Access Control`}),`\n`,_jsxs(_components.p,{children:[`You can restrict what network resources a Devbox can access by applying a `,_jsx(_components.a,{href:`/docs/network-policies`,children:`Network Policy`}),`. This is useful for security, compliance, and controlling costs.`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,numberOfLines:`13`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`13`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Create a policy that only allows specific hosts`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`policy `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` runloop.network_policies.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"restricted-policy\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` allow_all`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` allowed_hostnames`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"github.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"api.openai.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Create a devbox with the network policy`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`devbox `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` runloop.devbox.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` launch_parameters`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"network_policy_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: policy.id`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,numberOfLines:`13`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`13`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Create a policy that only allows specific hosts`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` policy`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` runloop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`networkPolicy`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` name:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"restricted-policy\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` allow_all:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` allowed_hostnames:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"github.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"api.openai.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Create a devbox with the network policy`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` devbox`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` runloop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`devbox`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` launch_parameters:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` network_policy_id:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` policy`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`See the `,_jsx(_components.a,{href:`/docs/network-policies`,children:`Network Policies documentation`}),` for more details on creating and managing policies.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Devbox Lifetime Management","icon":"power-off","sidebarTitle":"Lifetime Management","description":"Control devbox automatic shutdown and idle behaviors","href":"/docs/devboxes/start-stop"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Manual Stopping","slug":"manual-stopping","depth":3,"children":[]},{"title":"Devbox Max Lifetime","slug":"devbox-max-lifetime","depth":3,"children":[]},{"title":"Idle Behavior","slug":"idle-behavior","depth":3,"children":[]},{"title":"Network Access Control","slug":"network-access-control","depth":3,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/runloopai/70ccb22e7cd1529e/scripts/generate-changelog.js","/_mintlify/custom/runloopai/6440a26b64c8b606/scripts/generate-llms-index.js"],"subdomain":"runloopai","siteName":"Runloop AI Docs","title":"Devbox Lifetime Management - Runloop AI Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-01T22:47:03.012Z","originalFileLocation":"docs/devboxes/start-stop.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Control devbox automatic shutdown and idle behaviors\">\u003cmeta data-mint-head name=\"application-name\" content=\"Runloop AI Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/runloopai/pjXnHMZq1DfDYUjd/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/runloopai/pjXnHMZq1DfDYUjd/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/runloopai/pjXnHMZq1DfDYUjd/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/runloopai/pjXnHMZq1DfDYUjd/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/runloopai/pjXnHMZq1DfDYUjd/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/runloopai/pjXnHMZq1DfDYUjd/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/runloopai/pjXnHMZq1DfDYUjd/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/runloopai/pjXnHMZq1DfDYUjd/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/runloopai/pjXnHMZq1DfDYUjd/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Devbox Lifetime Management - Runloop AI Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Control devbox automatic shutdown and idle behaviors\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Runloop AI Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.runloop.ai/docs/devboxes/start-stop\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://runloopai.mintlify.app/_mintlify/api/og/v2?division=Devboxes\u0026amp;title=Devbox+Lifetime+Management\u0026amp;description=Control+devbox+automatic+shutdown+and+idle+behaviors\u0026amp;theme=640224b746a7c52ddd40c033\u0026amp;signature=d6bd6c983a4d1ba4fb06fab7fb15e4b63f0e4baa5d6efe62297f8f97fa2389af\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Devbox Lifetime Management - Runloop AI Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Control devbox automatic shutdown and idle behaviors\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://runloopai.mintlify.app/_mintlify/api/og/v2?division=Devboxes\u0026amp;title=Devbox+Lifetime+Management\u0026amp;description=Control+devbox+automatic+shutdown+and+idle+behaviors\u0026amp;theme=640224b746a7c52ddd40c033\u0026amp;signature=d6bd6c983a4d1ba4fb06fab7fb15e4b63f0e4baa5d6efe62297f8f97fa2389af\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/runloopai/pjXnHMZq1DfDYUjd/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Runloop AI Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#118362\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.runloop.ai/docs/devboxes/start-stop\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/devboxes/start-stop.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.runloop.ai/#organization\",\"name\":\"Runloop AI Docs\",\"url\":\"https://docs.runloop.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/runloopai/Us2eHV2_UnUki3-j/logo/runloop-logo.png?fit=max\u0026auto=format\u0026n=Us2eHV2_UnUki3-j\u0026q=85\u0026s=f3caaf67e1c45f535be611579f752bad\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.runloop.ai#website\",\"name\":\"Runloop AI Docs\",\"url\":\"https://docs.runloop.ai\",\"publisher\":{\"@id\":\"https://docs.runloop.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.runloop.ai/docs/devboxes/start-stop#webpage\",\"url\":\"https://docs.runloop.ai/docs/devboxes/start-stop\",\"name\":\"Devbox Lifetime Management\",\"description\":\"Control devbox automatic shutdown and idle behaviors\",\"dateModified\":\"2026-07-01T22:47:03.012Z\",\"isPartOf\":{\"@id\":\"https://docs.runloop.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.runloop.ai/docs/devboxes/start-stop#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.runloop.ai/docs/devboxes/start-stop#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Components\",\"item\":\"https://docs.runloop.ai/docs/devboxes/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Devboxes\",\"item\":\"https://docs.runloop.ai/docs/devboxes/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Devbox Lifetime Management\",\"item\":\"https://docs.runloop.ai/docs/devboxes/start-stop\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.runloop.ai/docs/devboxes/start-stop#article\",\"headline\":\"Devbox Lifetime Management\",\"name\":\"Devbox Lifetime Management\",\"description\":\"Control devbox automatic shutdown and idle behaviors\",\"url\":\"https://docs.runloop.ai/docs/devboxes/start-stop\",\"mainEntityOfPage\":{\"@id\":\"https://docs.runloop.ai/docs/devboxes/start-stop#webpage\"},\"dateModified\":\"2026-07-01T22:47:03.012Z\",\"publisher\":{\"@id\":\"https://docs.runloop.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.runloop.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Runloop AI Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Runloop AI Docs","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Overview","pages":[{"title":"What is Runloop?","icon":"circle-info","href":"/docs/overview/what-is-runloop"},{"title":"Runloop Features","icon":"sparkles","href":"/docs/overview/runloop-features"},{"title":"Your Runloop Trial","icon":"gift","href":"/docs/overview/your-runloop-trial"},{"title":"Quickstart","icon":"rocket","href":"/docs/tutorials/quickstart"},{"group":"Tutorials","icon":"book","pages":[{"title":"Tutorials","sidebarTitle":"Overview","icon":"book","href":"/docs/tutorials/overview"},{"title":"Running Agents on Sandboxes","icon":"robot","href":"/docs/tutorials/running-agents-on-sandboxes"},{"title":"OpenAI Agents SDK + Runloop","sidebarTitle":"OpenAI Agents SDK","icon":"robot","href":"/docs/tutorials/openai-agentssdk-runloop"},{"title":"OpenAI Agents API on Runloop","sidebarTitle":"OpenAI Agents API (beta)","icon":"robot","href":"/docs/tutorials/openai-agents-api-runloop"},{"title":"OpenCode on Runloop","sidebarTitle":"OpenCode + Runloop","icon":"robot","href":"/docs/tutorials/opencode-runloop"},{"title":"Browserbase on Runloop","sidebarTitle":"Browserbase + Runloop","icon":"globe","href":"/docs/tutorials/browserbase-runloop"},{"title":"Kernel on Runloop","sidebarTitle":"Kernel + Runloop","icon":"globe","href":"/docs/tutorials/kernel-runloop"},{"title":"Axon + ACP with OpenCode","sidebarTitle":"Axon + ACP","icon":"plug","href":"/docs/tutorials/axon-acp-broker"}]},{"group":"Cookbooks","icon":"book-open","pages":[{"title":"Share a Live Preview","href":"/docs/tutorials/running-agents-on-sandboxes/share-live-preview"},{"title":"Suspend and Resume Workflow","href":"/docs/tutorials/running-agents-on-sandboxes/suspend-resume-workflow"},{"title":"Turn-Based Interaction with Agent","href":"/docs/tutorials/running-agents-on-sandboxes/turn-based-interaction"}]},{"title":"SDKs","icon":"code-branch","href":"/docs/tools/sdks"}]},{"group":"Transitions","icon":"right-left","pages":[{"title":"Transition guides","href":"/docs/transitions/overview"},{"title":"Transition from Reflex to the OpenAI Agents API","sidebarTitle":"From Reflex to OpenAI Agents API","href":"/docs/transitions/reflex-to-agents-api"},{"title":"Transition from Runloop to Tensorlake","href":"/docs/transitions/runloop-to-tensorlake"},{"title":"Runloop to Tensorlake validation plan","href":"/docs/transitions/runloop-to-tensorlake-validation"},{"title":"Transition from Runloop to Modal","href":"/docs/transitions/runloop-to-modal"},{"title":"Runloop to Modal validation plan","href":"/docs/transitions/runloop-to-modal-validation"},{"title":"Transition from Runloop to Freestyle","href":"/docs/transitions/runloop-to-freestyle"},{"title":"Runloop to Freestyle validation plan","href":"/docs/transitions/runloop-to-freestyle-validation"}]},{"group":"Tools","pages":[{"title":"Runloop Dashboard","icon":"gauge","href":"/docs/tools/dashboard"},{"title":"Runloop CLI","icon":"terminal","href":"/docs/tools/rl-cli"},{"group":"AI Integration","icon":"robot","pages":[{"title":"Support for AI tools","icon":"robot","href":"/docs/tools/ai-tools"},{"title":"Cursor Rules","sidebarTitle":"Cursor Rules","icon":"code","href":"/docs/tools/cursor-files"}]}]},{"group":"Components","pages":[{"group":"Devboxes","icon":"desktop","expanded":true,"pages":[{"title":"Devbox Overview","sidebarTitle":"Overview","icon":"circle-info","href":"/docs/devboxes/overview"},{"title":"The Devbox Lifecycle","icon":"arrows-rotate","href":"/docs/devboxes/lifecycle"},{"title":"Execute Commands on a Devbox","icon":"terminal","sidebarTitle":"Execute commands","href":"/docs/devboxes/execute-commands"},{"title":"Execution Logs","icon":"scroll","sidebarTitle":"Execution logs","href":"/docs/devboxes/execution-logs"},{"title":"Named Shells","icon":"square-terminal","sidebarTitle":"Named shells","href":"/docs/devboxes/named-shells"},{"title":"PTY Sessions","icon":"terminal","sidebarTitle":"PTY sessions","href":"/docs/devboxes/pty"},{"title":"Read and Write Files on a Devbox","icon":"folder","sidebarTitle":"Read and write files","href":"/docs/devboxes/files"},{"group":"Mounts","icon":"hard-drive","expanded":false,"pages":[{"title":"Mounts Overview","icon":"hard-drive","sidebarTitle":"Overview","href":"/docs/devboxes/mounts/overview"},{"title":"Mount AI Agents","sidebarTitle":"Agent Mounts","icon":"robot","href":"/docs/devboxes/mounts/agent-mounts"},{"title":"Mount a Code Repository on a Devbox","sidebarTitle":"Code Mounts","icon":"code-branch","href":"/docs/devboxes/mounts/code-mounts"},{"title":"Mount Storage Objects","sidebarTitle":"Object Mounts","icon":"file-arrow-up","href":"/docs/devboxes/mounts/object-mounts"},{"title":"Mount Files Inline","sidebarTitle":"File Mounts","description":"Inject file content directly into your Devbox at creation time","icon":"file-code","href":"/docs/devboxes/mounts/file-mounts"}]},{"title":"Devbox Lifetime Management","icon":"power-off","sidebarTitle":"Lifetime Management","href":"/docs/devboxes/start-stop"},{"title":"Devbox Snapshots","sidebarTitle":"Snapshots","description":"Saved diskstates from existing for devboxes for re-use \u0026 branching","icon":"camera","href":"/docs/devboxes/snapshots"},{"title":"Configuring Devbox Instance Sizes","sidebarTitle":"Instance sizes","icon":"expand","href":"/docs/devboxes/configuration/sizes"},{"title":"Configuring your devbox architecture","icon":"microchip","sidebarTitle":"Architecture","href":"/docs/devboxes/configuration/devbox-architecture"},{"title":"Managing Account Secrets","sidebarTitle":"Account Secrets","icon":"key","href":"/docs/devboxes/configuration/account-secrets"},{"title":"Agent Gateways","sidebarTitle":"Agent Gateways ✨","icon":"shield-check","href":"/docs/devboxes/agent-gateways"},{"title":"MCP Hub","sidebarTitle":"MCP Hub","icon":"plug","href":"/docs/devboxes/mcp-hub"},{"title":"Open a Tunnel to a Service on a devbox","sidebarTitle":"Tunnels","icon":"network-wired","href":"/docs/devboxes/tunnels"},{"title":"SSH Access","sidebarTitle":"SSH","icon":"terminal","href":"/docs/devboxes/ssh"},{"title":"Storage Objects","sidebarTitle":"Storage Objects","icon":"file-arrow-up","href":"/docs/storage-objects/overview"}]},{"group":"Advanced Devbox Topics","icon":"sparkles","pages":[{"title":"Managing Devbox Metadata","sidebarTitle":"Instance metadata","icon":"tags","href":"/docs/devboxes/configuration/metadata"},{"title":"Running Docker on a Devbox","icon":"docker","sidebarTitle":"Docker capability","href":"/docs/devboxes/capabilities/docker-in-docker"},{"title":"Configuring your bash environment","icon":"square-terminal","sidebarTitle":"Bash Profile","href":"/docs/devboxes/configuration/bash-profile-environment-setup"},{"title":"Configuring your devbox user profile","sidebarTitle":"Devbox User Profile","icon":"user-gear","href":"/docs/devboxes/configuration/user-parameters"}]},{"group":"Blueprints","icon":"diagram-project","expanded":false,"pages":[{"title":"Blueprints Overview","icon":"layer-group","sidebarTitle":"Overview","href":"/docs/devboxes/blueprints/overview"},{"title":"Files and Build Context","icon":"folder-open","sidebarTitle":"Files \u0026 Build Context","href":"/docs/devboxes/blueprints/files-and-mounts"},{"title":"Dockerfile Customization","icon":"docker","sidebarTitle":"Dockerfiles","href":"/docs/devboxes/blueprints/dockerfile-customization"},{"title":"Network Policies for Blueprints","icon":"shield-halved","sidebarTitle":"Network Policies","href":"/docs/devboxes/blueprints/network-policies"},{"title":"Blueprint Lifecycle","icon":"rotate","sidebarTitle":"Lifecycle","href":"/docs/devboxes/blueprints/lifecycle"},{"title":"Troubleshooting Blueprint Builds","icon":"question","href":"/docs/devboxes/configuration/troubleshooting/troubleshooting-blueprints"}]},{"group":"Agents","icon":"robot","expanded":false,"pages":[{"title":"Using the Agents API","sidebarTitle":"Agents API","icon":"robot","href":"/docs/devboxes/agents/using-agents-api"},{"title":"Deploying Agents with GitHub Actions","sidebarTitle":"GitHub Actions Deployment","icon":"github","href":"/docs/devboxes/agents/deploying-with-github-actions"}]},{"group":"Axons","icon":"bolt","expanded":true,"pages":[{"title":"Axons","sidebarTitle":"Overview","icon":"book-open","href":"/docs/axons/overview"},{"title":"Remote Agents SDK","sidebarTitle":"Remote Agents SDK","icon":"code","href":"/docs/axons/sdk"},{"title":"SQL Database","sidebarTitle":"SQL Database","icon":"database","href":"/docs/axons/sql"},{"group":"Broker","icon":"arrow-right-arrow-left","pages":[{"title":"Broker","sidebarTitle":"Broker","icon":"shuffle","href":"/docs/axons/broker"},{"group":"Protocols","icon":"plug","pages":[{"title":"ACP Protocol","sidebarTitle":"ACP","icon":"plug","href":"/docs/axons/broker/acp"},{"title":"Claude JSON Protocol","sidebarTitle":"Claude","icon":"message-bot","href":"/docs/axons/broker/claude"}]}]}]},{"title":"Network Policies","icon":"shield-halved","sidebarTitle":"Network Policies","href":"/docs/network-policies"}]},{"group":"Debugging","icon":"screwdriver-wrench","pages":[{"title":"Debugging Agents with rl-cli","sidebarTitle":"Debugging Agents with rl-cli","icon":"bug","href":"/docs/devboxes/configuration/troubleshooting/debugging-agent-output-with-ssh"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/devbox/create-or-reconnect-to-a-pty-session"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/docs/overview/release-notes"}]}]},"title":"Devbox Lifetime Management - Runloop AI Docs","buildId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","deploymentId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","dynamics":["10e4515597"],"chunks":["BannerMarkdown-CJDb0dYK.js","dist-Cv_O2fky.js","lib--scc4DXi.js","lib-B8HbPgcC.js","clsx-BGBGWFTt.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}