Ai Agents 5 min read

How to Deploy AI Agents With Cloudflare OS

Cloudflare OS lets you build secure AI applications and deploy automated agents within your own infrastructure.

Cloudflare’s new Cloudflare OS provides an open-source platform for organizations to build, deploy, and manage AI agents within their own environments. Originally developed to handle internal API provisioning requests at Cloudflare, the system acts as an overarching workspace where employees can automate workflows, research internal data, and generate standalone applications.

You can deploy the platform directly into your Cloudflare account, allowing you to retain full control over data, system connections, and agent access. This tutorial covers the platform’s core architecture, security configurations, and how to manage the new Agent Development Lifecycle (ADLC).

Installation and Setup

Cloudflare OS is available as an open-source repository at github.com/cloudflare/cloudflare-os. Because the platform relies heavily on the Cloudflare product ecosystem, deployment requires an active Cloudflare account with access to Workers, Durable Objects, and Cloudflare Access.

Instead of providing a single binary, the repository includes deployment manifests that provision the necessary infrastructure in your account. The current release requires self-hosting via these manifests. A managed deployment option accessed directly through the Cloudflare dashboard is scheduled for future release.

Core Architecture

The platform bridges multiple existing Cloudflare services to create a cohesive environment for AI agents. The infrastructure is composed of the following primary components:

ComponentCloudflare ServiceFunction in Cloudflare OS
Compute Engine@cloudflare/computerProvides agents with a persistent filesystem, shell access, and Git support.
Access ControlCloudflare AccessEnforces Zero Trust policies and verifies every agent request.
State ManagementDurable ObjectsMaintains persistent state and isolation for individual applications.
Model RoutingAI GatewayRoutes requests to external LLMs, tracks spending, and enforces rate limits.

The Compute Primitive

The foundation of agent execution in Cloudflare OS is the @cloudflare/computer runtime package. This runtime dynamically orchestrates work by shifting tasks between lightweight v8 isolates and full Linux containers. Simple logic executes in milliseconds on isolates, while heavy computational tasks or dependencies requiring a full OS environment scale into Linux containers. You can configure these agent runtimes to optimize for specific workflow latency or compute requirements.

App Creation and Data Isolation

Beyond running background tasks, Cloudflare OS allows users to convert agent outputs directly into functional web applications. When an agent generates an application, the platform provisions an isolated database and real-time synchronization capabilities for that specific app.

This isolation ensures that experimental tools built by non-technical staff do not interfere with core company databases. Each generated application receives its own access control layer. You can share the resulting tool with specific teams or the entire organization by adjusting the attached Cloudflare Access policies. The agent workspace provides a browser-based interface where users can interact with these custom applications without leaving the platform.

Security and Gatekeepers

When agents execute workflows or build applications, they operate under a strict Zero Trust model. AI agents start with zero permissions. Access to internal databases, APIs, or specific files is mediated by Gatekeepers.

Gatekeepers act as governed connectors. You define granular policies within Cloudflare Access that dictate exactly what an agent can see or modify. If an agent attempts an out-of-bounds action, the Gatekeeper blocks the request and logs the attempt. This prevents autonomous agents from making unauthorized changes to production systems while still allowing them to pull live internal data for document generation or workflow automation.

Managing Models and Costs

Cloudflare OS is model-agnostic. You configure model endpoints through the Cloudflare AI Gateway, which acts as a proxy between your deployed agents and providers like OpenAI, Anthropic, or Meta.

The AI Gateway introduces identity-aware analytics for agent workloads. Administrators can map specific agent executions back to the user identity that initiated them. This allows you to set hard dollar spend limits on a per-user, per-team, or per-application basis. You can filter AI logs by individual user identities to audit how specific employees are utilizing the agent workspace.

The Agent Development Lifecycle

The platform introduces the Agent Development Lifecycle (ADLC) to manage the sheer volume of code generated by autonomous systems. Traditional software development lifecycles struggle to keep pace when agents can draft, test, and revise thousands of lines of code in minutes.

The ADLC focuses on rapid iteration, automated code review, and secure isolated testing. During the internal pilot, engineers utilized the platform to run automated architectural reviews on nearly 600 designs before any code reached production. You can build self-debugging AI agents that automatically run these verification loops within the isolated environments provided by the @cloudflare/computer runtime.

Tradeoffs and Limitations

Cloudflare OS is deeply coupled with the Cloudflare ecosystem. If your organization relies on AWS, Azure, or GCP native services for edge compute and zero trust networking, adopting Cloudflare OS requires bridging those network boundaries or migrating workloads.

The platform’s current open-source nature means your infrastructure team assumes responsibility for deployment, updates, and state management via the provided GitHub repository until the managed tier becomes available.

Review the deployment manifests in the official repository to map the necessary Cloudflare primitives to your existing account architecture.

Get Insanely Good at AI

Get Insanely Good at AI

The book for developers who want to understand how AI actually works. LLMs, prompt engineering, RAG, AI agents, and production systems.

Keep Reading