What it is

.aiexclude is a gitignore-style file that Gemini-powered IDE features honor to keep matching files out of AI context and suggestions.

Why use it

It prevents Gemini from reading sensitive files when generating code or answering questions inside the IDE, independent of .gitignore.

How to set it up

Create .aiexclude in your project root (or a subdirectory) and list patterns to exclude, one per line.

Example .aiexclude
.env
*.pem
*.key
keystore.properties

What to exclude

Common sensitive categories worth adding to .aiexclude:

FAQ

Does an empty .aiexclude do anything?
In some implementations an empty .aiexclude blocks the whole directory. Add explicit patterns to control exactly what is excluded.

Check your own project

158 of 499 repos this week exposed sensitive paths to AI tools. Check yours in seconds:

Run the same local check with Offsend CLI:

brew install --cask offsend/tap/offsend-cli
offsend show
offsend prepare --dry-run

Everything runs locally. No file contents are uploaded.