Skip to main content
API reference for the @enclave-vm/core package.

Installation

Enclave Class

The main class for secure code execution.

Constructor

EnclaveOptions

Methods

run(code, options?)

Execute code in the sandbox.
Parameters:
  • code - JavaScript code to execute
  • options - Optional execution options
Returns: ExecutionResult
Example:

validate(code)

Validate code without executing.
Returns: ValidationResult
Example:

dispose()

Clean up resources.
Example:

Types

SecurityLevel

ToolHandler

Example:

ExecutionError

ExecutionStats

ScoringGateOptions

Factory Functions

createWorkerPoolAdapter(options)

Create a worker pool adapter for OS-level isolation.
Options:
Example:

createDoubleVmAdapter(options)

Create a double-VM adapter for nested isolation.
Options:

RuleBasedScorer Class

Semantic pattern detection scorer.

Methods

score(code)

Reference Sidecar

Handle large tool responses.

SidecarOptions

Complete Example