Essay ⬩ 9 min

Agents run best on Cloudflare

Between 2024 and 2026, AI completely transformed the way we code. The prerequisite for this transformation was an existing, coherent environment (i.e. repos, tests, docs, tickets) agents could work from.

Operational work (i.e. finance, marketing, HR) has yet to go through a similar transformation. Agents have made a huge difference at an individual level (people build skills and workflows in Claude to make some tasks easier), but we can’t yet say that operational work has been transformed the way coding has.

The main reason is the lack of a proper work environment for agents. To work reliably, securely and at scale across an entire company, agents need an Operating System that gives them the right context, the agency to execute, and continuity in delivery.

Cloudflare has the best infrastructure to build this environment.

Its historical primitives, such as Workers and Durable Objects, combined with its latest agentic features, such as AI Gateway, Artifacts and Cloudflare OS, create a unique and coherent ecosystem for anyone who wants to build their core internal infrastructure for agentic operational work.

1. The infrastructure agents need

Today’s cloud infrastructure wasn’t built to serve agents: it’s optimized to build and host applications.

Traditional applications ask you to adapt your work to the software: you navigate screens and features someone has already built. With agents, you start by saying what you want done. The agent assembles the tools, data, and code around that need, creating new capabilities as the work unfolds.

That changes what infrastructure needs to support. Rather than only hosting applications designed in advance, it must let agents assemble and extend what they need along the way, within the company’s guardrails.

While the traditional cloud was built around the application, the agentic cloud is built around the piece of work itself.

FIG. 1 ⬩ THE ATOMIC UNIT OF SOFTWAREBEFORE ⬩ THE UNIT IS THE APPLICATIONCRMFINANCECHATNOW ⬩ THE UNIT IS THE PIECE OF WORKCRMFINANCECHATPIECE OF WORK

Agents begin with an intent and a delegated piece of work. That work may cross applications, data, people, and time. The output can be an application, but often it’s not. The application is no longer the natural container of work.

Every piece of work delegated to an agent needs specific features:

  • intelligence to carry the work
  • context to get the information the agent needs to complete the work
  • tools to give it the means to execute
  • a persistent home to keep track of the state of the work
  • permissions to ensure accesses are tightly scoped to the work at hand

Cloudflare has solid foundations for each of these within the same ecosystem, making it frictionless for agents to use them all together.

2. Cloudflare 101

Whether by design or happy accident, Cloudflare built infrastructure that is remarkably well suited to agentic work long before they even started to build with AI in mind.

FIG. 2 ⬩ CLOUDFLARE 101WORKERSR2D1QUEUESWORKFLOWSBLOCKSBINDINGSGLOBAL NETWORKSECURE BY DESIGN

A global network

Cloudflare runs code in lightweight, isolated environments distributed across its global network, which spans 330+ cities in 125+ countries. They start almost instantly and scale automatically with demand. You deploy code once, without provisioning servers or configuring compute region by region.

This makes execution available on demand for agents: a one-off task doesn’t need a dedicated server and useful tools can scale across the company seamlessly. Teams in different locations can use the same tools with agent execution close to them, reducing network latency.

It makes small, frequent, unpredictable pieces of work practical and fast to run in an extremely flexible setup for agents.

Unified infrastructure

Choosing to build an Operating System on top of Cloudflare is like giving agents a lake to swim in instead of a dozen disconnected ponds. It’s far more efficient.

Cloudflare has tons of composable blocks across the entire stack you’d need to build agentic infrastructure: Workers for compute, R2 for file storage, D1 for databases, Queues for messaging, and Workflows for durable & predictable execution.

Bindings connect all those blocks directly, without the need to maintain a separate API connection between each component. A Worker simply declares what it can use (a bucket, a database, a queue) and gets access to that and nothing else.

For a system that handles tons of work across different teams, tools and datasets, it avoids the nightmare of maintaining a heavy, disjointed infrastructure, and makes the whole system way more reliable.

Secure by design

We’ve already seen in the news the damage agents can do to internal systems. The more secure the platform agents run on, the better.

The good thing about Cloudflare is that security isn’t something they’ve added on top of their cloud infra. It’s literally the origin of the company.

Cloudflare grew out of Project Honey Pot, which Matthew Prince and Lee Holloway started in 2004 to track where email spam came from. Its users kept asking for the same thing: “Don’t just tell us who the attackers are. Stop them.”

In 2009, together with Michelle Zatlyn, they founded Cloudflare: a network that sat between websites and their visitors, blocking malicious traffic and helping pages load faster. Over time, customers wanted more control over what happened to traffic passing through that network: their own rules, routing logic, request handling.

Rather than build every possible feature itself, Cloudflare made the network programmable. Developers could now write code and run it directly on Cloudflare’s infrastructure. That became Cloudflare Workers, launched in 2017.

