Secure AI Agent Execution

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.

<2s
Pod Startup
<100ms
Execution Overhead
<50ms
Stream Latency
99.9%
Uptime SLA
Platform Overview

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.

Isolated Kubernetes pods with kernel-level security (gVisor/Kata)
Pre-installed Claude Code CLI with full Agent SDK support
Multi-language runtimes: Node.js, Python, Go, Rust
Real-time SSE/WebSocket streaming for live output
Checkpoint/snapshot support for resuming work
Per-organization API credentials and isolation

Sandbox Execution Flow

SDK Client
sandbox.create()
Controller
Provisions K8s Pod
Sandbox Pod
Isolated Container
Claude Code
AI Agent Execution
Results
Stream Output/Files
Architecture

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

Kubernetes pod lifecycle management
REST API + WebSocket server
JWT/API key authentication
SSE streaming for real-time output
Rate limiting and quota enforcement

Specifications

replicas3 (HA)
port8080
stackNode.js/Express
Multi-Language Support

Runtime Environments

Pre-installed language runtimes with popular tools and frameworks

🟢

Node.js 22.x

Pre-installed tools and packages

TypeScripttsxts-nodenpmpnpm
REST API

API Endpoints

Complete REST API for sandbox lifecycle management, code execution, and file operations with SSE streaming support.

POST/api/v1/sandbox/create
GET/api/v1/sandbox/:id
POST/api/v1/sandbox/:id/execute
POST/api/v1/sandbox/:id/files
GET/api/v1/sandbox/:id/files
DELETE/api/v1/sandbox/:id
SDK Usage Example
import { 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);
Capabilities

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

Enterprise Security

Security & Isolation

Multiple layers of isolation ensure that sandboxes are completely secure and cannot affect the host system or other sandboxes.

Kernel-level isolation via gVisor or Kata Containers
Non-root execution (UID 1001) in every sandbox
NetworkPolicy restricts egress to HTTPS/DNS only
SHA256-hashed API keys (never stored plaintext)
Per-organization namespace isolation
Complete audit logging for compliance
Security Isolation Layers
Container RuntimegVisor syscall interception
NetworkEgress: HTTPS (443), DNS (53)
UserNon-root sandbox (UID 1001)
ResourcesCPU/Memory limits per pod
FilesystemOptional read-only root
Resource Limits0.5-4 CPU, 256MB-8GB RAM

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