Skip to main content

GitHub Copilot

Tasks

Route GitHub Copilot completions and chat through AIControls using the AIControls VS Code extension. Setup takes under two minutes — no GitHub organization settings or config files to edit.

Prerequisites​

  • VS Code installed
  • GitHub Copilot active on your GitHub account (Individual, Business, or Enterprise)
  • A GitHub account already signed in to VS Code

Setup​

  1. Install the AIControls VS Code extension. Install from the VS Code Marketplace or from downloads.nirmata.io. The extension adds an AIControls item to the VS Code status bar. The panel's portal button opens the portal address your gateway reports (its ui.publicURL plus /ui/), so a self-hosted deployment that serves the portal from a separate host or port needs no extension setting. If the gateway reports none, the button falls back to your proxy URL plus /ui/ (a local proxy on the default port 8890 opens the local admin port 8891 instead). Set aicontrols.portalUrl in VS Code settings to override both.

  2. Open the AIControls panel. Click the AIControls item in the VS Code status bar (bottom bar). The panel opens and checks whether a GitHub account is already signed in to VS Code.

  3. Connect with your GitHub account. If a GitHub session is detected, click "Connect with GitHub account: <your-username>". The extension silently exchanges your VS Code GitHub session for an AIControls personal access token — no copy-pasting required.

    No GitHub session in VS Code? Sign in to GitHub first via Accounts → Sign in with GitHub, then return to this step. Alternatively, paste a personal access token from Settings → Access Tokens directly into the AIControls panel.

  4. Done. All GitHub Copilot Chat and inline completions now route through AIControls. Policies, audit logging, spend tracking, and HITL approvals apply automatically.

What gets governed​

  • Inline code completions in VS Code
  • Copilot Chat messages and responses
  • Copilot edits and multi-file changes
note

Governance applies to Copilot traffic routed through the VS Code extension. Copilot usage in other IDEs (JetBrains, Neovim, etc.) or via gh copilot in the CLI is not covered by this extension.

When Copilot's model metadata marks a model as served only through its Responses or Messages endpoints, or as not a chat model, it is not offered on the governed path. Models whose metadata is missing or unrecognized are still offered.

Sub-agents​

When a Copilot client sends X-Interaction-Type: conversation-subagent, its requests and tool calls are tagged Copilot subagent on the session's Activity tab. Copilot doesn't say which sub-agent made a request or which call started it, so they aren't grouped under the launching call, and several sub-agents share the one tag. See Subagent attribution.

Verify the connection​

Use Copilot Chat or trigger an inline completion in VS Code. Check your workspace Security Events — the request should appear with your GitHub identity within seconds.

Troubleshooting​

No GitHub session detected​

Sign in to GitHub in VS Code via Accounts → Sign in with GitHub, then reopen the AIControls panel and connect again.

Copilot completions not appearing in Security Events​

  • Confirm the AIControls panel shows your account as connected (not "disconnected" or "token expired")
  • Restart VS Code after installing the extension if the status bar item is missing
  • Regenerate your access token in Settings → Access Tokens and reconnect in the panel

Copilot stops working after connecting​

If Copilot becomes unresponsive after connecting AIControls, a policy may be blocking requests. Check Security Events → Denied for your identity and contact your administrator.