Overview
Cloudflare Computer offers a revolutionary virtual filesystem solution, empowering your agents with a computer-like environment. This system leverages Durable Objects to manage the authoritative state via SQLite, providing a pluggable execution surface through workspace.runtime. It's designed to give your agents the power of a full filesystem, accessible within the Cloudflare Workers ecosystem.
Key Features
- Durable Object State Management: Core filesystem state is reliably managed and persisted within a Durable Object using SQLite.
- Pluggable Execution Backends: Supports multiple execution environments:
- Container: Projects SQLite state into a sandboxed Linux container with a real FUSE mount, offering full userland, binaries, and network access.
- Isolate Shell: Executes commands in a Dynamic Worker using
just-bash, leveraging Workers RPC for direct access to the workspace state without additional storage. - Isolate JavaScript: Runs ECMAScript modules within a fresh Dynamic Worker, providing structured input/results, durable relative imports, configured libraries, and integrated
node:fs/promisesalongside trustedws:gitandws:artifactsmodules.
- Unified Execution Entrypoint:
workspace.runtime.exec()serves as the single point of execution, abstracting the complexity of the chosen backend. - Flexible Workspace Construction: Workspaces can be created with or without a backend, allowing for direct filesystem access when needed.
Typical Use Cases
Cloudflare Computer is ideal for scenarios requiring sophisticated agent behavior and robust file manipulation within the Cloudflare Workers platform:
- Code Execution and Sandboxing: Safely run arbitrary code, scripts, or binaries within isolated container or Worker environments.
- Complex Data Processing: Empower agents to perform intricate data transformations, build projects, or manage large datasets using a familiar filesystem interface.
- Developer Tools and CI/CD: Enable agents to act as build tools, deploy applications, or manage artifacts by providing a persistent and accessible filesystem.
- AI Agents with Working Directories: Equip AI agents with a tangible workspace to store context, intermediate results, and generated content, as demonstrated in examples like
@cloudflare/think. - Content Generation and Transformation: Create dynamic content, like generating PDFs from markdown using tools like
pandocwithin the container backend. - External Service Interaction: Facilitate agent interaction with external services through the container's network access or the integrated
ws:gitandws:artifactsmodules.
