Databricks Sandbox

Important

This feature is in Beta. To enable this feature preview in the workspace, opt into the Databricks Sandbox setting in the workspace Previews page. See Manage Azure Databricks previews.

Databricks does not currently charge for usage of this feature. However, cost and pricing for features in Beta are subject to change.

Databricks Sandbox lets you run untrusted code in an isolated environment through the Databricks REST API, SDK, or Databricks CLI. The sandbox provides serverless, on-demand compute for running code dynamically.

Each sandbox includes a persistent home directory. You can stop and start a sandbox at any time, and the data in your home directory persists.

The sandbox is ideal for:

  • Running an agent harness.
  • Executing user-written or AI-written code.
  • Running background tasks or workers.
  • Launching interactive IDE or SSH sessions.

Prerequisites

Get started

To create a sandbox and run code in it, see Databricks Sandbox quickstart. The quickstart covers each way to use a sandbox:

  • A sandbox tool for agents that you build with the Agent Bricks CLI.
  • The Databricks SDK for Python, the recommended way to work with sandboxes from code.
  • The Databricks CLI, to connect to a sandbox over SSH.

Compute size

Databricks Sandbox comes with 4 vCPUs and 8 GB of RAM. This size is not configurable.

Storage

Warning

At the end of the Beta period, Databricks might perform a one-time purge of data stored in sandboxes. Do not store anything you cannot afford to lose.

Databricks Sandbox comes with network-attached storage.

  • Data in your home directory (/home/sandbox-agent) persists for the lifetime of your Databricks Sandbox. Even after stopping your Databricks Sandbox, the data in your home directory is available when you start your next session.
  • Your home directory can store up to 100 GB. At this time, this cannot be changed.
  • You can store up to 10 GB outside your home directory, but this data is deleted when you stop your sandbox.

Networking

There are no restrictions on network egress from a sandbox, and egress is not configurable.

Usage costs

For complete billing usage information, see Databricks pricing. Databricks anticipates billing sandbox usage for:

  • Runtime compute: Billed hourly while your Databricks Sandbox is running.
  • Persistent storage: You are billed for the data stored in your home directory until your Databricks Sandbox is deleted. Storage incurs billing as long as the Databricks Sandbox instance exists. To stop paying for storage, you must delete the sandbox.
  • Data transfer

Limitations

  • Quotas are enforced. You can have at most 40 active sandboxes per user (400 total across all states), and a workspace can have at most 100 active sandboxes (1,000 total).
  • Databricks Sandbox is a compute primitive for running code, not a general-purpose Spark runtime. For Spark workloads, use Connect to serverless compute.
  • The public IP addresses of your Databricks Sandbox can change at any time. The default ingress of the sandbox is closed to all traffic. This cannot be changed at this time.
  • You cannot customize your environment at startup or persist an environment outside your home directory. To reuse packages or configurations across sessions, store them in your home directory.