Skip to content

CodeLimits

Defined in: mcp-code/src/lib/types.ts:8

Per-execution caps. Defaults (DEFAULT_CODE_LIMITS) come from the Phase 7 sandbox spike (PRD Decisions #12–13). Every limit fails the execution with a typed MantleError; none can take down the host process.

maxCalls: number

Defined in: mcp-code/src/lib/types.ts:21

Bridged service calls allowed per execution.

50

maxOutputBytes: number

Defined in: mcp-code/src/lib/types.ts:23

Cap on the JSON-serialized result, and separately on captured log output.

64 KiB

memoryBytes: number

Defined in: mcp-code/src/lib/types.ts:12

QuickJS setMemoryLimit — a soft cap (it undercounts some allocations).

32 MiB

stackBytes: number

Defined in: mcp-code/src/lib/types.ts:19

QuickJS setMaxStackSize. QuickJS runs on the host thread’s native stack, so keep this under ~¼ of it (~256 KiB on Node’s default main-thread stack).

192 KiB

timeoutMs: number

Defined in: mcp-code/src/lib/types.ts:10

Wall-clock deadline: interrupt handler for CPU loops, host timer for a bridged call that never settles.

10000

wasmMemoryBytes: number

Defined in: mcp-code/src/lib/types.ts:14

Bounded WebAssembly.Memory maximum — the hard cap, enforced by the WASM engine.

64 MiB