Cloudflare OS Forks Every App for Every User

Cloudflare's open-source agent workspace gives each employee a private, agent-maintained copy of every app. The invention that makes it safe is a sharing rule called the observers invariant.

11 min read • View on GitHub • More from cloudflare

A wide editorial illustration of a long workshop floor lined with identical workbenches receding into the distance, each bench holding a private copy of the same open blueprint and its own hand tools, with a single guarded doorway at the far end where a gatekeeper inspects a badge under a hanging lamp. It depicts the core idea of Cloudflare OS: one private app per person, funneled through a single checkpoint.
Every employee gets their own bench, their own copy of the app, and their own tools. Access to the outside world runs through one guarded door.
Key Takeaways

Every User Gets Their Own Fork

Cloudflare OS starts from a premise that runs against a decade of SaaS orthodoxy. Instead of a shared, multi-tenant app that everyone logs into, every person gets a private instance of each app. The project calls these instances gadgets: a small application created for one user, running in its own sandbox with its own bindings, its own SQLite database, its own chat history, and its own V8 isolate.

The agent maintains the fork. Ask for a change and the agent edits the gadget's code directly. The app is not a document you fill in. It is a program that lives with you and bends to what you need.

The data model keeps code and state strictly separate. A blueprint captures source code only. The docs are explicit that a blueprint does not capture SQLite storage, chat history, commit history, or credentials. Each gadget created from a blueprint gets its own bindings, storage, and history, and nothing else carries over.

That is the whole bet in one sentence. Cloudflare is not shipping a product you adopt. It is shipping a template you fork, wire to your own systems, and rename. The gadget model is the mechanism that makes the fork worth having.

Why That Should Leak

Say it plainly, because it is the first thing a security team will say. If every user has a private fork of every app, and each fork is wired to company systems through credentials and bindings, and an agent can rewrite that fork's code on request, then every fork is a potential exfiltration path. The agent that edits the app can also read what the app can read.

A model where a thousand copies of an app each hold their own access to Slack, Drive, and GitHub sounds like a thousand doors left open. The engineering cost of multi-tenant isolation gets traded for the cost of per-instance lifecycle management, and the security cost looks worse on the surface.

Cloudflare OS only works if it answers this objection. The answer is a sharing rule so specific that most agent platforms in this space do not have anything like it.

The Observers Invariant

Here is the rule, stated verbatim in the repo's design doc:

If a Gadget can read information that has restricted access, then any user who is not able to read that information will also be prohibited from interacting with the Gadget, to prevent data leaks.

Read that twice. It is not a permission checkbox. It is a data-flow rule. It says that if a gadget has touched something restricted, then everyone who stands next to that gadget must be able to see everything the gadget has seen. If they cannot, they do not get in.

The people who can see what the gadget has read are called observers. Becoming one is not automatic. It triggers a verification round trip that the gadget's authority object, the Overseer, cannot perform on its own, because it does not understand every vendor's access-control model. So the prospective observer's own connected account mints an opaque verifier, and the gatekeeper unwraps it to check whether that person can directly read everything the gadget already read through that service.

The observers invariant as a flow. A gadget reads a file. A second person tries to stand next to it. Their own account has to prove it can read everything the gadget has read, and any future observation they cannot see gets blocked at the gadget boundary.

The rule has teeth going forward. After a user becomes an observer, the gatekeeper can attach a list of observers who must not see a new observation. That list arrives as ObservationDescription.excludeObservers. The Overseer must guarantee those people never see it, or the observation is blocked. Access is also re-verified every time an observer opens the gadget, so revocation is not a one-time event.

The system also defines two restricted-data tiers. containsRestrictedData flips a workspace into a locked mode: no web fetches, and every action requires manual approval with auto-approval suspended. ownerInvitesOnly shuts off share links entirely, so only direct grants from the owner admit anyone.

There is one subtlety worth flagging. Verification scope follows the authority graph, not just the direct bindings. A use collaborator is checked against the gatekeepers their sessions can reach, and that includes, transitively, every environment target of a bound agent spawner. Spawning an agent is reachable from the gadget UI, and the spawned agent reads connections with the spawner creator's authority. So the rule chases the authority wherever it flows.

Gatekeepers Fake the Outcome

The second surprise lives one layer down. Every external service gets its own Worker called a Gatekeeper. The README describes them as supercharged MCP servers. Each one exposes a clean Cap'n Web API wrapping the vendor's native API, handles OAuth, enforces narrow access to the specific resource the user intended, logs every action, and requests human approval for side-effecting actions.

A tight close-up editorial illustration of a small mechanical reader holding a sheet of paper bearing a wax seal, with three people standing behind it in a line, each holding a key. The first person's key matches the seal's profile exactly, the second person's key is a visibly different shape with a heavy crosshatched X drawn across it, and the third person's key is held back, not yet presented. It makes the observers invariant physical: to stand next to the reader, your key has to fit the seal on what the reader is holding.
To stand next to the reader, your key has to fit the seal on what the reader is holding. That is the observers invariant in one frame.

Then the counterintuitive part. Traditional human-in-the-loop approval blocks the agent until a human responds. Gatekeepers do the opposite. They simulate the outcome of a side-effecting action locally. The agent receives a completed response and simulated read-backs, and keeps queuing work. The human approves or rejects the queue afterward, in bulk or one at a time.

