The sandbox implementation prevents access to everything in a top level .gitignore file. I understand this is to prevent accidental access to credentials in .env files, etc. However, this presents challenges to using project scoped tools like python virtual environments and access to node_modules, etc., which are commonly found in .gitignore files. Also prevents working on ephemeral data files and logs.
e.g.:
```
sandbox-exec -f /var/folders//T/antigravity-sandbox.sb /bin/bash
-c ‘venv/bin/python myPython.py’
/bin/bash: venv/bin/python: Operation not permitted
```
Workaround 1: comment out my .gitignore file in between doing commits. ![]()
Workaround 2: Leave top level .gitignore empty or don’t have anything the sandbox might need, and add one to each subdirectory you actually want to ignore. This bypasses the limited implementation of the sandbox script, since it doesn’t check nested .gitignore files. ![]()
Setup:
- Mac
- Strict mode: off
- Enable Terminal Sandbox: on
- Sandbox Allow Network: on
- Enable Shell Integration: on
- Allow/deny list: empty
- Agent Gitignore Access: on
- Agent Non-Workspace File Access: off
Suggestions:
Remove the .gitignore parsing entirely, use another method for blocking access in the sandbox.
Use the “Agent Gitignore Access” setting to toggle the .gitignore processing for the sandbox too. In the context of protecting credentials, it makes little sense to block files in the sandbox that the agent has direct access to read anyway.
In the context of safety, if you are intending to protect access to “gitignored” files, you should recursively scan for nested .gitignore files. However, that would break my workaround.