Skip to content

Light version: pages open quickly, without the 3D graphics. You are seeing the light version because the 3D graphics would be slow on this device. The content is the same.

Turn on 3D

Preparing the graphics. This can take a moment on the first visit.

Henry Lõiv

Web design & development

Quick Answer

Does .cursorignore keep secrets safe?

Artificial Intelligence 2 min read

.cursorignore helps restrict Cursor’s direct AI access to files, but it does not protect secrets through every tool. Terminal commands and MCP tools can still access ignored content. Use ignore files as one control alongside the permissions of the processes and accounts doing the work. 12

Understand what each file controls

Cursor respects .gitignore and supports additional exclusions in .cursorignore. Its documentation explicitly separates those file-access controls from terminal and MCP access. 1

Git has another limitation: adding a path to .gitignore does not stop tracking a file that is already tracked. 3 Check existing repository contents as well as the patterns you are about to add. A tidy ignore file is not evidence that a credential was never committed.

Check the route the agent uses

Review Cursor’s run mode, approvals and available sandbox controls. These determine how shell and MCP calls are handled; an instruction in a prompt is not a substitute for checking those settings. Platform and version support matter. 2

For an integration task, provide a development account with only the required access. Keep examples in documentation as placeholders, so the agent can understand the expected variable names without needing production values.

A harmless check is to create private-example.txt containing DUMMY_VALUE, exclude that filename and ask for a direct file read. Observe which tool is attempted and what it reports. This checks that route only; it does not establish that every terminal or MCP operation is blocked.

If a credential was already exposed

Adding an ignore rule cannot invalidate an exposed key. Revoke or rotate the credential with its provider, then address any copies or repository history that need attention. GitHub recommends dealing with the credential itself first when cleaning a repository exposure. 4

Related reading

Sources

  1. Cursor: Ignore file
  2. Cursor: Run modes
  3. Git: gitignore
  4. GitHub: Removing sensitive data from a repository

Fact checked:

Hi!

I really love the sea, yachts, sunsets and starry skies.

Through this little 3D world, I can share a small part of myself with you.

Thank you for opening this bottle and reading my letter.

Henry

Let’s talk about your project

Tell me about your project

Tell me what you’d like to build or improve. You don’t need a finished brief — we’ll work out the scope and next steps together.

01 How can I help?
02 How many pages do you need?
03 Which extras do you need? Choose all that apply
04 When does it need to be ready?
05 Project details
06 Your contact details

Enquiry received

Thank you!

Your enquiry has been received. I usually reply by email within 2 working days.