Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Even with .env in .gitignore and not visible to Cursor, the AI keeps suggesting code that logs env variables, prints secrets, or accesses secret manager values, even after I explicitly tell it not to.
This creates a risk of accidentally exposing real secrets when the model suggests “debugging” steps or auto-executes code.
Steps to Reproduce
How to Reproduce:
Make sure .env is in .gitignore so Cursor cannot see it.
Open any file that references process.env.* or secrets from a cloud secret manager.
Ask Cursor for help modifying or debugging that code.
Even after saying “don’t access or log env variables,” the AI still suggests printing them, accessing them for debugging, or calling secret manager APIs.
Expected Behavior
Expected:
If I say “don’t touch env vars,” the model should stop. Ideally, there should be a setting to block any suggestions that attempt to read or log environment variables.
Actual:
Cursor keeps trying alternative ways to access or print them, despite not having access to the .env file at all.
A “safe mode” or a rule to fully prevent env access would solve this.
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Version: 2.1.50
VSCode Version: 1.105.1
Commit: 56f0a83df8e9eb48585fcc4858a9440db4cc7770
Date: 2025-12-06T23:39:52.834Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 24.6.0
Does this stop you from using Cursor
No - Cursor works, but with this issue