Why Enclave?
When AI agents generate code, you need to execute it safely. Enclave provides:- 6-Layer Security - Pre-scanning, AST validation, code transformation, AI scoring, runtime isolation, and output sanitization
- Real-time Streaming - See execution output as it happens with tool call visualization
- Tool Orchestration - Connect external APIs and services through a controlled interface
- React Integration - First-class hooks and components for building code execution UIs
Get Started
Quickstart
Build your first secure code execution in 5 minutes
Installation
Install all Enclave packages for your project
Core Libraries
@enclave-vm/core
Secure JavaScript sandbox with AST validation, runtime isolation, and AI scoring gate
@enclave-vm/ast
AST-based JavaScript validator with 16 security rules and code transformation
EnclaveJS Streaming Runtime
Build real-time code execution UIs with streaming output, tool orchestration, and React integration.@enclave-vm/broker
Tool broker with session management and HTTP API
@enclave-vm/client
Browser and Node.js client SDK
@enclave-vm/react
React hooks and components
EnclaveJS Overview
Learn about the full streaming architecture including types, protocol, and runtime deployment
Understand the System
Architecture
System overview and deployment patterns
Security Model
6-layer defense-in-depth architecture
AgentScript
Safe JavaScript subset for LLM-generated code
Streaming Protocol
NDJSON protocol with E2E encryption
Learn by Example
Build Your First Agent
Step-by-step guide to building an AI agent
Tool Integration
Connect external APIs as tools
React Code Editor
Build a real-time code execution UI
Production Deployment
Deploy Enclave to production
Key Features
| Feature | Description |
|---|---|
| Production-ready Security | 500+ security tests, 6 defense layers, comprehensive CVE coverage |
| Real-time Streaming | NDJSON-based protocol for stdout, logs, and tool calls |
| Tool Orchestration | Define tools with validation, handle calls during execution |
| React Integration | First-class hooks for building interactive code execution UIs |
| End-to-end Encryption | Optional ECDH + AES-256-GCM for sensitive workloads |
| TypeScript-first | Full type safety and excellent developer experience |
| Multiple Isolation Modes | VM sandbox, worker pool, and double-VM options |
| AI Scoring Gate | Semantic pattern detection to block suspicious code |
Quick Install
Explore the Docs
| Section | Description |
|---|---|
| Concepts | Understand how Enclave works |
| Core Libraries | Deep dive into each package |
| Guides | Step-by-step tutorials |
| API Reference | Complete API documentation |
| Examples | Copy-paste code examples |
| Troubleshooting | Debug issues |