Skip to content

Interface: SandboxConfig

Defined in: packages/core/src/sandbox/SandboxEngine.ts:67

Configuration for a SandboxEngine instance.

All fields are optional — sensible defaults are applied.

Example

typescript
const engine = new SandboxEngine({
    timeout: 3000,       // Kill after 3s
    memoryLimit: 64,     // 64MB per isolate
    maxOutputBytes: 512_000, // 500KB max result
});

Properties

maxOutputBytes?

ts
optional maxOutputBytes: number;

Defined in: packages/core/src/sandbox/SandboxEngine.ts:87

Maximum size of the serialized output in bytes. Prevents a malicious script from returning gigabytes of data.

Default

ts
1_048_576 (1MB)

memoryLimit?

ts
optional memoryLimit: number;

Defined in: packages/core/src/sandbox/SandboxEngine.ts:80

Maximum memory for the V8 isolate in megabytes. If exceeded, the isolate dies and is recreated on next call.

Default

ts
128

timeout?

ts
optional timeout: number;

Defined in: packages/core/src/sandbox/SandboxEngine.ts:73

Maximum execution time in milliseconds. If the script exceeds this, the V8 isolate kills it.

Default

ts
5000