Saying what the agent did, in the commit and the review
An agent fixed a bug in the nightly sales import, the tests pass, and you are about to open a pull request. A reviewer reads what you send this week and decides how closely to look. Someone who reads the history a year from now wants to know who made the change and who checked it. In this lesson we write the commit message and the pull request for both readers. The first half covers the team’s review agreements, and the second half covers how the commit says that an agent helped, and what only a person may add to it.
The lesson on saying that AI helped gave a disclosure line three parts: what the AI did, what the person checked, and who is accountable. A pull request needs the same three parts, and a commit holds them in a form that tools can read.
Before you ask for a review
Section titled “Before you ask for a review”Review norms are the agreements a team makes on how agent-assisted changes are reviewed. Teams write them down in different words. These are the points most of them share.
The author reads every line first. You asked for the change, and you are its first reviewer. The steps are the ones from reviewing the diff. When you request a review, you tell the reviewer that you understand the change and think it is right. If they find a line you never read, they learn that your request meant less than that.
The description says what the agent did and what you verified. Name
the part the agent wrote, the checks you ran yourself, and what you
didn’t check. “The agent ran the tests” reports what the agent said. “I ran
the tests, and the new one fails on main and passes here” reports what
you saw.
The reviewer reads the diff. The description tells the reviewer where to look, and the diff is what gets merged. A description written by an agent can describe the change it meant to make and not the one it made. An agent’s change goes through the same gates as any other change: the CI run and a reviewer’s approval. “The agent tested it” doesn’t replace either, because the agent’s tests are part of the change under review.
The change is small enough to read. An agent writes code much faster than a person can review it. A diff that’s too large to read gets skimmed or blocked. Split it before you ask. Put a mechanical rename in its own pull request, and keep each change to one purpose. A tidy-up the agent made on the side belongs in a separate pull request, or at least in the description.
Your team may have its own list, often in the project’s agent
instructions file or in CONTRIBUTING. Where the two differ, follow the
team’s list. When you disagree with one of its rules, propose a change
to the file and keep to the rule until the team agrees.
A 3000-line agent diff
Section titled “A 3000-line agent diff”An agent was asked to add one report to a service. Its branch also renames the logging calls in forty files. The diff has about 3000 changed lines and CI passes.
You asked an agent to add a monthly report to a service. The branch it produced also renames the logging calls in forty files, “for consistency”. The diff has about 3000 changed lines and CI passes. What do you do before anyone reviews it?
What can a reviewer do with 3000 lines, and which part of the work is yours to do before you ask?
Ready for review?
Section titled “Ready for review?”You are about to request a review of a pull request in which a coding agent wrote most of the change. The agent also tidied up an unrelated file on the side.
Which of these belong to a pull request that is ready for review?
Which of these did you do yourself, and which only repeat what the agent reported?
Saying it in the commit
Section titled “Saying it in the commit”Attribution means recording in the change itself that an agent
contributed, next to the person who directed and checked the work. In a
commit it goes in a trailer. Git reads trailers from the last
paragraph of a commit message, after a blank line, as lines in the form
Key: value [1]. Tools read them from
there, so a line in the middle of the body that looks like a trailer is
only text.
Several forms are in use. GitHub shows a commit as written by more than
one person when the message ends with a Co-authored-by: name <email>
line for each of them [2].
The Linux kernel asks for an Assisted-by tag that names the AI help, in
a format its guideline gives [3]. Claude Code adds
a Co-Authored-By trailer to its commits by default. Its
attribution.commit setting changes that trailer to the one the project
asks for, and an empty value removes it [4].
Whichever agent you use, check the form the project asks for, and read the
trailer block of each commit before you push it.
The commit’s author is still you. Git records an author for every commit, the identity of the person who made it unless someone sets another one [5]. The trailer adds the agent. It doesn’t take your name off.
The fixture for this lesson is in the course repository under
site/examples/coding-with-agents/attribution-and-review-norms/. The
agent wrote commit-message.txt, and trailers.py runs
git interpret-trailers --parse on it, which prints only the lines git
reads as trailers.
Which lines are trailers?
Section titled “Which lines are trailers?”A script runs git interpret-trailers --parse on a commit message an agent wrote, and prints only the lines git reads as trailers.
This is the agent’s commit message:
fix: read quoted amounts in the nightly import
The importer split "1,250.00" into two fields. It now reads each rowwith the csv module, so a quoted amount stays one field.Assisted-by: Claude:claude-sonnet-4-6I also tidied up the date parsing while I was in the file.
Signed-off-by: Coding Agent <agent@example.com>Before you run it, write down what the script prints for this message. Then copy the directory and run it to check.
python3 trailers.pySigned-off-by: Coding Agent <agent@example.com>
Output verified in CI from site/examples/coding-with-agents/attribution-and-review-norms/trailers.py.
Which paragraph does git look at, and what is in that one?
The only trailer git finds is the one line the agent must not write. The
Assisted-by line is in the body, so a tool that counts agent-assisted
commits misses this one.
The sign-off only a person gives
Section titled “The sign-off only a person gives”The Signed-off-by trailer is older than coding agents. git commit -s
adds one with the committer’s name, and the git documentation says that
what it means depends on the project. In the Linux kernel and Git
projects, and in others that adopted it, it certifies the Developer
Certificate of Origin (DCO) [5]. The DCO is a short
statement in four parts. In our words: I made the contribution, in whole
or in part, and have the right to submit it under the project’s license,
or it is based on earlier open-source work I may submit, or someone who
certified one of these gave it to me and I didn’t change it. And I agree
that the contribution and my sign-off are kept on public record [6].
Each part is a statement about a person’s rights and knowledge, and an
agent has neither. The Linux kernel guideline says it directly: an AI
agent must not add a Signed-off-by tag. The person who submits the
change reads the code, makes sure its license fits the project, signs off in
their own name and answers for the result [3].
Sign off yourself only after you have read the change, because the
sign-off says you know where the code came from.
This course’s own repository is a worked example. The last commit on
main when this lesson was written ended like this:
Co-Authored-By: lsimons-bot <bot@leosimons.com>Assisted-by: Claude:claude-opus-5-5The Co-Authored-By line names a bot account, and the Assisted-by
line names the agent and the model. The commit’s author is the
maintainer, and the message has no sign-off.
Which trailer block?
Section titled “Which trailer block?”A project requires a DCO sign-off on every commit and asks for an Assisted-by trailer when AI helped. An agent wrote a change, and the developer, Ana Costa, read the whole diff and ran the tests.
Ana’s project requires a DCO sign-off on every commit and asks for an
Assisted-by trailer when AI helped. An agent wrote the change, and Ana
read every line and ran the tests. Which trailer block does the commit
end with?
Which of these lines can the agent truthfully certify, and which only a person can?
Push it or fix it?
Section titled “Push it or fix it?”A project requires a DCO sign-off from the person who submits a change and asks for an Assisted-by trailer when AI helped. Each item describes how an agent-assisted commit message ends. You read the diff before you signed off.
For each ending, does git read the Assisted-by line as a trailer, and could the person named in the sign-off truthfully give it, and is every line the project asks for there?
Which ending?
Section titled “Which ending?”A project requires a DCO sign-off from the person who submits a change and asks for an Assisted-by trailer when AI helped. An agent wrote the change, and you read the diff and ran the tests.
How does the commit message end?
Where does git look for trailers, and who can truthfully give a sign-off?
Exercise
Rewrite the agent’s commit message and pull request description from the
fixture directory, commit-message.txt and pr-description.md. The
pull request says only that “the agent fixed the bug” and that the agent
ran the tests. Write both as you would send them, in a copy of the
directory. Then run python3 trailers.py with your message file as its
argument to see which trailers git finds.
Take out the agent’s sign-off. If your project asks for a sign-off, write
your own Signed-off-by line in the file, the line git commit -s would
add. In real work, add it only once you have read the change.
Decide what to do with the date-parsing tidy-up: take it out of this
change, or name it in both texts.
A good result: the message says what changed and why, and ends with one
trailer paragraph that trailers.py prints in full, Assisted-by in the
form this lesson used or the form your team uses. The pull request says
what the agent wrote, what you ran yourself and what you saw, and what
you didn’t check. A reviewer could tell from it where to look hardest.
Reflect: which sentence in your pull request would you have left out if this exercise had not asked for it, and what would the reviewer have assumed without it?
Stretch: Look at the last ten commits in a repository your team uses with agents. Count how many name the agent in a trailer, and how many say so only in the body or not at all.
Recap
- Before you ask for review, read every line yourself and split a change that’s too large to read. The pull request says what the agent did and what you checked, and the change goes through the same review and CI gates as any other.
- Reviewers read the diff, and the description tells them where to look. Answer for the whole change as its author, including the parts the agent wrote.
- Put the attribution in a trailer in the last paragraph of the commit message [1], in the form the project asks for, such as
Assisted-byorCo-authored-by. - In a project that uses the Developer Certificate of Origin, a
Signed-off-byline certifies it, and only a person can give that. An agent never signs off, and you sign off only after you have read the change [3].
You can now
- Attributes agent work honestly in commits and reviews
- Follows the team's review and CI norms for agent changes
References
Section titled “References”- The Git project. git-interpret-trailers. Git reference documentation. Reference.
Git docs git-interpret-trailers - GitHub. Creating a commit with multiple authors. GitHub documentation. Reference.
GitHub docs creating-a-commit-with-multiple-authors - The kernel development community. AI Coding Assistants. The Linux kernel documentation. Reference.
Linux coding assistants - Anthropic. All settings. Claude Code documentation. Reference.
Claude Code all settings - The Git project. git-commit. Git reference documentation. Reference.
Git docs git-commit - The Linux Foundation and its contributors. Developer Certificate of Origin, version 1.1. developercertificate.org. Reference.
DCO