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 gap between a working demo and a reliable product is vast. Andrej Karpathy calls this the 'march of nines' — when every increase in reliability takes as much work as all the previous ones combined. This is the hidden engineering challenge behind every production AI system.

October 21, 20257 min read

Most agents today rely on large, general-purpose models built to do everything. If your agent has a single, well-defined job, it should also have a model designed for that job. This is the case for small language models: models that handle one task, run locally, and can be retrained as your data evolves.

October 20, 20258 min read

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

Subscribe to our newsletter

Get notified when we publish new articles and updates.