> For the complete documentation index, see [llms.txt](https://kerno.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kerno.gitbook.io/docs/kerno-audit/kerno-audit.md).

# Kerno Audit

See what changed in your codebase once your team started using AI coding agents, and where it needs attention.

Kerno Audit shows what changed in your codebase once your team started using AI coding agents. It compares the months before and after, and names the functions, files and commits behind every finding.

Run `kerno audit` in a repository, then read the results on the **Audit** page in the Kerno portal.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><i class="fa-terminal" style="color:$info;">:terminal:</i> <strong>Run an audit</strong></td><td>One command, a few questions, and a link to your results.</td><td><a href="/docs/kerno-audit/run-an-audit.md">Run an audit</a></td></tr><tr><td><i class="fa-chart-mixed" style="color:$info;">:chart-mixed:</i> <strong>Read the results</strong></td><td>What each number means, and what to do about it.</td><td><a href="/docs/kerno-audit/read-the-results.md">Read the results</a></td></tr><tr><td><i class="fa-shield-check" style="color:$info;">:shield-check:</i> <strong>Data and privacy</strong></td><td>What stays on your machine, and what you choose to send.</td><td><a href="/docs/kerno-audit/data-and-privacy.md">Data and privacy</a></td></tr></tbody></table>

### What it answers

* **Duplication.** Are agents rewriting functions the codebase already has?
* **Complexity.** Is the code getting harder to change safely?
* **Rework.** How often does the team rewrite code it just shipped, and how much of that is fixing it?
* **Tests.** Do tests arrive with changes, and which API routes have one?
* **Delivery.** How big are pull requests, how fast do they merge, and who reviews them?

Each repository also gets a **Quality score** from 0 to 100, measured against its own past.

### Why you can trust the numbers

* **Every comparison is a rate.** Changes are counted per line, per commit or as a share, so a busier month doesn't look worse.
* **Old trends stay out of the headline.** The audit projects each metric's earlier trend forward and reports only the change that trend doesn't explain. A swing that rests on a handful of commits stays out too.
* **AI attribution is a floor.** The audit dates adoption from the traces agents leave in commits, such as `Co-authored-by` trailers. A commit without a trace counts as **Unknown**, so the AI share is the least agents could have done. You can set the adoption month yourself.
* **A model answers only what counting can't.** Questions such as "do these two functions do the same job?" go to a model one pair at a time. Switch it off, and those measures read **unjudged**.
* **Defects stay out of scope.** The audit reads no bug tracker or incident log, so it makes no claim about bug rates.

### Next step

To catch behaviour changes in the code your agents write, as they write it, set up Kerno's tests. See [Quickstart](/docs/getting-started/quickstart.md).
