Content exclusion helps, but it is not a vault. GitHub documents that excluded files get no inline suggestions and do not inform other suggestions, chat answers or code review. It also lists limits: edit and agent modes in VS Code are not covered, symbolic links and remote filesystems are not supported, and the IDE may still pass semantic information.
Definitions
Content exclusion. A setting that tells an AI assistant to ignore specified files or paths.
Semantic information. Details an editor can supply about code, such as type information, hover definitions or build configuration.
What is covered, from the documentation
| Surface | Support |
|---|---|
| Inline suggestions | Visual Studio, VS Code, JetBrains IDEs, Vim and Neovim, Xcode, Eclipse |
| Chat and agent | Visual Studio, JetBrains IDEs, the GitHub website, GitHub Mobile, the Copilot app and Copilot CLI |
| VS Code chat | Supported, but edit and agent modes are not |
| Xcode and Eclipse chat | Not supported |
| Code review | Excluded files skipped on the GitHub website |
On the GitHub website and GitHub Mobile, the feature was documented as a public preview that may change. Check the current page.
Limits you should plan around
- Agent and edit modes in some editors are not covered, so an agent working in the terminal or editor may still read the file.
- Metadata can leak structure. Type and build information may reach the assistant even for an excluded file.
- Symlinks and remote filesystems fall outside the feature.
- It is policy at the tool level, not an access control on the file.
A layered approach
- Keep secrets out of the repository. Use a secrets manager and environment injection. A file that does not exist cannot be read.
- Turn on push protection so credentials cannot be committed. GitHub documents that it blocks pushes containing detected secrets.
- Use content exclusion for sensitive code such as proprietary algorithms or configuration, accepting the gaps.
- Add agent-level deny rules in tools that support them, for key files and environment files.
- Run agents in a sandbox or container with only the files they need mounted.
- Audit access. Review logs for what the assistant read where logging exists.
Quick check
Does excluding a file stop it being sent anywhere?
It stops the file's content informing suggestions and chat responses for the covered surfaces. It does not cover every mode or every editor, and the documentation notes metadata may still be used.
Should I rely on it for credentials?
No. Keep credentials out of the working tree entirely.
How do I know which setting applies to my editor?
Read the support table on the vendor page for your editor and mode. It changes over time.
Where Safeguard fits
Safeguard offers compliance and evidence automation and scans repositories for risky dependencies. You can start with a free scan at gold.safeguard.sh/scan.
Sources
Last reviewed: 19 October 2026.