The README frames this as a fix for the failure mode everyone knows: when approval gets annoying, people turn on auto-approve or run with the dangerous skip-permissions flag. Simulated approval lets the agent stay productive without ever getting a real, unreviewed side effect through.

There is an honest gap here, and the docs leave it open. If a later action depends on a simulated result, and the human then rejects the earlier action, the docs do not show how the rejection reconciles with the work that was built on top of it. That is a real open question for anyone running this in production.

The Compiler Is the Security Policy

The most elegant piece of the security design is enforced by TypeScript rather than runtime checks. The Overseer's open() method computes a caller's effective role from a permission graph and returns a different object depending on that role. A build session gets the full interface. A use session gets an object that implements the full Overseer interface but throws Unauthorized for everything outside an explicit allowlist.

Two telemetry subscriptions are the exception. They return inert subscriptions instead of throwing, so the editor's speculative hooks do not produce client errors. Everything else is denied by default.

The clever part is the implements clause. Because the restricted interface implements the full Overseer interface, any newly added method fails to compile until a developer consciously decides whether use callers may invoke it. The security boundary is a compile error, not a runtime check someone might forget to add.

Blueprints Are Git Commits With No Parents

Blueprints are where the engineering craft shows. A blueprint is shared by link. Each published version is a git commit, stored as a packfile in R2, with the commit ID recorded in KV. The lineage rules in blueprint-release.ts are pure computation over byte arrays and an object lookup, so the exact same code runs both in the Overseer and in the bundled-blueprint installer.

Gadgets follow blueprints rather than copy them. A gadget made from a blueprint keeps a link to it, and updates arrive as proposals the user previews and accepts. They are merged against the release the gadget last took. A gadget can even follow two blueprints at once, a stable track and a latest track.

Then the detail that makes the whole system clean. Bundled blueprints install as buildSnapshotRelease commits. These commits are parentless, with a fixed author, a fixed date, and a fixed message. Because the commit depends only on file contents, every deployment derives the same commit from the same files. Installation becomes idempotent and stateless, and the installer never has to read what was installed before. The tradeoff is explicit: bundled blueprint versions are not chained to one another, though gadgets made from them still take updates through the normal merge path.

A Security Model Written for an AI to Implement

The origin of Cloudflare OS is not a founder bio. It is how the security model was authored. The observers design doc carries a disclosure that almost no project of this kind makes.

The document is also labeled a historical implementation plan that was used to guide an AI in implementing it. Read that as a statement about method: the security model was specified in prose so that an AI coding agent could build it, and the spec says so out loud. That is a story about how the project itself was made.

The lineage runs back through Kenton Varda, the leading listed contributor, a cofounder of Sandstorm, and the technical lead behind Cloudflare Workers. Sandstorm was a self-hostable platform built around isolated per-app units called Grains. Cloudflare OS keeps the isolation idea and swaps the substrate. Grains become gadgets, and containers become V8 isolates. When Varda described the project at a conference, he reached for a familiar comparison.

Think of this environment as a kind of office suite

Kenton Varda, Cloudflare Workers technical lead; Sandstorm cofounder · Cloudflare OS: Yet Another Agentic Work Environment?

The governance layer tells the same story from another angle. The repo ships an AGENTS.md, repo-specific skills named write-gatekeeper and frontend-conventions, and a set of AI and evaluation workflows in CI. One more clue sits in the naming. The docs and internal manifests still say Gadgets and Workshop, while the product is named Cloudflare OS. That mismatch is not a bug. It is the fingerprint of a public repo extracted from an internal codebase.

Where It Sits

Cloudflare OS is not the only project in this space, but it is the only one pairing per-user forks with a data-flow invariant. The comparison is about category and security boundary, not feature checkboxes.

ProjectWhat it isHow apps workSecurity boundaryWhere Cloudflare OS differs
Cloudflare OSAgent workspace on WorkersPer-user Gadget, own SQLite and V8 isolate, agent-editableGatekeepers plus observers invariantThe only one with per-user forks and a data-flow invariant
Sandstorm (precursor)Self-hostable web-app platformPer-app Grains in isolated containersContainer isolation, per-grain sharingCloudflare OS adds agents and V8 isolates
OpenHandsSoftware-dev agents in a sandboxCode in a dev environment, not durable appsSandbox around the agentCloudflare OS produces shareable durable apps for non-technical users
DifyBuild and operate LLM apps and workflowsVisual orchestration, integrationsWorkflow-level credentialsCloudflare OS foregrounds individual workspaces and per-resource governance
n8nWorkflow automationEvent-triggered workflowsPer-workflow credentialsCloudflare OS pairs automation with an interactive workspace and generated apps
AnythingLLMPrivate LLM workspace and document KBsChat and retrieval, not full-stack appsDeployment-levelCloudflare OS ships apps with their own durable state
Replit AgentAgent-assisted software creationHosted app deploymentAccount and project scopingCloudflare OS is a governed employee workspace, not general software dev

The pattern is clear. Most of these platforms either build agents that produce code for you to export, or workflows that run on a schedule, or assistants that chat over your documents. Cloudflare OS is betting that the durable, personal, agent-maintained app is the unit of work, and that a small set of security invariants is what makes that unit safe to hand to everyone.