Skip to main content
DatabricksVolumeVFS exposes files from a Unity Catalog volume through Mirage’s standard filesystem interface. Agents can list, stat, read, stream, glob, and write files under the configured volume root. For auth and environment setup, see Databricks Volume Setup.

Config

Fields marked secret are redacted in snapshots.

Mount mode

read, write or exec. Use exec if python3 or js should run scripts from the mount.

VFS.md

The VFS.md an agent reads with Databricks Volume mounted at /<path>.

Virtual Filesystem

Supported Unix Commands for VFS

Unix commands work on each path as on a local filesystem, as far as the path supports them:

Limitations of Unix Commands for VFS

Where a path differs from a local filesystem:Run man <cmd> or <cmd> --help for one command’s usage.
Mirage maps the configured mount prefix onto the configured volume subtree. Given:
and mount prefix /dbx/, the volume path:
appears in Mirage as:
root_path is normalized before use, and Mirage rejects any virtual path that would escape above that configured subtree.

Supported operations

Reads: readdir, stat, exists, read (streamed whole or a byte range), and glob resolution. Writes: write, create, mkdir, rmdir, unlink, recursive rm, cp, and mv. mv and cp download and upload the file. These operations are not atomic because the Files API has no server-side rename. A directory mv removes only what it copied: a file or directory written into the source after the copy listed its directory stays there, and mv fails with Directory not empty.

Shell Commands

The Databricks Volume VFS supports shell commands that operate on real file content. Reads use the Files API with range requests, so commands like head -c BYTES avoid downloading the whole object. The supported set is scoped to commands that work over the volume API (no compression, encoding, or local-only utilities).

Read Commands

Text Processing

File Operations

Path Utilities

Rotating tokens

Pass a callback as token when your application refreshes access tokens:
This callback reads the application’s current token. Replace its body with your credential broker or token store. The callback takes no arguments and returns str or SecretStr. It can be synchronous or asynchronous. Mirage runs a synchronous callback off the event loop and awaits any returned awaitable. Mirage resolves the callback before each HTTP request, including each directory page. A deferred read stream resolves its token when the stream opens. Cached reads, construction, and snapshots do not invoke the callback. Tokens must be nonblank and contain no carriage return or newline. Your callback owns token refresh, caching, and coordination between concurrent requests. Mirage propagates provider errors and authentication failures. It does not replay a request after a 401 or fall back to profiles or default credentials. Keep each VFS and workspace bound to one principal and permission scope. Isolate file caches, indexes, and external cache prefixes across identities. If the principal or permission scope changes, rebuild the workspace or invalidate its caches. Token rotation for the same principal and scope can keep the existing VFS.

Snapshot behavior

Mirage redacts static tokens and token callbacks in VFS snapshots. Restore the mount through mounts= when loading the workspace.

Databricks Apps

Keep Mirage in-process and supply the workspace host and token explicitly. Your application’s OAuth or SDK integration can supply a token callback. This does not require FUSE. The agent accesses the mounted workspace through Mirage’s backend adapters or Workspace.shell(...).

Example

See:
  • examples/python/vfs/databricks_volume/databricks_volume.py
  • examples/python/agents/langchain/databricks_volume_deepagent.py

Use Cases

  • Agents in Databricks Apps: mount a Unity Catalog volume in-process so an agent can read and write governed files without FUSE or hardcoded credentials.
  • Reading governed datasets: expose a reports or dataset subtree through root_path and query it with shell commands.
  • Sandboxed volume access: scope an agent to a single volume (and optional root_path) so it cannot read or write outside that subtree.
  • Writing agent outputs back: persist generated files to the volume with write, cp, and mv.