Overview
Cloudflare Computer provides a revolutionary virtual filesystem that lives inside a Durable Object. This system leverages SQLite for authoritative state management and offers a pluggable execution surface (workspace.runtime) for running code in various sandboxed environments. It's designed to bring a "computer" experience to the Cloudflare Workers platform, enabling sophisticated agent-like capabilities and flexible execution models.
Key Features
- Durable Object-backed Filesystem: A robust virtual filesystem hosted within a Durable Object, ensuring data persistence and state management with SQLite.
- Pluggable Runtimes: Supports multiple execution backends:
- Container: Projects the SQLite state into a Linux sandbox as a FUSE mount, offering a full userland, real binaries, and network access.
- Isolate Shell: Runs
just-bashwithin a Dynamic Worker, directly interacting with the Workspace via Workers RPC for seamless execution. - Isolate JavaScript: Executes ECMAScript modules in a fresh Dynamic Worker, providing structured input/results, durable imports, configured libraries, and trusted
node:fs/promises,ws:git, andws:artifactsmodules.
- Unified Execution Entrypoint: A single
workspace.runtime.exec(source, { backend })function to execute code, abstracting away the complexities of the chosen backend. - Flexible Workspace Construction: Workspaces can be initialized with or without a backend, allowing for filesystem-only access when needed.
- Performance Optimized: Benchmarks indicate that the
computerdFUSE mount excels in metadata-heavy operations and offers competitive performance for large I/O tasks.
Typical Use Cases
- Building Sophisticated Agents: Develop AI agents that can read, write, and execute code within a persistent, sandboxed environment.
- Code Execution and Sandboxing: Safely run untrusted or complex code snippets in isolated environments, from shell commands to JavaScript modules.
- CI/CD and Build Pipelines: Automate build processes, code artifact generation, and deployments directly on the edge.
- Data Processing and Transformation: Process large datasets or perform complex data transformations using the virtual filesystem and its execution capabilities.
- Prototyping and Experimentation: Quickly spin up and test new application ideas and backend services in a realistic computing environment.
- Edge-Native Applications: Develop applications that require local file system access and execution capabilities directly within the Cloudflare Workers ecosystem.
