Skip to main content
This page documents all configuration options for @enclave-vm/core.

Quick Example

Core Options

Console Limits

Memory Tracking

Reference Sidecar

Double VM Layer

AI Scoring Gate

Worker Pool Adapter

Custom Sandbox Adapter

@enclave-vm/core runs scripts with node:vm. Where that is not available (a browser worker, an edge runtime), run() fails with @enclave-vm/core needs node:vm, ...; pass a sandboxAdapter to run scripts another way. It replaces the double VM and the adapter option.
The enclave still validates and transforms every script before calling execute, but isolation is then the adapter’s job: it receives the ExecutionContext (limits, tool handler, stats, abort signal) and must enforce it. The caller owns the adapter: enclave.dispose() does not dispose it, so one adapter can serve several enclaves. In a browser, @enclave-vm/browser is usually the better fit.

Security Options

Execution Result

The run() method returns:

Error Codes