| [ Web Proxy ] |
| Viewing: https://developers.cloudflare.com/sandbox/tutorials/claude-managed-agents/ | [Back] [Original] |
Cloudflare provides a self-managed environment for Claude Managed Agents . The agent loop runs on the Anthropic platform, while Cloudflare provides the runtime sandboxes, egress control, browser access, email, and custom tools that the agent's actions execute in.
This integration ships as an open-source deployment template. Fork the repo, deploy it to your Cloudflare account, and customize it as needed.
Get Started
Deploy a Workers-based control plane that gives you:
When a Claude agent starts a session, Anthropic sends a webhook to the Workers-based control plane running in your Cloudflare account. The control plane gives each session its own sandbox, routes outbound traffic through a per-session egress policy, and persists state across session sleeps.
Anthropic describes this as decoupling the brain from the hands the agent loop runs on Anthropic (the brain), but the infrastructure for running and executing code (the hands) runs on Cloudflare.
Use a self-managed Cloudflare environment when you need:
Follow the onboarding guide in the repository to deploy the control plane to your account. The guide walks through creating an Anthropic environment, setting secrets, provisioning storage, deploying the Worker, and configuring webhooks.
Note
You need a Workers Paid plan or Enterprise account. Containers (used by MicroVM sandboxes) and Worker Loader bindings (used by isolate code execution and egress proxies) require the paid plan.
The repository includes detailed documentation on each capability:
| Topic | What it covers |
|---|---|
| Connecting to private services | Reach services in other clouds, on-prem, or on your laptop with Workers VPC bindings |
| Applying egress policies | Inject credentials and lock down agent sessions. Set up allow/deny lists, header injection, custom Worker proxies, and VPC routing |
| Isolate vs VM-based sandboxes | Pick the best agent execution environment |
| Agent email | Give agents their own email addresses and sending abilities |
| Browser rendering tools | Observable agent browser interactions with Browser Run |
| Adding custom tools | New tools are declared in a single file src/tools/custom-tools.ts |
| Customizing sandboxes | Change Dockerfile and instance_type knobs for the MicroVM backend |
| Snapshots and state persistence | State persistence across both sandbox types |
| Architecture | Request lifecycle from webhook ingress through dispatch to either sandbox backend, and every Worker binding the control plane uses |
| Securing access | Secure access to the CMA control plane |
| Web Proxy Viewer | New URL | Original Page |