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