Code Provenance for AI-Generated Commits
Most coding agents commit under a human's name, which quietly breaks attribution, blame and audit - here is how to record where code actually came from.
The Commit Says a Human Wrote It
Agents inherit the identity of whoever started them, and the history records a lie
A coding agent runs inside a checkout that already has a git configuration. It reads user.name and user.email from that configuration, exactly as any other process would, and stamps them onto every commit it makes. Nothing in git objects to this. The result is a history in which an agent's work is indistinguishable from a person's, signed with a person's name, and attributed to a person by every tool that reads the log.
That is not a cosmetic problem. git blame is how most teams answer "who understands this code" a year later, and the answer is now wrong. Incident review asks who introduced a regression and gets a name that never read the diff. Contribution metrics inflate. Compliance evidence that rests on "every change is attributable to a named individual" is technically satisfied and substantively hollow. And when the volume of generated code grows, the damage compounds silently, because nothing errors - the history simply becomes less true, one commit at a time.
Provenance is the fix, and it is narrower than it sounds. Provenance does not mean proving the code is good. It means being able to answer three questions about any line in the repository: what produced it, who accepted it, and what evidence exists for both. Everything below is in service of those three questions.
Blame Goes Stale
The person the log names as author may never have read the change, so the usual "ask the author" path leads nowhere
Audit Trails Look Fine
Every control that checks for a named human author still passes, which is exactly why the gap goes unnoticed for so long
Ownership Gets Murky
Copyright analysis turns on which expressive choices a human made, and an undifferentiated history cannot answer that later
Why Ownership Depends on Knowing Who Wrote What
The copyright position is settled enough to plan around, and it points straight at record-keeping
Not Legal Advice
This page is general information about how provenance practices relate to publicly available legal materials. It is not legal advice. If your organization has real exposure - a licensing dispute, a customer warranty, an acquisition diligence question - talk to counsel who can look at your actual facts.
In Thaler v. Perlmutter, No. 23-5233, decided March 18, 2025 and reported at 130 F.4th 1039, the US Court of Appeals for the DC Circuit affirmed the district court and the Copyright Office: a work generated autonomously by a machine, with no human author, is not copyrightable. Thaler's alternative argument - that he authored the work by building and operating the machine - was held waived, so the court did not reach it. You can read the opinion in the Copyright Office's posted copy (2025).
The Office set out the assisted case in Copyright and Artificial Intelligence, Part 2: Copyrightability, published January 29, 2025. Its own summary is that "outputs of generative AI can be protected by copyright only where a human author has determined sufficient expressive elements", that "the use of AI to assist in the process of creation or the inclusion of AI-generated material in a larger human-generated work does not bar copyrightability", and that protection does not extend to "the mere provision of prompts". Register Perlmutter put the reasoning plainly: "Extending protection to material whose expressive elements are determined by a machine... would undermine rather than further the constitutional goals of copyright."
Read those together and the practical consequence is the interesting one. AI-assisted work is protected as to the human-authored portions, not as an undifferentiated whole. A repository containing a large volume of generated code therefore has a protectable boundary that genuinely nobody can draw - not because the law is unclear, but because no one recorded which lines are which at the moment it would have been cheap to do so. Provenance metadata is the only mechanism by which that question is ever answerable after the fact.
Open Source Is Not Public Domain
A permissive license still has conditions, and generated snippets arrive with them stripped
Both the MIT license and Apache 2.0 require attribution and preservation of the license text. That is the whole deal: you may do nearly anything with the code provided the notice travels with it. When a model trained on public repositories reproduces a recognizable chunk of an MIT-licensed project into your codebase, what arrives is the expression without the notice. The license has been violated, quietly, by a permissive license - which is the version people assume is safe. Copyleft is the sharper edge of the same mechanism, because there the obligation attached to distribution is considerably heavier than a header comment.
Liability for that sits with the distributor, not the generator. If shipped code reproduces someone else's copyrighted expression, shipping it is the infringing act, and "the model produced it" does not move the exposure elsewhere. Innocence is not a defense to infringement under US law; at most it reduces the award, since 17 U.S.C. Section 504(c)(2) lets a court lower statutory damages where the infringer was not aware and had no reason to believe the act was infringement. Not knowing is worth a discount, not an exit.
One warning about how this risk gets quantified in public. Several widely repeated figures about the share of generated code carrying licensing irregularities trace back to nothing - no study, no dataset, no methodology, just a sentence in a marketing post that everyone subsequently cited. Treat unattributed percentages in this area as unusable. The case for taking licensing seriously rests on the mechanism, which is not in dispute: models are trained on public code, they sometimes reproduce recognizable spans of it, and notices do not survive the trip.
Scan Before Merge, Not After Release
License and similarity scanning is cheap at pull-request time and expensive once the code is in a shipped artifact with customers attached to it
Keep the Evidence You Looked
A retained scan result and review record is what turns "we had no reason to believe" from an assertion into something with support behind it
Give the Agent Its Own Git Identity
One configuration change recovers most of what was lost
The single highest-value change on this page is a dedicated service account per agent, with its own git author identity. Once the agent commits as itself, git log and git blame start telling the truth again with no additional tooling, filtering agent work from human work becomes a one-line query, and the agent's repository access can be scoped and revoked independently of any employee's. Nothing else here delivers as much for as little. The credential-scoping side of this - what the account should and should not be able to reach - is covered on agent identity rather than repeated here.
Set the identity repository-locally in the agent's checkout rather than globally, so a shared image cannot leak one agent's identity into another's work. The same block is a natural place to configure signing.
# Repository-local identity for the agent's checkout
git config --local user.name "build-agent-07"
git config --local user.email "[email protected]"
# Keyless commit signing with gitsign (short-lived Sigstore certificates)
git config --local gpg.x509.program gitsign
git config --local gpg.format x509
git config --local commit.gpgsign true
# Verify the signature on the resulting commit
gitsign verify HEADTrailers: One Recognized Key, One Convention, No Schema
Git defines no trailer vocabulary at all, which is both the problem and the opening
Co-authored-by: is real and is recognized by GitHub, which renders the additional author on the commit. The format is exact - Co-authored-by: name <[email protected]> - and it is documented in GitHub's guide to commits with multiple authors.
Generated-by: is not a standard and should not be presented as one, but it is not invented either. The Apache Software Foundation's generative tooling guidance states that "when providing contributions authored using generative AI tooling, a recommended practice is for contributors to indicate the tooling used to create the contribution", and that this "should be included as a token in the source control commit message, for example including the phrase 'Generated-by: '". That is one foundation-level recommendation with an example format - no specification, no defined value format, no tooling that recognizes it. Note also that the ASF spells it with a lowercase b. Its value is that it is greppable, and that is genuinely worth something; it is not an assurance of anything.
The reason no agreed AI trailer exists is that git itself defines no fixed vocabulary. As git interpret-trailers documents, trailers are free-form key-value lines in the RFC-822 style; Signed-off-by, Acked-by and Reviewed-by are conventions that stuck, not schema. The practical upshot is liberating: a team can adopt an internal trailer today, enforce it in a commit hook, and query it forever, without waiting for anyone to bless it.
feat(billing): add proration for mid-cycle plan changes
Splits the invoice at the change boundary and credits the unused
remainder of the previous plan.
# Recognised by GitHub - credits the agent service account as an author
Co-authored-by: build-agent-07 <[email protected]>
# EMERGING CONVENTION, not a standard - ASF recommended practice only
Generated-by: internal-coding-agent v3.4
# Local conventions - free-form, but greppable and hook-enforceable
Reviewed-by: Reviewer Name <[email protected]>
Signed-off-by: Reviewer Name <[email protected]>Metadata that is never queried is just noise in the log. The test of whether a trailer convention is worth adopting is whether someone can answer a real question with it months later - which files did agents touch, which generated commits went in without a named reviewer, what changed in this release that no human wrote from scratch.
# Commits on main in the last quarter carrying a generated-by trailer
git log --since="3 months ago" --grep="Generated-by:" \
--format="%h %an %s" main
# Parse the trailer block of one commit into key/value pairs
git show -s --format=%B HEAD | git interpret-trailers --parse
# Which files has the agent service account touched?
git log --author="build-agent-07" --name-only --format="commit %h"
# Generated commits that never picked up a Reviewed-by trailer
git log --grep="Generated-by:" --format="%H" \
| xargs -I{} sh -c 'git show -s --format=%B {} \
| grep -q "^Reviewed-by:" || echo "unreviewed: {}"'Signing Without Leaving a Key in CI
Trailers are claims; a signature is evidence - but only if the key is not sitting where the agent runs
Conventional GPG or SSH signing binds a commit to a key, and for humans with hardware-backed keys that works well. For agents it inverts the benefit. A long-lived signing key mounted into a build environment is exactly the asset you were trying not to create: anyone with pipeline access can produce signatures that look authoritative, and revoking it means invalidating the identity everything else depends on.
Keyless signing removes the stored key. gitsign, described by the Sigstore project as "keyless Git signing using Sigstore", signs commits and tags against a GitHub or OIDC identity using short-lived certificates issued by Fulcio and recorded in the Rekor transparency log. Nothing durable is written to disk, and verification runs through gitsign verify against the log entry rather than against a keyring somebody has to maintain. For an agent running in CI, a signature bound to the workload's own OIDC identity is a far better fit than one bound to a person or to a secret - which is the same argument made in more detail on agent identity.
The trade is a new runtime dependency. Signing now needs an OIDC issuer and a transparency log reachable at commit time, so an outage in either becomes an outage in your ability to commit signed work. That is usually acceptable, and it is not free.
What SLSA Actually Requires of Authors
A frequently quoted line comes from a retired version of the spec
The current SLSA Source Track, spec v1.2, has approved status and four levels: L1 Version controlled, L2 History & Provenance, L3 Continuous technical controls, and L4 Two-party review. Under Identity Management its language is that "activities conducted on the SCS SHOULD be attributed to authenticated identities" - a SHOULD, deliberately.
The phrase people quote when they want something firmer, "strongly authenticated actor", does not appear in v1.2. It comes from the retired SLSA v0.1 requirements, under Verified history, where it was required at levels 2 and 3: "Every change in the revision's history has at least one strongly authenticated actor identity (author, uploader, reviewer, etc.) and timestamp." If you cite that wording, cite it as superseded and note that the current Source Track softened it. A page about provenance that misattributes a provenance specification would be arguing against itself.
The direction of travel is unchanged either way. Both versions want changes traceable to identities that mean something, and an agent committing as a borrowed human identity satisfies neither in substance.
Treat Generated Code as Third-Party Content
One reframe carries the entire practice
You would not vendor a library into your repository without knowing where it came from, what license it carries and who checked it. Non-trivial generated code deserves the same handling, and once you accept that framing the concrete steps fall out on their own: record provenance at commit time rather than reconstructing it later; scan for license and similarity matches before merge; require named human review before generated code enters a sensitive repository; and retain the review record, because that human review is also what establishes the human authorship the copyright analysis depends on. This is the code your own agents write - the dependency and build-artifact side of the same problem lives on supply chain security.
| Mechanism | What it proves | What it does not prove |
|---|---|---|
| Co-authored-by: | A second identity was credited on the commit, and GitHub will render it | Who wrote which lines; nothing is verified or cryptographic |
| Generated-by: | A greppable, self-declared record that tooling was involved | Anything enforced - the line is only as honest as whatever wrote it |
| Agent service account | Log and blame separate agent commits from human ones by default | That any human read the change before it merged |
| GPG / SSH signature | The commit was signed by a holder of that key | That the key is not shared, stored in CI, or usable by anyone with pipeline access |
| gitsign / keyless | An OIDC identity signed this commit at a point in time, with a transparency log entry | License cleanliness, correctness, or who authored the underlying text |
| Named human review | A specific person accepted the change and can be asked about it | How carefully it was read, or that the reviewer understood it |
What This Costs, and What It Will Never Tell You
Provenance is only worth what it costs to keep accurate
A service account per agent creates real account-management work, and it breaks assumptions elsewhere. CODEOWNERS rules, protected-branch policies and review-approval flows are frequently written on the assumption that every actor is a person, and a machine author can either be blocked outright or - worse - can satisfy an approval requirement that was meant to guarantee a second pair of human eyes. Work through those rules before rolling the account out, not after.
Trailers decay. A convention that nobody queries becomes decoration within a quarter, and one that is applied inconsistently is worse than none, because it implies an absence means something. If you adopt a trailer, enforce it in a hook and build the query someone will actually run. Keyless signing adds a dependency on external availability. And every one of these controls adds a step to a workflow whose whole appeal was speed.
The honest limit is worth stating last. None of this tells you whether the code is correct, safe, or good. Provenance answers where code came from and who stands behind it - nothing more. A perfectly attributed, cryptographically signed commit can still be wrong. What provenance buys is the ability to find out fast, and to answer questions later that are otherwise unanswerable at any price. That is a narrow benefit, and it is a real one.
Start With Identity
A dedicated git author per agent is the smallest change with the largest effect, and it needs no new tooling
Add Only What You Query
Adopt a trailer when you can name the question it answers, and write that query at the same time
Sign Where It Matters
Reserve signing for repositories where a forged commit would actually hurt, rather than everything at once
Related Reading
Identity, supply chain and review practices that sit alongside provenance
Agent Identity
Scoping, issuing and revoking the credentials an agent uses, and why workload identity beats a stored secret
Supply Chain Security
Dependencies and build provenance - the other half of knowing what is really inside your artifacts
Governance
Policy, approval boundaries and the controls that decide what an agent is allowed to change
The AI Code Review Bottleneck
Why named human review is the constraint once generation stops being one
Headless Agents in CI
Running agents in pipelines, where signing keys and borrowed identities cause the most trouble
Sources
Primary specifications, court opinions and vendor documentation cited across the site
