The most dangerous assumption in AI-assisted software engineering is assuming .gitignore will protect your secrets from an AI model.
It will not. At least, not in the way most engineering leads expect.
If an engineer opens an uncommitted .env.production file, an SSH private key, or an internal algorithm configuration in VS Code, GitHub Copilot will gladly use active buffer context to generate code suggestions unless explicit exclusion policies are enforced in GitHub. Tabnine respects .gitignore by default, but local overrides and misconfigured agent settings can still expose internal assets to context retrieval pipelines.
At 365Finds, our stance is uncompromising: treating code assistants as passive autocompletes is an operational liability. If your team handles regulated financial data, proprietary machine learning weights, or production API credentials, you must implement dual-tier exclusion rules across repository settings and workspace ignore files.
Here is how to configure exclusion rules properly for both GitHub Copilot and Tabnine, along with the operational trade-offs 365Finds tracks across engineering organizations.
1. GitHub Copilot: Top-Down Content Exclusion
GitHub Copilot does not rely on a local ignore file inside your repository. You cannot simply drop a .copilotignore into your project root and expect Copilot to parse it.
Instead, GitHub enforces content exclusion through centralized policy configuration in GitHub Enterprise Cloud, GitHub Enterprise Server, or repository settings.
Where to Configure the Rules
Depending on your subscription tier and permissions:
- Organization-Level (Recommended): Navigate to
GitHub.com-> Your Organization -> Settings -> Copilot -> Content exclusion. - Repository-Level: Navigate to Repository -> Settings -> Copilot -> Content exclusion (available when organization policies allow repository-level overrides).
Exclusion Rule Syntax
GitHub Copilot uses fnmatch pattern notation. Rules must be formatted as a double-quoted list, one entry per line:
- "*.env"
- "*.env.*"
- "**/*.pem"
- "**/*.key"
- "/config/secrets.json"
- "/internal-core/**"
- "**/proprietary-algorithm/*"
Path Matching Mechanics
- Rooted Paths (
/prefix):/config/production.jsonmatches only that exact path from the repository root. - Unrooted Patterns (No leading slash):
secrets.jsonmatches any file with that name anywhere in the repository hierarchy. - Recursive Globbing (
**):/security/**matches every file and directory under/security. - Case Insensitivity: Patterns are case-insensitive. Specifying
*.pemautomatically covers*.PEM.
What Copilot Does When a File Is Excluded
Once configured, GitHub propagates the exclusion list downstream to connected IDE extensions (Visual Studio Code, JetBrains IDEs, Visual Studio, and Neovim).
When a developer opens an excluded file:
- The Copilot status bar icon displays an exclusion indicator (a slash through the icon).
- Inline completions are shut off inside that buffer.
- The buffer content is blocked from being packed into the context window for completions in neighboring open tabs.
- Copilot Chat and workspace agents cannot read or index the excluded file.
The 365Finds Verdict on Copilot's Model
Centralized policy management gives security administrators peace of mind because developers cannot bypass rules by editing local project files.
However, 365Finds finds the lack of in-repo configuration irritating. You cannot review Copilot exclusions in standard pull requests alongside application code. If a backend engineer adds a new credentials directory, an organization administrator must manually update GitHub web settings or execute a REST API patch against GitHub's policy endpoints.
2. Tabnine: Developer-Centric Ignore Files and Workspace Filtering
Tabnine takes an entirely different architectural path. Rather than enforcing rules exclusively from a remote web portal, Tabnine operates primarily on local filesystem conventions and hierarchical agent configuration files.
Tabnine's Default Gitignore Behavior
By default, Tabnine automatically respects standard .gitignore rules during workspace indexing and retrieval-augmented generation (RAG).
If a file or directory is ignored by Git, Tabnine's indexing engine skips it. This behavior is governed by the setting:
"context.fileFiltering.respectGitIgnore": true
If your .gitignore already excludes .env and build/, Tabnine will not ingest them during background codebase indexing.
Adding a Dedicated .tabnineignore File
Relying solely on .gitignore is fragile. You may want Git to track proprietary algorithmic definitions or architectural diagrams while strictly forbidding Tabnine's local or cloud models from using them as prompt context.
To achieve this, create a .tabnineignore file at the root of your workspace:
# Credentials and Environment files
.env
.env.*
*.pem
*.key
credentials.json
# Proprietary algorithms and model weights
/ai-models/weights/
/src/engine/proprietary/
# High-entropy production config dumps
/infra/terraform/production.tfvars
/config/vault-token*
The syntax matches .gitignore specification:
- Lines starting with
#are treated as comments. - Leading slashes anchor patterns to the workspace root.
- Trailing slashes restrict matches to directories.
- Standard glob wildcards (
*,?,**) apply.
Administrative Governance in Tabnine CLI and Agent
For teams standardizing workstation environments across macOS, Linux, or Windows, Tabnine allows exclusion settings to be codified in settings.json. Tabnine evaluates settings in hierarchical order:
- System Settings (Highest precedence, platform-wide): Enforced by system administrators (e.g.,
/etc/tabnine-cli/settings.jsonon Linux orC:\ProgramData\tabnine-cli\settings.jsonon Windows). - Workspace Overrides:
<project>/.tabnine/agent/settings.json. - User Preferences:
~/.tabnine/agent/settings.json.
If your team maintains an organization-wide exclusion list across multiple tools, you can enforce it globally in Tabnine using custom ignore paths:
{
"context.fileFiltering.respectGitIgnore": true,
"context.fileFiltering.customIgnoreFilePaths": [
"/etc/security/corporate-ai-ignore.txt"
]
}
The 365Finds Verdict on Tabnine's Model
365Finds prefers Tabnine's version-controllable model for day-to-day software engineering. A .tabnineignore file lives in Git, gets reviewed in pull requests, and updates synchronously when project architecture changes. Furthermore, Tabnine provides self-hosted and on-premises deployment options that keep the entire inference pipeline within your private VPC.
The vulnerability with Tabnine is human error: an individual contributor can accidentally delete .tabnineignore in an unmonitored repository branch unless administrators lock down configurations via platform-level system files.
3. GitHub Copilot vs Tabnine: Exclusion Mechanics Compared
| Dimension | GitHub Copilot | Tabnine |
|---|---|---|
| Primary Configuration Location | GitHub Web Settings (Org, Enterprise, or Repo) | Project root (.tabnineignore) and settings.json |
Native .gitignore Compliance | Ignored by default; requires explicit Content Exclusion | Respected automatically (respectGitIgnore: true) |
| Version Control Visibility | Low; stored in GitHub metadata / API settings | High; checked directly into Git repository |
| Propagation Latency | 5 to 30 minutes to IDE clients upon setting change | Immediate upon file save or restart |
| IDE Visual Feedback | Slotted icon indicating disabled state on excluded files | Excluded from context index; suggestions disabled |
| Corporate Override Mechanism | Centralized policy lock at Organization / Enterprise level | System-level settings.json (/etc/tabnine-cli/) |
| Data Boundary Guarantee | Cloud boundary (data filtered before prompt assembly) | Flexible; supports private cloud and on-premises deployment |
4. The 365Finds Four-Tier Defense Framework
Do not rely on a single setting to protect sensitive files from AI indexing. 365Finds recommends engineering teams deploy a four-tier defense posture:
Step 1: Enforce Top-Level Exclusions in GitHub
For teams using GitHub Copilot, organization owners must add foundational wildcards under Organization Settings -> Copilot -> Content exclusion:
- "*.env*"
- "**/*.pem"
- "**/*.key"
- "**/secrets/**"
- "**/*_rsa"
Step 2: Commit a Standardized .tabnineignore
Add a standardized .tabnineignore to all internal project templates. Include sensitive local configuration formats, private certificates, and proprietary data folders.
Step 3: Implement Automated Secret Scanning
Neither Copilot's content exclusion nor Tabnine's ignore file replaces credential hygiene. Use pre-commit hooks such as trufflehog or git-secrets to reject raw tokens and keys before they are committed to disk.
Step 4: Migrate Static Configs to Runtime Secret Managers
If an engineer never stores unencrypted database passwords in local .env files, an AI model cannot accidentally read them. Transition team development setups to secret managers like HashiCorp Vault, AWS Secrets Manager, or 1Password Developer Tools that inject credentials directly into runtime memory rather than plaintext files.