At Cloudflare, security isn’t an added layer. It’s built into the network that runs your code.

3. Cloud for agents

These fundamental, composable Cloudflare blocks are already a great plus when it comes to building agentic systems for operational work. But Cloudflare didn’t stop there.

It doesn’t only provide the underlying infrastructure: it also added more blocks agents can use to create, carry and complete their work within the same ecosystem.

FIG. 3 ⬩ BLOCKS FOR AGENTSCLOUDFLARE MCPAgents run the setupCLOUDFLARE OSOne hub for the companyAI GATEWAYAny model, swappableDYNAMIC WORKERSAction beyond toolsGATEKEEPERSAccess without keysARTIFACTSGit repos for agentsDURABLE OBJECTSA home for each piece of work

Setup

Configuring infrastructure requires understanding both what the work needs and which settings will support it. This used to require long and tedious IT processes.

Cloudflare gives agents full control over the infrastructure: creating resources, configuring them, and adjusting them as the work evolves.

You describe your business needs, the agent handles the technical translation.

Workspace

To coordinate all the operational work, Cloudflare released Cloudflare OS: a company hub where employees can use agents, build apps, and manage skills, tools & permissions from one place, on top of company data.

Cloudflare OS is open source: you can adapt it to your needs, and you fully own the data and everything below.

Intelligence

With AI Gateway, agents can route work to different providers or different models based on the task at hand, with fallbacks if a provider goes down. Intelligence becomes replaceable.

It’s also a great way to centralize your company’s token spend and track both usage (per team, task, workflow, model) and costs. That’s impossible to do when your company relies only on one provider for internal agentic work (i.e. Claude).

Execution

To turn intelligence into action, agents need code and compute. Cloudflare’s Workers give them approved, repeatable ways to act.

To go a bit further, Cloudflare developed Dynamic Workers, that let agents write and run task-specific code when no existing tool fits.

This means the agent isn’t limited by the tools it was given: it can carry out the work no matter what, in an isolated environment, under rules defined by the company.

Access

Agents don’t have a seat in your Slack or Notion like a user does. You can’t give them permissions through roles (admin, manager, user) the way you do for people.

Agentic access needs to be tailored to every piece of work. One piece of work may require reading a single table in one tool, updating a list in another, then building a dashboard in a third and sharing it in Slack.

Cloudflare Access, Bindings and Gatekeepers enable that level of granularity:

  1. Access determines who can use which tools.
  2. Bindings limit what code can reach.
  3. Gatekeepers make sure the credentials never reach the agent.

Each agent (and associated piece of work) only receives the authority it needs, never more, never less, without gaining broad access to the whole system.

Coordination

Some work requires both multiple agents and engineers participating in what agents do (tests, validations, contributions).

Artifacts make that possible. They’re essentially Git repos for agents: they store workflows, skills and instructions as versioned files agents can create, publish, reuse and improve. Since they speak Git, agents and engineers can work on them with tools they already know.

This brings a lot of visibility into the work agents perform, along with the ability to consult the history of past work (how decisions were made, how work was carried out). The idea behind Artifacts is to create a self-learning loop: a system that compounds through use while every change remains visible and reversible.

Continuity

And the final piece, the cherry on the cake: Durable Objects.

Think of Durable Objects as a home for each piece of work your agent carries.

They hold both the context the piece of work needs (what to do, how, for whom, with which tools?) and its state (e.g. in progress, finished) in their own built-in storage.

That’s especially useful to provide continuity for agentic tasks that run over time and get interrupted. For example, if you want the agent to send a Slack report on Monday, you only want it to run on Monday and use no compute in the meantime, while still absorbing new context when needed.

Durable Objects make that possible: they shut down when idle, wake up on a scheduled alarm, and pick up exactly where they left off.

Conclusion

Combine Cloudflare’s strong fundamental blocks with its global compute, its unified ecosystem with Bindings, its native security design, and all the bleeding edge features it developed around AI, and you get a complete environment to build internal agentic systems.

Together, these building blocks give agents an environment in which they can create infrastructure, maintain continuity, take action, learn from prior work, and remain under company control.

That makes it an extraordinary playground. You can assemble your own proprietary Operating System without leaving the Cloudflare ecosystem instead of buying more rigid, all-in-one products. All of this runs in an environment you control. It’s low-level enough to build exactly what you need, but agent-centric enough that you don’t have to worry much about the complexity underneath.

The only caveat is that access to the building blocks doesn’t mean you have a blueprint, an easy way to navigate that complexity. A harder question remains: what should you build first, how should the pieces fit together, and in what order?

That is the question we will answer in our next article.

All posts Railblocks ⬩ Blog