Back to Blog
vibekit-sdkengineeringannouncements

Introducing Cloudflare Sandboxes Support

VibeKit now supports Cloudflare Sandboxes for AI code execution at the edge. Leverage isolated container environments across 300+ global locations with sub-second performance, complete Git integration, and real-time output streaming for faster AI coding workflows.

2 min read
By Alan Zabihi

The Change

Previous approach: Code execution in centralized environments with higher latency. Current approach: Code execution at edge locations with sub-second performance.

Cloudflare Sandboxes provide isolated, container-based environments that execute code on Cloudflare's global edge network. Technical capabilities:

  • Code execution in isolated, container-based environments on Cloudflare's edge
  • Sub-second response times at 300+ global locations
  • File operations and Git functionality within sandboxes
  • Real-time output streaming

What This Enables

This reduces the latency in AI coding workflows by executing code closer to users.

Security

Code execution happens in isolated container environments. Secure file management within sandboxed environments.

Performance

Sub-second execution times at edge locations globally. Eliminates the traditional latency bottleneck.

Development Workflow

Complete Git integration:

  • Repository cloning and PR creation within sandboxes
  • Real-time output streaming
  • File operations at edge locations

Getting Started

Adding Cloudflare Sandboxes to your VibeKit setup is straightforward:

import { VibeKit } from "@vibe-kit/sdk";
import { createCloudflareProvider } from "@vibe-kit/cloudflare";

const provider = createCloudflareProvider({
  env: env, // Cloudflare Worker's env object
  hostname: "your-worker.domain.workers.dev"
});

const vibeKit = new VibeKit()
  .withAgent({
    type: "claude",
    provider: "anthropic",
    apiKey: process.env.ANTHROPIC_API_KEY!,
    model: "claude-sonnet-4-20250514"
  })
  .withSandbox(provider);

Use Cases This Enables

Coding agent use cases that require low latency:

  • Interactive tools: Real-time code execution feedback with minimal latency
  • Real-time user-facing features: AI-powered coding functionality in production applications
  • Responsive development environments: Fast feedback loops for iterative development
  • Global coding platforms: Consistent sub-second performance regardless of user location

Technical Implementation

The integration leverages Cloudflare's Durable Objects for strong consistency and automatic geographic distribution across their edge network.

Configuration Setup

Install the Cloudflare provider:

npm install @vibe-kit/cloudflare

Configure your wrangler.json with Sandbox and Durable Object bindings:

{
  "name": "my-vibekit-worker",
  "main": "src/index.ts",
  "compatibility_date": "2024-01-01",
  "containers": [
    {
      "class_name": "Sandbox",
      "image": "./node_modules/@cloudflare/sandbox/Dockerfile",
      "max_instances": 1
    }
  ],
  "durable_objects": {
    "bindings": [
      {
        "class_name": "Sandbox",
        "name": "Sandbox"
      }
    ]
  }
}

Technical Capabilities

  • Edge-native execution: Code runs directly on Cloudflare's global network
  • Preview URL generation: Automatic exposure of sandbox ports for web applications
  • Durable Objects integration: Strong consistency across edge locations
  • Multi-agent support: Compatible with Claude, OpenAI Codex, and other AI agents

Requirements

  • Node.js 18+
  • Cloudflare Worker environment
  • Docker for local sandbox development

Technical documentation: https://docs.vibekit.sh/supported-sandboxes/cloudflare

Alan Zabihi

Co-founder & CEO of Superagent.sh

Follow on X

Related Articles

The past two weeks brought runtime redaction, a powerful CLI, URL whitelisting, and a developer experience that puts security directly in your workflow. Here's what shipped and why it matters for teams building with AI agents.

October 10, 20254 min read

In 2022, Simon Willison argued that 'adding more AI' was the wrong fix for prompt injection and related failures. He was mostly right at the time. What people tried then were brittle ideas that either overblocked or were easy to trick. This post explains what has changed since, what has not, and why builders can now use AI to meaningfully defend their agents in production.

September 30, 20254 min read

Today, we are proud to announce Superagent — the runtime defense platform that keeps your AI agents safe from prompt injections, malicious tool calls, and data leaks.

September 24, 20252 min read

Subscribe to our newsletter

Get notified when we publish new articles and updates.