Skip to content
2 min read · 376 words

Interface: CreateSandboxOptions

Defined in: src/batteries/sandbox/manager.ts:80

Options for createSandbox.

Properties

PropertyModifierTypeDescriptionDefined in
allowUnsandboxedFallback?readonlybooleanPermit running WITHOUT OS containment when the environment cannot provide it. Remarks Fires only for pre-execution conditions resolved once at construction — a platform the backend cannot sandbox that we still run on, dependency errors, or an absent optional peer. It NEVER fires for a violation (a violation means the sandbox worked), and native Windows is refused outright rather than degraded. When it fires the handle is permanently marked, every invocation emits a loud event, and the tool descriptions tell the model it has no OS containment.src/batteries/sandbox/manager.ts:113
enforcerreadonlySandboxPolicyEnforcerThe boundary itself. Node's SRT-backed enforcer lives on the sandbox/node subpath.src/batteries/sandbox/manager.ts:92
fsNodeVersion?readonlystringRecorded on observability events so a rules-versus-backend mismatch is diagnosable without a bisect.src/batteries/sandbox/manager.ts:119
onSandbox?readonly(event: SandboxEvent) => voidObservability firehose: bypasses, fallbacks, drift outcomes, and the SRT version rules came from.src/batteries/sandbox/manager.ts:102
optionalPeerPresent?readonlybooleanWhether the optional peer resolved; feeds the preflight decision above.src/batteries/sandbox/manager.ts:117
policyreadonlySandboxPolicyADK-owned policy vocabulary, mapped to the backend's config inside the enforcer. Remarks The per-axis defaults DIFFER and are not a symmetry worth "fixing": reads default to ALLOW (absent denyRead means everything is readable, and allowRead re-permits WITHIN a deny), while writes default to DENY and network is an allow-list. A checker that unified them would disagree with the OS by construction.src/batteries/sandbox/manager.ts:90
strictMode?readonlybooleanIgnore the per-call escape entirely, matching the reference consumer's strict mode.src/batteries/sandbox/manager.ts:115
translator?readonlyPathTranslatorModel-path translation, and the redaction used on every observability event. Remarks Supply it if you want host identifiers scrubbed from the event stream — no battery-generated surface should carry the sandbox root, home directory, or user name.src/batteries/sandbox/manager.ts:100