Repository navigation
Description
Summary
Sandboxed execution fails when the working directory is on a Windows volume mounted to a folder rather than a drive letter. The same command succeeds with sandboxing disabled. This appears related to how mounted-volume paths are handled by the sandbox.
Reproduction steps
-
On Windows, mount a volume (for example, a Dev Drive) to an empty NTFS folder such as
C:\Mounts\SandboxRepro, without assigning the volume a drive letter. -
Create a project at
C:\Mounts\SandboxRepro\NodeMainwith these files:package.json{ "name": "folder-mounted-volume-sandbox-repro", "version": "1.0.0", "private": true, "scripts": { "validate:version": "node ./tools/lib/validate-main.js" } }tools\lib\validate-main.jsconst fs = require("node:fs"); console.log("Node entrypoint loaded successfully."); console.log("Node version:", process.version); console.log("Working directory:", process.cwd()); console.log("Mount realpath:", fs.realpathSync("C:\\Mounts\\SandboxRepro")); console.log("Script realpath:", fs.realpathSync(__filename));
-
Enable sandboxing in the host application and allow access to the project and mount-point folder.
-
Run
npm run validate:versionthrough the sandbox from the project directory. -
Disable sandboxing and run the same command again for comparison.
Expected behavior
The command succeeds with sandboxing enabled when access is allowed, including resolving paths through the volume mount point.
Actual behavior
With sandboxing enabled, Node.js fails before the script executes:
Error: EPERM: operation not permitted, stat 'C:\Mounts\SandboxRepro'
at Object.realpathSync (node:fs:2872:17)
at toRealPath (node:internal/modules/helpers:67:13)
at Module._findPath (node:internal/modules/cjs/loader:850:22)
With sandboxing disabled, the command exits successfully and resolves both the mount-point and script paths.
Notes
- Observed on Windows with Node.js
v24.20.0, through the VS Code Copilot SDK integration. - The related report confirms that explicitly allowing the mount-point folder does not resolve the failure. Allowing the underlying volume GUID path instead results in
CreateProcessSecurityEnvironment failed (HRESULT = 0x8007000F). - A local retry also encountered
CreateProcessSecurityEnvironment failed (HRESULT = 0x80070057); the configuration that triggered this separate error was not captured.
Related report: microsoft/vscode#343231
Activity
[-]Windows sandbox: folder-mounted volume causes Node.js EPERM and process security environment failures[/-][+]Windows sandbox fails for workspaces on folder-mounted volumes[/+]bbonaby commentedon Oct 23, 2026
CC: Daniel (@daniedud-MSFT) can you take a look at this when you get the chance?