Skip to main content

GitHub Copilot

This article explains how to connect GitHub Copilot to Pensero, what Copilot usage data is imported, and how Pensero uses it to provide visibility into AI-assisted delivery across teams

Written by Wayne

Overview

The GitHub Copilot integration gives teams visibility into how AI is being used in day-to-day engineering work, without inspecting or storing any source code.

Pensero imports Copilot usage data from GitHub and aligns it with delivery activity to help teams understand adoption patterns, trends over time, and how AI fits into their workflows.

This signal is designed to support better conversations and decisions, not to audit individual contributions.

Pensero reads usage metadata only. It does not access or analyze your code.

Chart of AI usage

What Pensero Reads from Copilot

Pensero ingests Copilot-generated analytics only.

Specifically, Pensero retrieves:

  • Estimated AI-assisted lines

  • Total lines added

  • User identifiers

  • Timestamps for AI usage events

No source code, prompts, or generated content are accessed or stored.

Pensero aligns this data with Git contribution activity to provide consistent and contextual insights.

How Pensero Calculates AI Usage (%)

Pensero measures AI adoption using a directional proxy, not an exact attribution of code authorship.

AI % = Accepted AI-suggested lines ÷ Total committed lines

Important clarifications:

  • Accepted AI-suggested lines are used as a proxy because it’s not possible to know which suggestions ultimately ship in a PR.

  • This metric is designed to track adoption trends and relative usage, not to evaluate individuals or review code quality.

  • AI usage is best interpreted alongside delivery and quality signals.

How to Set Up the GitHub Copilot Integration (Step-by-Step)

Prerequisites

You’ll need:

  • Pensero Admin access

  • A GitHub organization with Copilot licenses

  • Owner permissions in the GitHub organization

Step 1 – Go to Integrations

Open Integrations from the left sidebar and select GitHub Copilot.

Step 2 – Authenticate via GitHub OAuth

Click Connect GitHub Copilot and authenticate with your GitHub organization account.

When prompted, grant access to the Copilot Metrics API.

  • Copilot requires a separate OAuth flow and must be connected explicitly, even if GitHub is already integrated.

Important: GitHub Copilot requires a separate OAuth flow and may require higher permissions than the repository OAuth completed during onboarding.

If the integration needs access to organization-level Copilot data or usage metrics, additional organization-level permissions may be required. In some GitHub organizations, OAuth access to organization resources is restricted and must be approved by an organization owner.

How to check if you have the right permissions:

  • If you can access your organization’s or enterprise’s Copilot usage metrics in GitHub, you likely have the required level of access. If not, ask your GitHub Organization Owner, Enterprise Owner, Billing Manager, or an admin with the relevant Copilot metrics permission to complete the connection.

Step 3 – Confirm the Sync

Once authenticated, the integration shows Connection Active.

Pensero will begin syncing Copilot usage data automatically. Initial insights may take a few hours to appear.

Troubleshooting: Copilot Connection Error

If your GitHub Copilot integration is connected but data is not syncing correctly, you can review the integration health directly from Pensero.

Go to: Integrations → GitHub Copilot Settings

On this page, click Check connection.

This health check helps you understand whether there is a problem with the integration setup, such as:

  • Copilot policies not enabled

  • missing access to Copilot metrics endpoints

  • authentication issues with the connected GitHub account

Important permission requirement

In practice, this connection should be completed by a user with the highest GitHub organization authority available, because regular admin access is often not enough for Copilot endpoints. For Pensero, the safest recommendation is:

  • Use a GitHub Organization Owner for organization-level Copilot access.

  • If your company manages Copilot centrally, ask the Enterprise Owner to complete the connection.

Error - Copilot seats

If you encounter a 404 billing/seats error when connecting GitHub Copilot to Pensero, it is almost always due to missing permissions.

A 404 Not Found usually means one of these things:

  • GitHub Copilot Business or Copilot Enterprise is not enabled for that organization.

  • The request was made in the wrong GitHub context or with a token/app setup that cannot access this endpoint. GitHub documents that this endpoint is for organizations with Copilot Business or Copilot Enterprise, and that only organization owners can view assigned seats.

Error - Usage Metrics API

If you encounter a 422 Copilot Metrics API access disabled error when connecting GitHub Copilot to Pensero, it is almost always due to missing permissions.

  • Example error: “Your organization has disabled Copilot Metrics API access. Enable it in GitHub settings to access this endpoint.”

This means that Copilot usage metrics are disabled at the organization level or that the required permissions are missing.

How to fix it

  1. Confirm you have the right role

    • You must be an Owner in the GitHub organization.

    • Admin or Member roles are not enough to view Copilot usage metrics.

  2. Grant access during OAuth sign-in

    • Start the OAuth authentication flow.

    • When GitHub asks you to approve access:

      • Select your organization.

      • Make sure you explicitly GRANT permissions

  3. Enable Copilot Usage Metrics

    • Go to GitHub.

      • Look near your profile picture to confirm you are in organization settings, not personal settings.

        • If you are in personal settings:

          • Click the Switch settings context button.

          • Choose your organization.

    • Go to:

      • GitHub → Settings → Copilot → Policies

        • Find the setting for Copilot usage metrics.

        • Make sure it is Enabled

Did this answer your question?