Skip to main content
The Disk resource mounts a local directory at some prefix such as /data/. All operations are backed by real files on disk. Path resolution validates against the root boundary to prevent directory traversal escapes.

Config

DiskResource(root=...) takes a single root path argument pointing to the directory to mount. Both READ and WRITE modes are supported.

Filesystem Layout

The Disk resource mirrors the structure of the root directory. For example, if root="/srv/files" contains:
Then mounting at /data/ exposes:
Paths like ../../etc/passwd are rejected - resolution is always confined to the root boundary.

Cache

The Disk resource uses IndexCacheStore with index_ttl = 60 (1 minute). Directory listings are cached for up to 60 seconds before being refreshed from disk.

Example

Shell Commands

The Disk resource supports the full set of shell commands since it operates on real file content (text, binary, JSON, CSV, etc.):

Read Commands

Text Processing

File Operations

Path Utilities

Compression

Encoding

Data Format Support

Commands with format-specific variants for structured data files: These variants auto-detect the format by extension and convert to tabular text (CSV) for processing.

Use Cases

  • Local directory access: Mount local directories for AI agents to read and process
  • Sandboxed file access: Restrict agent file operations to a specific directory tree
  • FUSE mounting: Expose disk files through a virtual FUSE mount for external tools
  • Data pipelines: Process local datasets with shell-like commands
  • Development: Test file operations against real data before deploying to cloud resources