Skip to main content
A sandbox’s deployment status tells you whether it’s ready for work. Set an expiration policy so Baseten deletes the sandbox and its local data when it expires, even if your application stops before cleanup. Retrieve the task’s result before the sandbox’s deadline, then delete the sandbox.

Deployment status

A create request returns once the sandbox is DEPLOYED. Check status later with Get a sandbox, or on the sandbox’s detail page in the dashboard.
  • DEPLOYING: deployment is in progress.
  • DEPLOYED: the sandbox is ready.
  • DEACTIVATING: the sandbox is going idle.
  • DEACTIVATED: the sandbox is on standby. Its files and processes persist, and the next request resumes it.
  • FAILED: deployment failed.
  • DELETING: deletion is in progress.
  • TERMINATED: deletion has completed.
DEPLOYED means the environment is ready, not that a task succeeded. Confirm a task by its command’s exit status and output. Deletion is asynchronous. A delete request returns DELETING. Repeat the get request until the status is TERMINATED or the sandbox is no longer found.

Expiration policy

An expiration policy deletes a sandbox automatically. Set one when you create a sandbox, so a sandbox your application forgets to delete doesn’t keep running. Set the policy when you create the sandbox. The CLI has no expiration flag, so use the dashboard’s Time to live or one of these interfaces. These examples delete the sandbox 1 hour after creation:
A sandbox’s expires_in field shows the seconds until it expires. Each policy type measures time differently:
  • TTL_MAX_AGE: deletes the sandbox a set duration after creation. Idle time counts, and activity doesn’t extend it. Time to live in the dashboard sets this policy.
  • TTL_IDLE: deletes the sandbox after a set duration without activity.
  • DATE: deletes the sandbox at an ISO 8601 timestamp, such as 2026-10-02T18:00:00Z.
You can combine types, one policy of each. Baseten deletes the sandbox when the first condition occurs. Choose a duration that covers setup, execution, and retrieving results. The sandbox’s detail page shows the deadline as Date of termination.

Local data

Deletion and expiration permanently remove a sandbox’s local data. A new sandbox from the same image starts with the image’s contents, not the deleted sandbox’s working files. Save outputs outside the sandbox before its deadline. If a sandbox expires before your work completes, create a new one with a lifetime that covers your work, and restore the outputs you saved outside it.