AgentStack
MCP verified Apache-2.0 Self-run

Enclave

mcp-agentfront-enclave · by agentfront

A secure JavaScript sandbox designed for safe AI agent code execution. Protects against code injection, prototype pollution, and sandbox escapes. The security layer that makes AI-generated code safe to run.

No reviews yet
0 installs
0 views
view→install

Install

$ agentstack add mcp-agentfront-enclave

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Enclave? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Enclave

Secure sandbox runtime for AI agents

[](https://www.npmjs.com/package/ast-guard) [](https://www.npmjs.com/package/@enclave-vm/core)

[](https://www.npmjs.com/package/@enclave-vm/broker) [](https://www.npmjs.com/package/@enclave-vm/client) [](https://www.npmjs.com/package/@enclave-vm/react)

[](https://nodejs.org) [](./LICENSE)

Documentation | Live Demo | FrontMCP Framework


Why Enclave?

  • Extensive security testing - See [security audit](./libs/enclave-vm/SECURITY-AUDIT.md) for details
  • Defense in depth - 6 security layers for LLM-generated code
  • Streaming runtime - Real-time event streaming with tool call support
  • Zero-config - Works out of the box with sensible defaults
  • TypeScript-first - Full type safety and excellent DX

Install

Core Packages

npm install @enclave-vm/core    # Secure JS sandbox
npm install ast-guard           # AST security validation

Streaming Runtime

npm install @enclave-vm/broker   # Tool broker & session management
npm install @enclave-vm/client   # Browser/Node client SDK
npm install @enclave-vm/react    # React hooks & components

Packages

| Package | Description | | ------------------------------------------------- | --------------------------------------------------- | | [@enclave-vm/core](./libs/enclave-vm) | Secure JavaScript sandbox with 6 security layers | | [@enclave-vm/broker](./libs/enclavejs-broker) | Tool registry, secrets management, session API | | [@enclave-vm/client](./libs/enclavejs-client) | Browser & Node.js client for streaming sessions | | [@enclave-vm/react](./libs/enclavejs-react) | React hooks: useEnclaveSession, EnclaveProvider | | [@enclave-vm/runtime](./libs/enclavejs-runtime) | Deployable runtime worker (Lambda, Vercel, etc.) | | [@enclave-vm/types](./libs/enclavejs-types) | TypeScript types & Zod schemas | | [@enclave-vm/stream](./libs/enclavejs-stream) | NDJSON streaming, encryption, reconnection | | [ast-guard](./libs/ast-guard) | AST-based security validator |

Quick Start

import { Enclave } from '@enclave-vm/core';

const enclave = new Enclave({
  securityLevel: 'SECURE',
  toolHandler: async (name, args) => {
    if (name === 'getUser') return { id: args.id, name: 'Alice' };
    throw new Error(`Unknown tool: ${name}`);
  },
});

const result = await enclave.run(`
  const user = await callTool('getUser', { id: 123 });
  return { greeting: 'Hello, ' + user.name };
`);

if (result.success) {
  console.log(result.value); // { greeting: 'Hello, Alice' }
}

enclave.dispose();

React Integration

import { EnclaveProvider, useEnclaveSession } from '@enclave-vm/react';

function App() {
  return (
    
      
    
  );
}

function CodeRunner() {
  const { execute, state, result, stdout } = useEnclaveSession();

  const runCode = () =>
    execute(`
    const data = await callTool('fetchData', { id: 123 });
    return data;
  `);

  return (
    
      
        {state === 'running' ? 'Running...' : 'Run Code'}
      
      {stdout && {stdout}}
      {result && {JSON.stringify(result, null, 2)}}
    
  );
}

Architecture

See [README-ARCHITECTURE.md](./README-ARCHITECTURE.md) for detailed architecture documentation covering:

  • Deployment scenarios (embedded vs extracted runtime)
  • Streaming protocol (NDJSON)
  • Tool broker pattern
  • Reference sidecar & auto-ref
  • Security & encryption

Demos

Enclave Demo (basic sandbox)

npx nx serve enclave-demo

A CLI script that demonstrates core sandbox features: arithmetic, loops, tool calls, and security blocking of disallowed operations.

Streaming Demo (full architecture)

npx nx demo streaming-demo

Starts a 3-server architecture with a web UI, covering embedded, lambda, and direct execution modes:

  • Client (port 4100) — Web UI
  • Broker (port 4101) — Tool execution & session management
  • Runtime (port 4102) — Sandboxed code execution

Read the full documentation →


License

[Apache-2.0](./LICENSE)

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.