Basic setup
With no options, the driver provides a filesystem with a read-onlynode_modules overlay and no network or child process access.
Configuring capabilities
Pass options to enable and configure specific host capabilities.Permissions
Permissions are deny-by-default. Each capability (filesystem, network, child process, env) can be controlled independently with a boolean or a function for fine-grained checks.Filesystem
By default, the driver usesModuleAccessFileSystem, which provides a read-only overlay of the host’s node_modules. You can supply a custom VirtualFileSystem implementation or use the built-in in-memory filesystem.
Child processes
Provide aCommandExecutor to allow sandboxed code to spawn processes. This is gated behind the childProcess permission.
Process and OS configuration
UseprocessConfig and osConfig to control what the sandbox sees for process.cwd(), process.env, os.platform(), and similar APIs.