On this page
To track AI-generated code across repos, match the tool to the question: GitHub Copilot's metrics show how much people use the assistant, SonarQube's AI Code Assurance marks which projects contain AI code and gates them, Git AI records agent sessions line by line, and repowise labels each commit from markers already in your git history. Governance teams usually combine a usage view, a code-quality gate and a provenance record.
| Approach | Question it answers | Granularity | Covers history before install | Source |
|---|---|---|---|---|
| GitHub Copilot usage metrics | How much is Copilot used? | User, repo, org, enterprise; lines suggested, added, deleted | Dashboard shows 28 days | GitHub docs |
| SonarQube Server AI Code Assurance | Which projects contain AI code, and do they pass a stricter gate? | Project | Not applicable | Sonar docs |
| Commit trailers | Did an agent or tool contribute to this commit? | Commit | Yes, if written then | Git, agent defaults |
| Session recorders (Git AI) | Which lines did an agent write? | Line | No | Git AI |
| repowise attribution | Which commits did an agent write, and how complete is our coverage? | Commit | Yes, from markers in history | Local git |
Scroll the table sideways to see every column.
Facts about other tools are from each vendor's own pages, read in November 2026; sources are linked in each section.
We build repowise, so weigh our entry accordingly. The measurements we publish about it, with their methods, are on the benchmarks page.
How we evaluated
We compared approaches on what an auditor can rely on:
- What it records. Usage, labels on projects, commits or lines.
- How it knows. Telemetry, a manual setting, or evidence in the repository.
- How honest the gaps are. Whether it says what it cannot see.
- Where the data lives. In a vendor dashboard or in your own repository.
What AI code governance needs to show
AI code governance means being able to answer three questions with evidence: where agents write code, how that code is checked, and what policy a change must pass. The first is provenance. The second is review and quality gates. The third is policy in CI. Most products cover one. For how provenance methods differ in depth, read AI code provenance: how to tell which code agents wrote.
One caution: a governance record should describe code, not rank people. A tool that totals how many "AI lines" each engineer wrote invites the wrong conversation, and the data behind it is usually too thin to support one.
GitHub Copilot usage metrics
GitHub Copilot's metrics measure Copilot activity, not the code that ended up in your repositories. The dashboards cover 28-day usage trends, a code generation breakdown for users and agents, and an impact view linking adoption to pull request output. The REST API serves enterprise, organization, repository and user levels, with an NDJSON export. Lines metrics count what Copilot suggested, added or deleted in the editor and come mainly from IDE telemetry, so they depend on users having telemetry on. Copilot Chat on GitHub.com and GitHub Mobile are excluded (GitHub docs, November 2026).
Pick it if you pay for Copilot and want adoption numbers for budget conversations. It does not tell you which commits in a repo came from an agent, and it only sees Copilot.
SonarQube Server: AI Code Assurance
SonarQube Server's AI Code Assurance labels a project as containing AI-generated code and applies a stricter quality gate to it. You turn on "Contains AI-generated code" under Project settings, AI-generated code, which adds a $contains-ai-code label, then apply a quality gate qualified for AI code; Sonar recommends "Sonar way for agentic AI" for agent-centric development. Projects with the label and a qualified gate can publish a badge (Sonar docs, November 2026). We did not confirm which editions include each part, so check that with Sonar.
The label is a human setting on a whole project, so it does not say which commits or files an agent touched. What it adds is enforcement: AI-marked projects must pass the stricter gate before merge.
Pick it if you already run SonarQube and need a visible rule that AI-assisted projects meet a higher bar.
Commit trailers and Git AI
A commit trailer is the cheapest provenance record, and a session recorder is the most precise. Claude Code adds Co-Authored-By by default, the Linux kernel asks for Assisted-by for AI-assisted patches, and tools like Git AI record agent edits per line as git notes. The strengths and gaps of each, including what a squash merge does to trailers, are compared in the provenance guide.
Pick trailers if you want a free convention. Pick a recorder if you need line-level answers going forward and can install it for every agent your team uses.
repowise: provenance from your own history
repowise labels every commit agent, human_attested or unknown from evidence the repository already carries. Indexing reads these markers from local git history, with no network call and no model:
- bot authors or committers such as
copilot-swe-agent[bot]anddevin-ai-integration[bot]; - message footers such as
Generated with Claude Code; - trailers:
Co-authored-by:naming an agent service identity,Assisted-by:,Generated-by:; - git-ai notes on
refs/notes/ai; - Agent Trace records in
.agent-trace/traces.jsonl.
Patterns are anchored to service identities, so a contributor named Devin stays unlabelled. A commit is human_attested only when an explicit human record exists, and unknown is never counted as human.
For agents you choose, opt-in edit capture records line hashes, repo-relative paths, an opaque session id, the tool and the model in .repowise/attribution/events.jsonl, never prompts or code. Capture works for Claude Code and Codex CLI through PostToolUse hooks and for Cursor through an afterFileEdit hook. repowise attribution backfill --agent claude-code,codex binds past commits from local transcripts under the same consent.
Every share prints beside its coverage, for example "at least 40% of covered commits, coverage 62%", and below 30% coverage the share is withheld and only the count shown. The record is per commit and per file, and repowise keeps it that way by design. Check it from the CLI with repowise attribution status. Results also surface on the Commits page, in the REST API as authorship=agent|human|unknown, and on get_context file cards over MCP.
Change policy in CI runs through repowise check, a local change policy with SARIF or JUnit output, and the hosted product adds an audit trail with export. Details are on the agent provenance page, with a policy starting point in the AI governance resources.
Pick repowise if you want provenance across repos from the history you already have, with coverage stated.
How to choose
- Budget and adoption reporting for Copilot: GitHub's usage metrics.
- A visible quality bar for AI-assisted projects: SonarQube Server AI Code Assurance.
- A cheap convention to start: trailers, enforced in review.
- Line-level proof going forward: a session recorder such as Git AI.
- Which commits an agent wrote across many repos, including old ones: repowise attribution, then add capture for the agents you run.
- Regulated enterprise: keep provenance (repowise or a recorder), a quality gate (Sonar) and policy in CI as separate controls, so an auditor can inspect each.
FAQ
- How do I track AI-generated code across repositories?
- Combine a provenance record with a quality gate. Read agent markers from git history for every repo (repowise does this), add edit capture for agents you run, and gate AI-assisted projects in CI.
- Can I tell which commits an AI agent wrote?
- Yes. Bot authors, trailers, footers, git-ai notes and Agent Trace records identify them, and repowise labels each commit
agent,human_attestedorunknownwith its coverage stated and never counts unknown commits as human. - What is Sonar AI Code Assurance?
- It is a SonarQube Server feature that labels a project as containing AI-generated code and applies a quality gate qualified for AI code. The label is set per project, not detected per commit.
- Does GitHub Copilot show which code in my repo is AI-generated?
- Its metrics report lines Copilot suggested, added or deleted in the editor, mainly from IDE telemetry. They describe Copilot usage, not what is in each repository.
- How does repowise report the share of agent-written code?
- Attribution is recorded per commit and per file, and every share prints beside its coverage, for example "at least 40% of covered commits, coverage 62%".
- Which agents does repowise capture edits from?
- Claude Code and Codex CLI through hooks, and Cursor through an
afterFileEdithook. Other agents are read through public markers in git.

