Set up GitHub Copilot in VS Code

Use this guide to sign in to GitHub Copilot in Visual Studio Code and manage your account. If you already have Copilot access, sign in with that GitHub account.

To use another provider's account or your own API key, see other AI access options.

Before you start

Review these account, workspace, usage, and data-handling details before you send project content to an AI model:

  • Workspace Trust: trust your project folder when prompted. Restricted Mode blocks Copilot setup and prevents agents from running tools or editing files.
  • Account access: the recommended setup uses a GitHub account with a Copilot plan. If your employer provides Copilot, use the account and policies for your organization. Without a plan, signing in enrolls an eligible account in Copilot Free.
  • Usage and billing: models accessed through Copilot consume AI credits from your Copilot plan. Both Copilot Free and paid individual plans such as Copilot Pro, Copilot Pro+, and Copilot Max include a monthly AI credits allowance. Learn about AI credits and model costs.
  • Monitor usage: open the Copilot status dashboard from the VS Code Status Bar to view the percentage of your monthly allowance that you used. Keep Auto model selection active to balance quality and credit usage, or learn how to monitor usage and what happens when you reach a limit.
  • Data handling: review the GitHub Copilot Trust Center and your organization's policies before you send work code. VS Code telemetry settings are separate from AI-provider data handling.

Set up GitHub Copilot

Follow these steps to get started with Copilot in VS Code:

  1. Start sign-in using one of these entry points:

    • Select Sign In in the VS Code title bar.
    • Select the Accounts menu in the Activity Bar, and then select Sign in to use GitHub Copilot.
    • Select the Copilot icon in the Status Bar.
    • Alternatively, open the Chat view with Toggle Chat and select Sign In in the signed-out notification.
  2. If you have an untrusted project folder open and VS Code prompts you to trust the workspace, trust the folder so setup and agent tools can run.

  3. Choose a sign-in method in the dialog (GitHub, Google, Apple, or GHE.com) and follow the prompts in your browser.

    • If you already have a Copilot subscription for your account, VS Code uses that subscription.

    • If you don't have a Copilot subscription yet, you sign up for the Copilot Free plan and get a monthly allowance of inline suggestions and AI credits. Learn more about the different GitHub Copilot plans.

After signing in, confirm that the Copilot icon in the Status Bar shows your active status. If sign-in fails or your organization restricts access, review the AI troubleshooting guide or contact your organization administrator. If you arrived here from a quickstart or guide, return to it now, or pick a starting path from Next steps.

Important

When you sign up for Copilot Free, code suggestions that match public code (including code references in VS Code and on github.com) and product-improvement data use are enabled by default. You can change these preferences anytime in Copilot Settings. Separately, to opt out of VS Code and Microsoft extension telemetry, set telemetry.telemetryLevel Open in VS Code Open in VS Code Insiders to off.

Use Copilot with a GHE account

If your Copilot subscription is associated with a GitHub Enterprise (GHE) account, you can sign in to Copilot in VS Code with your GHE credentials.

  1. Start sign-in using any entry point from Set up GitHub Copilot, such as selecting Sign In in the title bar or Sign in to use GitHub Copilot from the Accounts menu.

  2. In the sign-in dialog, choose Continue with GHE.com, enter your GHE.com instance name or HTTPS URL, and sign in with your enterprise credentials.

If enterprise sign-in or authorization fails:

  • Verify your GHE.com instance URL and confirm that you are signed in to the account assigned a Copilot seat.
  • Confirm with your organization administrator that GitHub Copilot and editor policies are enabled for your enterprise account.
  • Review Using GitHub Copilot with an account on GHE.com and collect network diagnostics if you work behind a corporate proxy or firewall.

If you need to switch between a GitHub.com account and a GHE account, see Use a different GitHub account per workspace or profile for instructions.

Other AI access options

To use another provider's account, follow the Anthropic Claude setup or OpenAI Codex setup. To connect a model with your own API key, follow the bring your own key (BYOK) setup and run the BYOK verification checks after adding a model. These routes have their own requirements. Some agent workflows without GitHub sign-in are experimental.

Access through another provider's credentials follows that provider's usage, billing, and data-handling terms. Compare harness authentication and billing options.

BYOK can provide chat access without a Copilot plan, but it doesn't replace the GitHub Copilot service for inline suggestions, semantic search, or embeddings.

Note

Claude and Codex harnesses are disabled by default when Copilot enterprise-managed settings apply, even with separate provider credentials, unless your administrator explicitly permits them. Contact the IT team that deployed the settings to discuss access.

Use a different GitHub account with Copilot

If your Copilot subscription is associated with another GitHub account, sign out of your current GitHub account in VS Code and sign in with the other account.

  1. Select the Accounts menu in the Activity Bar, select your current GitHub account, and then select Sign Out.

    Screenshot showing the Accounts menu in VS Code with the Sign Out option for the current GitHub account.

  2. Sign in to your other GitHub account using any entry point from Set up GitHub Copilot:

    • Select Sign In in the title bar, or select the Copilot icon in the Status Bar.

      Screenshot showing the Sign In button highlighted in the VS Code title bar when signed out.

    • Select the Accounts menu in the Activity Bar, and then select Sign in to use GitHub Copilot.

    • Run the Chat: Use AI Features with Copilot for free command in the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)).

Use a different GitHub account per workspace or profile

You can use different GitHub accounts for Copilot per VS Code workspace or profile. This is useful if you use Copilot with different accounts for work and personal projects, or if you want to use different accounts for different extensions that use GitHub authentication.

Follow these steps to choose which account to use within your GitHub authentication provider. This configuration is saved per workspace and per profile.

  1. In the Accounts menu in the Activity Bar, select Manage Extension Account Preferences.
  2. Select GitHub Copilot from the list of extensions.
  3. Choose the GitHub account you want to use for Copilot in the current workspace and profile.
Note

Manage Extension Account Preferences switches accounts within a single authentication provider (GitHub.com or GHE.com). To use a GHE.com account, follow Continue with GHE.com first. Only if an existing GHE.com workspace does not detect your enterprise authentication provider, add "github.copilot.advanced": { "authProvider": "github-enterprise" } to your user or workspace settings.json file and sign in again.

Remove AI features from VS Code

You can disable the built-in AI features in VS Code with the chat.disableAIFeatures Open in VS Code Open in VS Code Insiders setting, similar to how you configure other features in VS Code.

This setting disables and hides features like chat and inline suggestions in VS Code and disables the Copilot extension. You can configure it at the user or workspace level in the Settings editor (⌘, (Windows, Linux Ctrl+,)) or in settings.json.

Next steps