Sandbox set up error

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Error is in the agent shell sandbox bundled with Cursor IDE (cursorsandbox) . Attempting to blackhole a .env file in a different (inaccessible) project folder: reports ‘Failed to bind blackhole to “/project_path/.env”: IO error: No such file or directory (os error 2)"’ It then fails out meaning that the sandbox is not established.

Steps to Reproduce

Happens every time an agent is trying to do anything involving setup of a sandbox in a different project from my main project folder

Expected Behavior

If the target file needing blackhole protection is not accessible, the protection is not required. Process should continue and allow sandbox setup to continue.

Operating System

Linux

Version Information

Version: 3.29.9
Commit: 306d153d51d714882ab7b1bc49649cab624e8a30
Platform: Linux x64
OS: Linux 7.0.0-42-generic
Channel: stable
VS Code base: 1.128.0

For AI issues: which model did you use?

Grok 4.7 high not fast

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hi @nickov8,

Thanks for the report!

Where does that other project actually live? If you can share the output of findmnt -T /path/to/other/project (feel free to mask your username), I’m especially interested in whether it’s on a drive mounted under /run/media/... or a similar location.

Hi Colin

Target is root, Source is /dev/sda3, Fstype is ext4, and Options rw.relatime

Thanks @nickov8, that rules out the external drive idea, since the project is on your main disk.

My next suspect is the .env file itself. If it’s a symlink pointing to a file that doesn’t exist (or somewhere that isn’t reachable from that project), the sandbox trips on exactly this error. Could you run these in that other project folder and paste the output?

ls -la .env
readlink -f .env

ls => -rw-rw---- 1 nick nick 109 Aug 28 15:41 .env
readlink: /home/nick/DockerProjects/SPACE_AI/.env

There’s nothing strange about the file; I think it is simply that it is a prohibited file (Cursor is already blocking it from access from within Cursor, because it contains sensitive secrets)
So the part of sandbox set up that is trying to blackhole it isn’t finding it
Which is fine, except that that causes error

Thanks @nickov8, that rules out the symlink idea. It’s an ordinary file, so the sandbox shouldn’t be failing on it, and I agree it should skip a file it can’t find instead of stopping.

In the meantime you can get past it in Cursor Settings → Agents → Execution and Approvals by setting the run mode to Ask Every Time. Commands then wait for your approval and run without the sandbox. Run Everything (Unsandboxed) also works, but only use it on projects you trust.

I can’t tell from here why the sandbox loses sight of the file, and I’d rather not keep guessing. A debug trace would show it:

  1. Quit Cursor completely.
  2. Start it from a terminal with SBX_DEBUG=1 cursor (or however you normally launch it, with SBX_DEBUG=1 in front).
  3. Reproduce the error the way it normally happens, with the agent running a command in that other project.
  4. Copy the lines starting with sandbox: from the command output, from step 4/7 down to the error, and paste them here.

Please leave the paths as they are if you can. If you’d rather mask a name, replace it the same way everywhere.