Skip to main content
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.
Agent Drive is a distributed filesystem that can be mounted to multiple sandboxes or agents at any time, including while they are already running. Drives support concurrent read-write access (RWX) from multiple sandboxes simultaneously, with built-in replication for durability. Unlike volumes, which are block storage devices attached at sandbox creation to a single sandbox, drives behave like a shared cloud filesystem, but mounted directly into a sandbox’s file tree. An optimized FUSE client built specifically for this filesystem is added directly to the sandbox or agent to give a POSIX-compliant interface.
  • 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

The Blaxel SDK requires two environment variables to authenticate: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:
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.
Create a standalone drive by specifying a unique name and region. You can also optionally specify the display name and labels for the drive.
You can also use 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 the driveName, the mountPath (where the drive will appear in the sandbox’s filesystem), and optionally the drivePath (a subdirectory within the drive to mount).
Once mounted, any file written to /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:
The same drive can be mounted read-write in one sandbox and read-only in others. However, any write attempt to a drive mounted as read-only will fail with a permission error.
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.

Access a drive over S3

Every drive also exposes an S3-compatible HTTP endpoint, so you can read and write its contents directly from any S3 client, such as the AWS CLI, boto3, or the AWS SDK for JavaScript, without mounting the drive into a sandbox first. Requests must use SigV4 signing and path-style addressing (the bucket in the path, not the hostname). Credentials are a service account’s API key: AWS_ACCESS_KEY_ID is the API key’s record ID and AWS_SECRET_ACCESS_KEY is its raw secret value — not the service account’s OAuth client ID/secret pair. Personal API keys and OAuth tokens are not supported for S3 access.
Drive permission rules (labels, path, mode) are not currently enforced for S3 access. A valid service-account API key grants full read-write access to every drive in the workspace over S3, regardless of any drive permissions configured on them. Only issue S3 credentials to service accounts you’re comfortable giving full access to all drives in the workspace; enforcing permission rules over S3 is planned but not yet available.
API keys created before S3 support was added may not work for SigV4 signing and will return InvalidAccessKeyId. If you hit this error, create a new API key for the service account (or rotate the existing one) and use the new credentials.

Find a drive’s S3 endpoint and bucket

The endpoint is returned in the drive’s state as s3Url, in the form {endpoint}/{bucket}:
The bucket is the last path segment of s3Url; the rest of the URL is the endpoint to pass to your S3 client.
The Blaxel CLI does not currently expose the S3 endpoint via bl drive get. Use the TypeScript or Python SDK to retrieve it until CLI support is added.

Use the AWS CLI

Export the service account’s API key as AWS-style credentials, then use standard aws s3 commands with --endpoint-url and --region set to the drive’s endpoint and region:
The region passed to the S3 client must match the drive’s region, and the endpoint must be called with path-style addressing (the default for most S3 clients when a custom endpoint is set).

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.
For more information on the SDK pagination helpers, refer to the SDK reference documentation. Pagination is also available via the Management API list endpoint. Request the first page:
The response includes a data array and a meta object:
Pass meta.nextCursor as cursor on the next request and repeat until meta.hasMore is false:
For accounts with multiple workspaces, specify the workspace as an additional request parameter, such as ?workspace=WORKSPACE_NAME&..., or via an additional X-Blaxel-Workspace: WORKSPACE_NAME header in the request.
For more information, refer to the API reference documentation.

Get drive details

Retrieve details about a specific drive:
CLI

Unmount a drive

Unmount a drive from a running sandbox by specifying the mount path:

Delete a drive

Complete code examples demonstrating all operations are available in Blaxel’s GitHub repositories, for TypeScript, for Python, and for Go.

Full example

The following example creates a drive, creates a sandbox from a custom sandbox image using its image ID, mounts the drive, writes a file to the mounted path, and reads it back:

Drive permissions

Restrict which sandboxes, agents, or jobs can access a drive.

Sandboxes overview

Learn about sandbox lifecycle and configuration.
Last modified on July 28, 2026