Agent bypasses ignored files with grep

I gave Cursor explicit instructions to run a script to call an API, but after some time it called the API with cURL and using grep to extract my API key from my env file. The env file is hidden from Cursor as it confirms below.

Note that Cursor cannot see my .env.yml file.

v0.50.5 with Claude 4 Sonnet in Agent mode running in WSL2 (Ubuntu)