A thread titled “Has your auditor started asking about AI coding tools yet?” has been sitting on r/soc2 since August. I am not going to guess at what any particular auditor asks. What I can describe, from running a NIST-aligned security program, is what any sampling auditor does with a change: pick one, then ask who made it, who reviewed it, and what checked it.

For human-written code those answers live in the commit author and the pull request. For AI-assisted code the first answer gets fuzzy, and most teams respond with a policy document. A policy tells the auditor what you intended. It cannot tell them what happened to one specific commit.

Where attribution usually lives

There are four places a team can record that an AI tool took part in a change. They are not equally useful once someone samples a commit.

Where the record livesWho holds itTravels with the changeAuditor can query it
Policy documentYouNo, it states intent onlyNo
Pull request checkboxYour git hostTied to the PR, so a direct push has noneOne PR at a time
Vendor telemetryThe tool vendorNoOnly through the vendor
Commit trailerThe repositoryYes, through clone and rebaseYes, one git command

Squash merges are the catch. Depending on how your host builds the squash message, the trailers of the commits folded into it can be dropped. Check that setting before you trust any count.

The control: a trailer on the commit

A trailer is a key: value line at the end of a commit message. Signed-off-by is the familiar one. Git understands the format natively, and git interpret-trailers will add or parse them for you. Two lines carry most of the value:

Fix pricing table rounding

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_<id>

The first names the model, which answers “who wrote it.” The second points at the session transcript, which is the part most teams skip and the part I value most. It is the record of what was asked and what came back, so the decision trail lives next to the change instead of in someone's memory. I argued in the shadow AI piece that the trail thins out exactly where AI involvement is heaviest. This is the smallest repair I know.

What my own log says

The ModelBrain marketing site is a git repository where an AI model writes most commits. The tooling appends both trailers itself, so nobody has to remember. One command answers the sampling question:

git log --format='%(trailers:key=Co-Authored-By,valueonly)' | sort | uniq -c

Of 175 commits, 124 name a model: Claude Sonnet 5.5 on 71, Claude Sonnet 5 on 27, Claude Opus 5.5 on 21 and Claude Fable 5.1 on 5. They point at 26 distinct sessions. Two things follow. A person can draw a sample from that log in under a minute. And the model changed over six weeks, which the log shows without anyone having written it down.

The other 51 commits name no model. Some were mine, some predate the habit, and the log cannot tell me which. That is the first honest limit of the control.

What a trailer does not prove

It is self-reported. Anyone can type one or delete one, so treat it as an assertion backed by review, not as a signature. If you need to prove who authored a commit, signed commits are a separate control that sits beside this one.

It works at the commit level, not the line level. It says an AI tool took part, not which lines it wrote.

And no standard hands you the rule. NIST SP 800-218A, the AI profile of the secure software development framework, is written for producers and acquirers of AI systems, so a commit-level attribution rule for a team using coding assistants is yours to define and then demonstrate.

Three steps for this week

First, choose the trailer keys and write them into the contribution guide, so the format is a decision and not a habit. Second, make the tool append them. A rule people must remember will fail within a month, and a rule the tool applies will not. Third, add a monthly check: run the count, sample five commits, open the linked session or pull request, and confirm that a human review exists. Drop the result in your evidence folder.

None of this needs a new product. It needs a decision about where the record lives, and the repository is the one place that every change has to pass through.

Frequently asked questions

What should a commit trailer for AI-assisted code contain?

Two lines. Co-Authored-By names the model, which answers who wrote the change. A session link points at the transcript of what was asked and returned. Have the tool append both so nobody has to remember them.

How do I count which AI models wrote my commits?

Run git log with the trailers format and pipe it through sort and uniq -c. It lists every model named in your history with a count, and commits with no trailer show up as blank lines, which tells you your real coverage.

Can an AI commit trailer be trusted as proof?

Not by itself. It is self-reported, so anyone can add or remove one. Treat it as an assertion backed by human review. If you need proof of authorship, signed commits are a separate control that sits beside it.

Do squash merges remove commit trailers?

They can. Depending on how your git host builds the squash message, trailers from the commits folded into it may be dropped. Check that setting before you trust any count drawn from merged history.