Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sensitive content exclusion not honored (option?) #301

Open
nimaai opened this issue May 3, 2024 · 10 comments
Open

sensitive content exclusion not honored (option?) #301

nimaai opened this issue May 3, 2024 · 10 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@nimaai
Copy link

nimaai commented May 3, 2024

We have setup content exclusion using pattern matching in the copilot subscription of our organisation for some repos as we have some sensitive files there. It seems that this plugin is not honoring that; if I select content from a sensitive file and do :CopilotChat then the content of such a file is being analysed.

As far as I understand, copilot plugins themselves need to do something on their part for this matter. I have tried with the official: https://github.com/github/copilot.vim. Code-completion does not work in an excluded file and there is a message:

Error: Your organization 'zhdk' has disabled Copilot for this file

https://docs.github.com/en/copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot

Am I perhaps some config option for this plugin?

@jellydn jellydn added the enhancement New feature or request label May 3, 2024
@jellydn
Copy link
Contributor

jellydn commented May 3, 2024

subscription of our organisation

Let's see if @gptlang or @deathbeam have tried this option. This is 1st time I heard about this setting.

Probably we need to have a option to exclude buffer by filename or repository.

@nimaai
Copy link
Author

nimaai commented May 3, 2024

may be of interest: zbirenbaum/copilot.lua#74

@gptlang
Copy link
Member

gptlang commented May 4, 2024

Excluding content from GitHub Copilot currently only affects code completion. GitHub Copilot Chat is not affected by these settings.

@gptlang
Copy link
Member

gptlang commented May 4, 2024

This feature is available for organization accounts with a Copilot Business subscription.

It's a bit difficult for me to test. Could you try to MITM the copilot completion connection and see if the exclusions are included in the API response?

@deathbeam
Copy link
Collaborator

After you configure content exclusion, the client (for example, the Copilot extension for VS Code) sends the current repository URL to the GitHub server so that the server can return the correct policy to the client. URLs sent to the server in this way are not logged anywhere.

It looks like we would need to do this step and then act on the content policy on client side I would guess? I noticed that vscode sends the call to github to get some repo info fairly often. Probs wouldnt be so hard if someone can check the response for this content policy in e.g vscode

@deathbeam
Copy link
Collaborator

deathbeam commented May 5, 2024

Found the url at least:

this.contentRestrictionsUrl=Cc.Utils.joinPath(s,"/copilot_internal/content_exclusion"

From https://raw.githubusercontent.com/github/copilot.vim/release/dist/agent.js

But setting up mitm proxy and checking would be way easier so we can see request/response. But i dont have business subscription either.

Also its pretty sad that we have to do this why is the api undocumented, not like they are gaining anything from it being undocumented.

@jellydn jellydn added the question Further information is requested label May 12, 2024
@nimaai
Copy link
Author

nimaai commented May 27, 2024

can someone give me exact steps to reproduce to get at the information you need? vscode, etc. because i have a copilot business subscription.

@gptlang
Copy link
Member

gptlang commented May 27, 2024

Just run mitmproxy and look for any requests to the URL: https://github.com/copilot_internal/content_exclusion (it might be a different domain depending on your enterprise configuration). We just need the general shape of the request/responses

@nimaai
Copy link
Author

nimaai commented May 27, 2024

i couldn't find anything using mitmproxy with vscode.

@gptlang
Copy link
Member

gptlang commented May 28, 2024

It could be that it's cached for existing repositories rather than fetching it every time. Could you try it with a new repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants