-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
component-e2bE2B sandbox integrationE2B sandbox integrationenhancementNew feature or requestNew feature or requestphase-2-multi-providerPhase 2: Multi-provider sandbox architecture (v2.5)Phase 2: Multi-provider sandbox architecture (v2.5)priority-mediumMedium priority - next milestoneMedium priority - next milestonetype-featureNew feature implementationNew feature implementation
Description
Overview
Implement a native sandbox provider using Anthropic's srt (sandbox runtime) CLI tool. This enables free, local sandboxing without cloud costs.
What is srt?
The srt CLI is Anthropic's sandboxing tool that uses:
- macOS: Seatbelt sandboxing
- Linux: bubblewrap (bwrap)
It provides secure, isolated execution environments on the local machine.
Implementation
// src/e2b/providers/native-provider.ts
export class NativeProvider implements SandboxProvider {
readonly name = 'native';
readonly version = '1.0.0';
static async isAvailable(): Promise<boolean> {
// Check if srt CLI is installed
try {
execSync('srt --version', { stdio: 'pipe' });
return true;
} catch {
return false;
}
}
async create(config: SandboxConfig): Promise<SandboxInstance> {
// Create sandbox using srt
// srt create --name <name> --workdir <path>
}
async execute(instanceId: string, command: string): AsyncGenerator<string> {
// Execute in sandbox
// srt exec <instanceId> -- <command>
}
// ... implement remaining interface methods
}Key Differences from E2B
| Aspect | E2B | Native (srt) |
|---|---|---|
| Startup | ~150ms | Instant |
| Cost | $0.10/hr | Free |
| Isolation | Full VM | OS-level sandbox |
| Timeout | 1 hour max | Unlimited |
| Network | Full access | Configurable |
| Resources | Cloud scale | Local machine |
Use Cases
- Quick tasks (<5 min)
- Development/testing
- Offline work
- Cost-conscious users
Files to Create
src/e2b/providers/native-provider.tstests/e2b/native-provider.test.ts
Acceptance Criteria
- Works on macOS with Seatbelt
- Works on Linux with bubblewrap
- File upload/download works
- Command execution with output streaming
- Proper cleanup on destroy
- Integration tests pass
Dependencies
- Depends on [v2.5] Define SandboxProvider interface and types #30 (SandboxProvider interface)
- Depends on [v2.5] Add provider registry and factory pattern #32 (Provider registry)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
component-e2bE2B sandbox integrationE2B sandbox integrationenhancementNew feature or requestNew feature or requestphase-2-multi-providerPhase 2: Multi-provider sandbox architecture (v2.5)Phase 2: Multi-provider sandbox architecture (v2.5)priority-mediumMedium priority - next milestoneMedium priority - next milestonetype-featureNew feature implementationNew feature implementation