This feature is currently in private preview. During the preview, the Agent Drive feature is only available in the
us-was-1 region. Both your drive and your sandbox must be created in this region. Drive size is not configurable at the moment. A quotas system for drive storage is coming soon. Request access.- A drive can be attached to an already-running sandbox at any mount path, without needing to recreate the sandbox
- Multiple sandboxes can mount the same drive simultaneously with full read-write access.
- A specific subdirectory of a drive can be mounted using
drivePath(instead of mounting the entire drive). - Drives scale automatically with no fixed capacity limits. Pre-provisioning or run-time resizing is not required.
Use cases
Some examples of use cases are:- Passing data or files from one sandbox to another directly, without needing intermediary storage or services
- Storing tool call outputs and context histories for use in other agents
- Sharing common datasets across agents
- Creating a shared filesystem cache of package dependencies to speed up future agent/sandbox deployments
Create a drive
Learn more about authentication on Blaxel
Learn more about authentication on Blaxel
The Blaxel SDK requires two environment variables to authenticate:When developing locally, you can also log in to your workspace with Blaxel CLI (as shown above). This allows you to run Blaxel SDK functions that will automatically connect to your workspace without additional setup. When you deploy on Blaxel, authentication is handled automatically — no environment variables needed.
You can create an API key from the Blaxel console. Your workspace name is visible in the URL when you log in to the console (e.g.
app.blaxel.ai/{workspace}).Set them as environment variables or add them to a .env file at the root of your project:name and region. You can also optionally specify the display name and labels for the drive.
createIfNotExists() to retrieve an existing drive or create a new one if it doesn’t exist:
Mount a drive to a sandbox
Mount a drive to a running sandbox by specifying thedriveName, the mountPath (where the drive will appear in the sandbox’s filesystem), and optionally the drivePath (a subdirectory within the drive to mount).
/mnt/data inside the sandbox will be stored on the drive and persist even after the sandbox is deleted.
Mount a subdirectory
You can mount a specific subdirectory of a drive rather than its root. This is useful when a single drive contains multiple project directories:drivePath / drive_path controls the subtree visible to the sandbox. When combined with drive permissions, you can restrict a workload to a specific subfolder of a drive using the path field in a permission rule.Mount a drive as read-only
You can mount a drive in read-only mode:When drive permissions are configured with
mode: "read", read-only access is enforced both at the FUSE mount level and at the storage server level. The workload’s identity token is validated against the permission rules, preventing unauthorized remounting in read-write mode.List mounted drives
List all drives currently mounted to a sandbox:List all drives
To retrieve all drives in your workspace, use the built-in SDK pagination helper functions.Pagination is recommended for list operations because retrieving all available resources in a single request is slow and resource-intensive, and therefore does not scale well.
data array and a meta object:
meta.nextCursor as cursor on the next request and repeat until meta.hasMore is false:
Get drive details
Retrieve details about a specific drive:CLI
