> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Welcome to Enclave

> Production ready JavaScript sandbox for AI agent code execution

Enclave is a production-ready JavaScript sandbox for executing AI-generated code safely. It provides a defense-in-depth security model, real-time streaming execution, and comprehensive tooling for building AI agent systems.

## 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](/enclave/getting-started/quickstart)**
>
> Build your first secure code execution in 5 minutes

> **[Installation](/enclave/getting-started/installation)**
>
> Install all Enclave packages for your project

## Core Libraries

> **[@enclave-vm/core](/enclave/core-libraries/enclave-vm/overview)**
>
> Secure JavaScript sandbox with AST validation, runtime isolation, and AI scoring gate

> **[@enclave-vm/ast](/enclave/core-libraries/ast-guard/overview)**
>
> 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](/enclave/enclavejs/broker)**
>
> Tool broker with session management and HTTP API

> **[@enclave-vm/client](/enclave/enclavejs/client)**
>
> Browser and Node.js client SDK

> **[@enclave-vm/react](/enclave/enclavejs/react)**
>
> React hooks and components

> **[EnclaveJS Overview](/enclave/enclavejs/overview)**
>
> Learn about the full streaming architecture including types, protocol, and runtime deployment

## Understand the System

> **[Architecture](/enclave/concepts/architecture)**
>
> System overview and deployment patterns

> **[Security Model](/enclave/concepts/security-model)**
>
> 6-layer defense-in-depth architecture

> **[AgentScript](/enclave/concepts/agentscript)**
>
> Safe JavaScript subset for LLM-generated code

> **[Streaming Protocol](/enclave/concepts/streaming-protocol)**
>
> NDJSON protocol with E2E encryption

## Learn by Example

> **[Build Your First Agent](/enclave/guides/first-agent)**
>
> Step-by-step guide to building an AI agent

> **[Tool Integration](/enclave/guides/tool-integration)**
>
> Connect external APIs as tools

> **[React Code Editor](/enclave/guides/react-code-editor)**
>
> Build a real-time code execution UI

> **[Production Deployment](/enclave/guides/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

```bash theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
# Core sandbox
npm install @enclave-vm/core

# AST validation
npm install @enclave-vm/ast

# Streaming runtime
npm install @enclave-vm/broker @enclave-vm/client @enclave-vm/react
```

## Explore the Docs

| Section | Description |
| - | - |
| [Concepts](/enclave/concepts/architecture) | Understand how Enclave works |
| [Core Libraries](/enclave/core-libraries/enclave-vm/overview) | Deep dive into each package |
| [Guides](/enclave/guides/first-agent) | Step-by-step tutorials |
| [API Reference](/enclave/api-reference/enclave-vm) | Complete API documentation |
| [Examples](/enclave/examples/hello-world) | Copy-paste code examples |
| [Troubleshooting](/enclave/troubleshooting/common-errors) | Debug issues |

## Links

* [GitHub Repository](https://github.com/agentfront/enclave)
* [Installation Guide](/enclave/getting-started/installation)
* [Quickstart](/enclave/getting-started/quickstart)
* [API Reference](/enclave/api-reference/enclave-vm)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.