StateSet Sandbox
Self-hosted, Kubernetes-based infrastructure for running Claude Code agents and AI-driven code execution in isolated, secure containers.
Enterprise-grade security meets AI-native code execution.
What is StateSet Sandbox?
StateSet Sandbox provides an enterprise-grade, secure execution environment where Claude Code CLI and AI agents can safely execute code, perform data transformations, and run custom business logic without compromising system security or stability.
Sandbox Execution Flow
Core Components
Modular architecture designed for scalability, security, and developer experience
Sandbox Controller
Node.js/Express HTTP API that manages Kubernetes pod lifecycle, authentication, and streaming
Features
Specifications
3 (HA)8080Node.js/ExpressRuntime Environments
Pre-installed language runtimes with popular tools and frameworks
Node.js 22.x
Pre-installed tools and packages
API Endpoints
Complete REST API for sandbox lifecycle management, code execution, and file operations with SSE streaming support.
/api/v1/sandbox/create/api/v1/sandbox/:id/api/v1/sandbox/:id/execute/api/v1/sandbox/:id/files/api/v1/sandbox/:id/files/api/v1/sandbox/:idimport { StateSetSandbox } from '@stateset/sandbox-sdk';
const sandbox = new StateSetSandbox({
baseUrl: 'https://sandbox.stateset.io',
authToken: 'sk-sandbox-xxx',
orgId: 'my-org'
});
// Create isolated sandbox
const instance = await sandbox.create({
cpus: '2',
memory: '4Gi',
timeout_seconds: 600
});
// Write code to sandbox
await sandbox.writeFile(
instance.sandbox_id,
'/workspace/app.ts',
'console.log("Hello from sandbox!")'
);
// Execute with streaming
const result = await sandbox.execute(
instance.sandbox_id,
{ command: 'npx tsx /workspace/app.ts' }
);
// Run Claude Code agent
await sandbox.execute(
instance.sandbox_id,
{ command: 'claude -p "Create a REST API"' }
);
// Cleanup
await sandbox.stop(instance.sandbox_id);Advanced Features
Beyond basic code execution—billing, checkpoints, webhooks, and more
Claude Code Integration
Pre-installed Claude Code CLI in every sandbox for AI-driven code generation and automation
Real-Time Streaming
SSE and WebSocket support for live stdout/stderr output with <50ms latency
Checkpoint & Restore
Save sandbox state at any point and restore later to continue work
File Operations
Upload and download files via REST API with base64 encoding for binary support
Warm Pool
Pre-provisioned sandboxes for sub-second startup times on critical workloads
Audit Logging
Complete audit trail for compliance with all sandbox operations logged
Security & Isolation
Multiple layers of isolation ensure that sandboxes are completely secure and cannot affect the host system or other sandboxes.
Use Cases
Secure code execution for AI agents across commerce and automation
AI Agent Automation
Claude Code generating and executing code for commerce operations, data processing, and integrations
Data Transformations
ETL pipelines for order processing, inventory sync, and real-time data normalization
Custom Integrations
Execute merchant-specific business logic, webhook handlers, and third-party API callbacks
Code Generation
AI agents writing, testing, and deploying code with full development environment access
Report Generation
Create PDFs, spreadsheets, and data exports with full language runtime support
Browser Automation
Playwright pre-installed for web scraping, testing, and UI automation tasks
Ready to Run AI Agents Securely?
Deploy your own sandbox infrastructure or use StateSet's managed service