Introducing Dagger Local Sandboxes
VibeKit now supports Dagger-powered local sandboxes for completely local AI code execution with container isolation and zero cloud dependencies.
VibeKit now supports Dagger-powered local sandboxes for completely local AI code execution with container isolation and zero cloud dependencies.
Previous approach: AI coding agents requiring cloud sandboxes with network dependencies and privacy concerns. Current approach: Fully local execution with container-isolated environments running on your machine.
Dagger provides container-based pipeline execution that can run entirely offline. Technical capabilities:
This eliminates cloud dependencies and provides maximum privacy for AI coding workflows by keeping everything local.
Complete data privacy with local-first execution. Code and data never leave your local environment.
Zero network latency with local execution. No cloud wait times or bandwidth limitations.
Container isolation provides secure execution environments. Complete control over the execution environment.
Adding Dagger local sandboxes to your VibeKit setup:
import { VibeKit } from '@vibe-kit/sdk';
import { createLocalProvider } from '@vibe-kit/dagger';
const provider = createLocalProvider({
githubToken: process.env.GITHUB_TOKEN,
preferRegistryImages: true
});
const vibeKit = new VibeKit()
.withSandbox(provider);
// Run AI-generated code completely local
const result = await vibeKit.generateCode({
prompt: "Your AI-generated code prompt",
mode: "ask"
});
AI coding scenarios that require complete privacy and offline capabilities:
The integration leverages Dagger's container orchestration capabilities to provide isolated execution environments that run entirely on your local machine.
Install the Dagger provider:
npm install @vibe-kit/dagger
Ensure Dagger CLI is available:
# macOS
brew install dagger/tap/dagger
# Linux
curl -fsSL https://dl.dagger.io/dagger/install.sh | BIN_DIR=$HOME/.local/bin sh
# Windows
winget install Dagger.Cli
# Verify installation
dagger version
import { VibeKit } from '@vibe-kit/sdk';
import { createLocalProvider } from '@vibe-kit/dagger';
const provider = createLocalProvider({
githubToken: process.env.GITHUB_TOKEN,
preferRegistryImages: true,
dockerHubUser: process.env.DOCKER_HUB_USER // optional
});
const vibeKit = new VibeKit()
.withAgent({
type: "claude",
provider: "anthropic",
apiKey: process.env.ANTHROPIC_API_KEY,
model: "claude-sonnet-4-20250514"
})
.withSandbox(provider);
// Execute code with full container isolation
const result = await vibeKit.generateCode({
prompt: "Create a Node.js script that logs 'Running completely offline!'",
mode: "ask"
});
import { createLocalProvider, LocalDaggerConfig } from '@vibe-kit/dagger';
const config: LocalDaggerConfig = {
githubToken: process.env.GITHUB_TOKEN, // Optional for Git operations
preferRegistryImages: true, // Use pre-built registry images
dockerHubUser: process.env.DOCKER_HUB_USER, // Optional Docker Hub username
privateRegistry: 'your-registry.com' // Optional alternative registry
};
const provider = createLocalProvider(config);
VibeKit's Dagger integration works seamlessly with existing AI coding agents:
// Claude integration
const claudeAgent = {
type: "claude",
provider: "anthropic",
model: "claude-sonnet-4-20250514"
};
// Codex integration
const codexAgent = {
type: "codex",
provider: "openai"
};
const vibeKit = new VibeKit()
.withAgent(claudeAgent) // Or codexAgent
.withSandbox(provider);
Docs: https://docs.vibekit.sh/supported_sandboxes/dagger
GitHub: https://github.com/superagent-ai/vibekit/tree/main/packages/dagger