.llmignore
The .gitignore for AI
Generate ignore files for every AI coding tool. .cursorignore, .aiignore, .aiexclude, .claudeignore, and more. One builder. Every format.
Why you need this
AI agents operate with your full filesystem as context. That is a feature and a liability.
Security
Your AI assistant reads .env files, PEM keys, and credentials by default. One leaked secret can compromise your entire infrastructure.
23.8M secrets leaked on public GitHub in 2024Cost & Performance
Stop wasting context window tokens on node_modules, build artifacts, and binary blobs. Smaller context means faster, cheaper inference.
30–40% of retrieved context is semantically redundantIP Protection
Keep proprietary algorithms, trade-secret logic, and sensitive business rules out of third-party AI APIs.
$4.81M avg cost of credential-related breachesSpec
gitignore syntax
Uses identical fnmatch / glob patterns. If you know .gitignore, you already know .llmignore.
Cascading scope
Place a .llmignore in any directory. Patterns apply to that directory and its children, just like .gitignore.
Header comment
The first line should reference the spec URL so tools can auto-discover and validate the file.
Semantic sections
Organize patterns with comment headers: # Secrets, # Binaries, # Generated. Improves readability and auditing.
No vendor lock-in
Plain text, no proprietary format. Any AI coding tool, agent framework, or IDE can parse it.
# .llmignore — Spec: https://rival.tips/llmignore# Syntax: identical to .gitignore (fnmatch patterns)# ---- Secrets & credentials ----.env.env.***/*.pem**/*.key**/credentials.***/secrets.***/.secret*# ---- Infrastructure ----**/terraform.tfstate***/pulumi.*.yaml**/.kube/config# ---- Dependencies ----**/node_modules/****/vendor/****/__pycache__/**# ---- Build artifacts ----**/dist/****/build/****/.next/****/target/**# ---- Large data (save context window) ----**/*.sqlite**/*.db**/*.wasm**/*.bin**/*.csv**/*.parquet# ---- Sensitive data ----**/migrations/*.sql**/fixtures/****/seed-data/**Template Builder
Pick your tool, select your stack. We generate the file.
Vendor-neutral standard for all AI coding tools
# .llmignore — Generated at rival.tips/llmignore# Files and patterns AI agents should never read or send to LLMs.# Syntax: identical to .gitignore (fnmatch patterns)# Secrets & Credentials.env.env.***/*.pem**/*.key**/credentials.***/secrets.***/.secret*# Sensitive Data**/migrations/*.sql**/fixtures/****/seed-data/**# Large Binaries**/*.wasm**/*.bin**/*.sqlite**/*.dbPattern Tester
Test a file path against your active ignore patterns.
How to Integrate
Most tools have native ignore support. For tools without it, add these instructions to their config file.
Cursor
.cursorignore
Cursor natively supports .cursorignore. Drop .llmignore in your project root and Cursor will exclude matching files from all AI features.
JetBrains
.aiignore
JetBrains AI Assistant natively reads .aiignore, .cursorignore, .codeiumignore, and .aiexclude. Drop .llmignore in your project root.
Claude Code
CLAUDE.md
Before reading any file, check .llmignore in the project root. Never read, output, or send contents of files matching those patterns. Syntax identical to .gitignore.
Windsurf
.codeiumignore
Windsurf natively supports .codeiumignore. Drop .llmignore in your project root to exclude files from Cascade and indexing.
Any agent
AGENTS.md
This project uses .llmignore (generated at rival.tips/llmignore). Before accessing files, check .llmignore and skip any path matching its patterns. Syntax identical to .gitignore.
Ecosystem
Official parsers, a GitHub Action, and the spec itself. All open source.
CI/CD Integration
Enforce .llmignore in every pull request. Missing security patterns? The check fails.
name: llmignore checkon: [push, pull_request]jobs: check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: llmignore-spec/check@v1 with: severity: error require-file: true check-secrets: trueAdd .llmignore to your repo today
One file in your project root. Every AI agent that respects the spec will skip your secrets, credentials, and proprietary code automatically.