Introducing Cloudflare Sandboxes Support
Execute AI-generated code at 300+ global edge locations with VibeKit's new Cloudflare Sandboxes integration. Get sub-second response times and complete Git functionality.
Execute AI-generated code at 300+ global edge locations with VibeKit's new Cloudflare Sandboxes integration. Get sub-second response times and complete Git functionality.
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:
This reduces the latency in AI coding workflows by executing code closer to users.
Code execution happens in isolated container environments. Secure file management within sandboxed environments.
Sub-second execution times at edge locations globally. Eliminates the traditional latency bottleneck.
Complete Git integration:
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);
Coding agent use cases that require low latency:
The integration leverages Cloudflare's Durable Objects for strong consistency and automatic geographic distribution across their edge network.
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 documentation: https://docs.vibekit.sh/supported-sandboxes/cloudflare