Option for disabling Copilot in specific files #11254
Replies: 25 comments 35 replies
-
Open, or create, a file with the extension you don’t want copilot to offer completions on. Click the copilot icon, choose disable |
Beta Was this translation helpful? Give feedback.
-
Thanks, Dave - I know this feature, but unfortunately, it allows just global or language (extension) based disabling. I'd like to avoid so broad disabling. E.g.: I could have a |
Beta Was this translation helpful? Give feedback.
-
How do I disable it for my .env files? |
Beta Was this translation helpful? Give feedback.
-
I think there will be a quick option that disables/enables the copilot for the current file or current workspace |
Beta Was this translation helpful? Give feedback.
-
I'd really like to be able to disable Copilot for a given path wildcard that I specify. It is totally broken to the point of being unusable for styled-component tag functions in a .ts file. We name those files with a |
Beta Was this translation helpful? Give feedback.
-
It would be really nice if there were commands like eslint e.g. |
Beta Was this translation helpful? Give feedback.
-
👍🏻 for the feature, sometimes I just want to play with code without any suggestions from Copilot, but don't want to actually disable it per language. |
Beta Was this translation helpful? Give feedback.
-
This is becoming more of a security concern for various companies. I think it would be prudent to support extension settings to add file globs that should be ignored that we can check into our repos settings.json to prevent any information from being sent to github servers such as |
Beta Was this translation helpful? Give feedback.
-
A way to exclude certain files would be very needed. Preferably with an option to do that in a centralized manner. |
Beta Was this translation helpful? Give feedback.
This comment was marked as spam.
This comment was marked as spam.
-
This is kind of necessary feature per project to look at an ignore file.
You might want to ignore it in some files but use it in same file type elsewhere in same project e.g. populating test data in json files but for whatever reason using json file that might also have secrets you don't want to upload to internet. |
Beta Was this translation helpful? Give feedback.
-
I would like to have the option to disable it in "Untitled files" like it was reported here https://github.com/orgs/community/discussions/67236 Sometimes I need to check sensitive snippets, and I paste them in an editor. I can't use IDEs with Copilot because it can't be disabled. It's an overhead for me to be careful with what type of content I have on the clipboard and choose the text editor based on that. |
Beta Was this translation helpful? Give feedback.
-
Related on Stack Overflow: How to Exclude Specific Files (like .env) from GitHub Copilot in VS Code? |
Beta Was this translation helpful? Give feedback.
-
cant it just inherent from something like .gitignore |
Beta Was this translation helpful? Give feedback.
-
Take a look at this. The dev just came out with it recently and it works great! Simply install the extension and create https://github.com/orgs/community/discussions/10305#discussioncomment-8226775 https://github.com/mattickx/copilotignore-vscode |
Beta Was this translation helpful? Give feedback.
-
If you all are using VSCode, you may want to look into the Profile feature. Your VSCode account and GitHub authorizations don't change, but it's as if you're using a different account so you can modify your settings and extensions to for specialized projects/uses. For example, from the original post, it looks like she may have a job handling security sensitive files. So she could create a "Work" profile to only include the necessary extension; she can choose to not install Copilot or any other extensions that may cause a problem/violation in her work. You can access your profiles from the File menu > Preferences. It switches over pretty fast and it's definitely faster than if you are repeatedly changing the same settings and extension access. Here's the link to the VSCode documentation. Hope this helps you all out :) |
Beta Was this translation helpful? Give feedback.
-
Seems like this is now available in Copilot Business |
Beta Was this translation helpful? Give feedback.
-
Good afternoon, I suggest using the name Link to |
Beta Was this translation helpful? Give feedback.
-
My API key leaked, long story short, full system is in a very controllable and closed environment no public repos, .env added to .gitignore, my only thought it leaked via Copilot as a suggestion to someone else in their IDE. Disabled it completely. Very very uncool that as an individual I can't disable certain files from copilot access. |
Beta Was this translation helpful? Give feedback.
-
This fixed it for me |
Beta Was this translation helpful? Give feedback.
-
That Copilot gives individual users no way to avoid sending DB credentials, API keys, and other sensitive data to their all-seeing AI models, just by opening their IDE, is abusive and borderline criminal. Let us exclude a file or two! |
Beta Was this translation helpful? Give feedback.
-
Cursor had a similar request. It seems to have just been achieved with v0.46.x via |
Beta Was this translation helpful? Give feedback.
-
wow, I can't believe this is locked behind business/enterprise plans. no one should leak secrets and api keys, free, pro, and everyone else!!! |
Beta Was this translation helpful? Give feedback.
-
Dammit. Was shocked to see my ENV data in Copilot replies recently. Guys, seriously, this is HUGE HOLE in security. API key, secrets - EVERYTHING is just leaking back and forth to goddamn FOUR EXTERNAL llm-models. Seriously? I've never added .env to git. I've put in to .gitignore, I've added it to .copilotingore, I've done ALL that is possible, but still - silicon brain watches me. User MUST have a possibility to RULE what ai is allowed to see and what is not. Otherwise it's just like walking the street without pants. |
Beta Was this translation helpful? Give feedback.
-
ok, so here is quick workaround/solution for my node.js project: TL:DR: I've moved .env out of scope of project directory. was: /Home/User/My-project/.env AND added So, before deploying to test/prod server now I shall now NOT TO FORGET remove that path to custom .my-node-project-env file again, but at least now Copilot is not reading my secrets and other sensitive data. Seems like Copilot (at least for now) is limited by scope of your project files, which can be used to keep your sensitive data safe. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I'm seeking an option to disable the Copilot in specific files. I want to avoid disabling it for a whole language, just disable in e.g. some JSON-based configuration files (where credentials may occur, and so I don't want Copilot to scan those files).
I cannot find anything like this in configuration. Any chances to get it in the future?
Beta Was this translation helpful? Give feedback.
All reactions