How to Audit GitHub Copilot Usage in an Enterprise Account
🔍 WiseChecker

How to Audit GitHub Copilot Usage in an Enterprise Account

Enterprise administrators need to monitor how teams use GitHub Copilot to manage costs, ensure compliance, and measure return on investment. Without a proper audit, it is impossible to know which users are active, which features they rely on, or whether Copilot is being used for approved codebases. GitHub provides built-in reporting tools in the enterprise account settings and the GitHub API to pull detailed usage data. This article explains how to access the Copilot usage dashboard, export activity logs, and filter by organization or team.

Key Takeaways: How to Audit GitHub Copilot Usage

  • Enterprise account > Settings > Copilot > Usage: Shows active users, suggestions accepted, and lines of code per organization.
  • GitHub API endpoint GET /enterprises/{enterprise}/copilot/usage: Returns raw usage data for scripting and custom dashboards.
  • Copilot seat assignment report in Organization Settings: Lists assigned users, last activity date, and seat status for license management.

GitHub Copilot Audit Data Available in Enterprise Accounts

GitHub Copilot usage data is stored at the enterprise level when Copilot is enabled for the entire enterprise. The data includes the number of active users per day, total suggestions shown, suggestions accepted, and lines of code accepted. This information is aggregated by organization and by user. Audit data is retained for 90 days for Copilot Business and 365 days for Copilot Enterprise. You can access this data through the GitHub web interface or the REST API. Prerequisites include enterprise owner permissions or a role with the “view Copilot usage” permission. If you use Copilot Enterprise, you can also retrieve code-completion context data to see which files and repositories Copilot references.

Steps to View the Copilot Usage Dashboard in the Enterprise Account

The usage dashboard provides a high-level overview of Copilot activity across all organizations in your enterprise. Use this method for quick checks and monthly reports.

  1. Sign in to GitHub and navigate to your enterprise account
    Open github.com and click your profile photo in the top-right corner. Select “Your enterprises” from the dropdown. Click the enterprise account name you want to audit.
  2. Open the Copilot settings page
    In the left sidebar, click “Settings.” Then under the “Policies” section, click “Copilot.” This opens the Copilot configuration page for the enterprise.
  3. Click the Usage tab
    On the Copilot page, you will see two tabs: “Policies” and “Usage.” Click “Usage.” The page displays a date range picker, a breakdown by organization, and a summary card showing total active users, suggestions accepted, and acceptance rate for the selected period.
  4. Select a date range and filter by organization
    Use the date range picker to choose the last 7 days, 30 days, or a custom range. Below the summary card, a table lists each organization with its own active users, suggestions accepted, and lines of code accepted. Click an organization name to drill into per-user data.
  5. Export the data
    Click the “Export CSV” button at the top-right of the usage table. The file contains rows for each organization and date. Open the CSV in Excel or Google Sheets for further analysis.

Steps to Retrieve Copilot Usage Data via the GitHub API

Use the API to automate audits, build custom dashboards, or integrate with SIEM tools. The API returns JSON data that includes per-user and per-organization metrics.

  1. Generate a personal access token with the correct scope
    Go to GitHub Settings > Developer settings > Personal access tokens > Fine-grained tokens. Create a token with “Read access to Copilot usage data” for the enterprise. Alternatively, use a token with the copilot scope for REST API v3.
  2. Send a GET request to the enterprise usage endpoint
    Use the following endpoint: GET https://api.github.com/enterprises/{enterprise}/copilot/usage. Replace {enterprise} with your enterprise slug. Add query parameters since and until in ISO 8601 format (for example, ?since=2024-01-01&until=2024-01-31).
  3. Parse the response
    The response contains an array of objects. Each object includes day, total_suggestions_count, total_acceptances_count, total_lines_accepted, and breakdown which lists per-organization and per-user metrics. Save the JSON output to a file or pipe it into a script.
  4. Filter by organization using the org-level endpoint
    To get data for a single organization, use: GET https://api.github.com/orgs/{org}/copilot/usage. This is useful when you only need data for one team or business unit.
  5. Schedule the API call with a cron job or GitHub Actions
    Create a GitHub Actions workflow that runs weekly and calls the API. Store the token as a repository secret. Append the results to a log file or send them to a monitoring service.

If the Usage Dashboard Shows Incomplete Data

Incomplete data usually stems from incorrect permissions or a misconfigured Copilot subscription. Verify the following points before escalating.

Copilot Business or Enterprise is not enabled for the entire enterprise

If Copilot is only enabled for specific organizations, the enterprise-level dashboard will only show data for those organizations. Go to the Policies tab and ensure “Allow Copilot” is set to “Enabled” for the enterprise. Then confirm that each organization has at least one seat assigned.

Token lacks enterprise-level read access

Personal access tokens must have the read:enterprise scope and the copilot scope. If you use a fine-grained token, you must select “All repositories” or explicitly list the enterprise. Regenerate the token if the API returns a 403 or 404 error.

Data retention window has expired

Copilot Business retains usage data for 90 days. Copilot Enterprise retains data for 365 days. If you need data older than the retention period, it is no longer available through the UI or API. To preserve historical data, export CSV reports monthly and store them in a secure location.

Copilot Business vs Copilot Enterprise: Audit Capabilities Compared

Item Copilot Business Copilot Enterprise
Data retention period 90 days 365 days
Per-user activity log Yes, via API and UI Yes, via API and UI
Code-completion context Not available Available in API response
Organization-level breakdown Yes Yes
CSV export from UI Yes Yes

Common Issues When Auditing Copilot Usage

Even with correct setup, you may encounter specific problems. Each issue below has a direct fix.

Copilot Usage tab is missing from the enterprise settings

This occurs when your account does not have enterprise owner permissions. Ask your enterprise owner to grant you the “View Copilot usage” role. Alternatively, request read access to the enterprise via the Members > Roles page.

API returns a 404 error for the usage endpoint

The enterprise slug is case-sensitive. Verify the slug by checking the URL when you are on the enterprise dashboard. The slug is the part after https://github.com/enterprises/. Also confirm that the token has the copilot scope and is not expired.

CSV export shows zero active users

Zero active users usually means the date range does not include any workdays or that Copilot suggestions are blocked by a policy. Check the Policies tab to ensure “Suggestions matching public code” is not set to “Blocked” for all users. Also verify that users have actually opened files and typed code during the selected period.

Conclusion

You can now audit GitHub Copilot usage in your enterprise account using the built-in dashboard and the REST API. Start by reviewing the Usage tab under Settings > Copilot to get a quick overview of active users and acceptance rates. For recurring audits, schedule API calls with a GitHub Actions workflow and export CSV reports monthly to preserve data beyond the retention window. If you need deeper insights into which repositories Copilot references, consider upgrading to Copilot Enterprise to access code-completion context data.