Skip to content
2 min read · 360 words

Interface: EvaluateJavascriptConfig

Defined in: src/batteries/sandbox/js/ses_contracts.ts:25

Configuration for the JavaScript guest battery.

Properties

PropertyModifierTypeDescriptionDefined in
gatereadonly(ctx: unknown, call: { args: unknown; tool: string; }) => void | Promise<void>Required approval callback for every evaluation. Remarks Evaluation is a capability-bearing operation, so construction rejects its omission; invoking the gate is a real suspension and a harness with no decider waits indefinitely.src/batteries/sandbox/js/ses_contracts.ts:33
globals?readonlyReadonly<Record<string, GuestGlobal>>Named host capabilities exposed to the guest. Remarks These are declarations, never bare functions: functions cannot cross structured clone. Each name becomes an in-guest asynchronous stub that posts a hostcall, even when the host implementation itself is synchronous.src/batteries/sandbox/js/ses_contracts.ts:42
hostcallQuotas?readonlyPartial<HostcallQuotas>Hostcall quotas, resolved once by the tool factory. Remarks Defaults are merged and floors validated; invalid values name the field, value, and bound in E_INVALID_SANDBOX_CONFIG. The enforcing layer receives resolved quotas rather than inventing its own defaults.src/batteries/sandbox/js/ses_contracts.ts:68
hostLockdown?readonlybooleanWhether to apply lockdown to the host realm. Remarks This governs only the host realm and is process-global and irreversible. The guest's own lockdown() always runs; that guest lockdown is the security guarantee.src/batteries/sandbox/js/ses_contracts.ts:76
limits?readonlyPartial<GuestLimits>Guest resource limits, resolved once by the tool factory. Remarks Defaults are merged and floors validated; invalid values name the field, value, and bound in E_INVALID_SANDBOX_CONFIG. The enforcing runtime receives the fully resolved limits and never re-derives a default.src/batteries/sandbox/js/ses_contracts.ts:59
modules?readonlyReadonly<Record<string, unknown>>Allow-listed module specifiers and their host-side values. Remarks Specifiers are re-checked inside the guest. Injecting a module grants the guest whatever that module can reach, and transitive import graphs are deliberately not policed.src/batteries/sandbox/js/ses_contracts.ts:50
runtime?readonlyGuestRuntimeLikeRuntime seam used instead of the default SES runtime, typically by an adapter.src/batteries/sandbox/js/ses_contracts.ts:78