> ## 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

> [card] [Quickstart](https://docs.agentfront.dev/enclave/getting-started/quickstart.md)
>
> Build your first secure code execution in 5 minutes

> [card] [Installation](https://docs.agentfront.dev/enclave/getting-started/installation.md)
>
> Install all Enclave packages for your project

## Core Libraries

> [card] [@enclave-vm/core](https://docs.agentfront.dev/enclave/core-libraries/enclave-vm/overview.md)
>
> Secure JavaScript sandbox with AST validation, runtime isolation, and AI scoring gate

> [card] [@enclave-vm/ast](https://docs.agentfront.dev/enclave/core-libraries/ast-guard/overview.md)
>
> 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.

> [card] [@enclave-vm/broker](https://docs.agentfront.dev/enclave/enclavejs/broker.md)
>
> Tool broker with session management and HTTP API

> [card] [@enclave-vm/client](https://docs.agentfront.dev/enclave/enclavejs/client.md)
>
> Browser and Node.js client SDK

> [card] [@enclave-vm/react](https://docs.agentfront.dev/enclave/enclavejs/react.md)
>
> React hooks and components

> [card] [EnclaveJS Overview](https://docs.agentfront.dev/enclave/enclavejs/overview.md)
>
> Learn about the full streaming architecture including types, protocol, and runtime deployment

## Understand the System

> [card] [Architecture](https://docs.agentfront.dev/enclave/concepts/architecture.md)
>
> System overview and deployment patterns

> [card] [Security Model](https://docs.agentfront.dev/enclave/concepts/security-model.md)
>
> 6-layer defense-in-depth architecture

> [card] [AgentScript](https://docs.agentfront.dev/enclave/concepts/agentscript.md)
>
> Safe JavaScript subset for LLM-generated code

> [card] [Streaming Protocol](https://docs.agentfront.dev/enclave/concepts/streaming-protocol.md)
>
> NDJSON protocol with E2E encryption

## Learn by Example

> [card] [Build Your First Agent](https://docs.agentfront.dev/enclave/guides/first-agent.md)
>
> Step-by-step guide to building an AI agent

> [card] [Tool Integration](https://docs.agentfront.dev/enclave/guides/tool-integration.md)
>
> Connect external APIs as tools

> [card] [React Code Editor](https://docs.agentfront.dev/enclave/guides/react-code-editor.md)
>
> Build a real-time code execution UI

> [card] [Production Deployment](https://docs.agentfront.dev/enclave/guides/production-deployment.md)
>
> 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](https://docs.agentfront.dev/enclave/concepts/architecture.md) | Understand how Enclave works |
| [Core Libraries](https://docs.agentfront.dev/enclave/core-libraries/enclave-vm/overview.md) | Deep dive into each package |
| [Guides](https://docs.agentfront.dev/enclave/guides/first-agent.md) | Step-by-step tutorials |
| [API Reference](https://docs.agentfront.dev/enclave/api-reference/enclave-vm.md) | Complete API documentation |
| [Examples](https://docs.agentfront.dev/enclave/examples/hello-world.md) | Copy-paste code examples |
| [Troubleshooting](https://docs.agentfront.dev/enclave/troubleshooting/common-errors.md) | Debug issues |

## Links

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


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