Sub topic 7
The author owns the change
This chapter assumes you know the pull request workflow, have taken part in code review, and have used an AI coding assistant. It covers one rule and how to make it work in practice: the person who submits a change is accountable for it, however the code was written.
The rule
A policy for AI-assisted code needs one sentence that settles most disputes:
> The person who opens the pull request is the author, and the author is responsible for every line in it.
This chapter states that rule without a block quote, so here it is as plain policy text: The person who opens the pull request is the author. The author is responsible for every line in it, whether they typed it, copied it, or accepted it from an AI tool.
An AI tool cannot be held accountable. It does not attend the incident review, fix the bug at 2 a.m., or answer to a customer. A person must do those things, so the policy names the person in advance.
Why the author and not the reviewer
Teams sometimes drift into treating review as the safety net: "the AI wrote it, and someone will review it." This reverses the order of responsibility.
- The author knows the intent of the change, the context, and what was tried. The reviewer sees only the diff.
- Reviewers have limited time. If authors submit unread generated code, reviewers become the first and only person to read it.
- AI output is fluent and consistent in style, so it looks correct. Bugs in it are harder to spot in a quick scan than bugs in human code.
Review is a second check. The author's own verification is the first, and the policy should say so.
What ownership means in practice
"Responsible" is vague unless you list the duties. A usable policy turns it into behaviors that can be checked.
| Duty | What it looks like | How a team can check it |
|---|---|---|
| Understand | The author can explain each part of the change without the tool | The reviewer asks questions in the PR |
| Verify | The author ran the code and the tests | A checked item in the PR template, plus CI results |
| Test | New behavior has tests that the author has read | CI and reviewer inspection |
| Protect data | No secrets or restricted code were sent to the tool | A checked item in the PR template |
| Respond | The author answers review comments and fixes defects after merge | Normal on-call and ticket workflow |
The first row matters most. A good test of understanding is whether the author could defend the change in a review with the AI tool turned off. If not, the change is not ready.
Ownership is not blame
Accountability can turn into fear if the team treats it as a way to punish mistakes. Keep two ideas apart:
- Accountability means someone owns the outcome, answers questions, and fixes problems.
- Blame means someone is punished for a defect.
Write the policy so that it covers the first and leaves the second to your normal blameless incident process. If authors fear punishment, they will hide AI use, and you lose the disclosure that later chapters depend on.
Writing the rule into policy
Short, concrete wording works better than general statements. A sample section:
Author accountability
1. The author of a pull request is responsible for its correctness,
security, tests, and licensing, regardless of how the code was produced.
2. Authors must read and understand all code they submit.
3. Authors must run the tests and manually check changed behavior.
4. "The AI wrote it" is not an acceptable explanation for a defect,
a leaked secret, or a failed review.
5. Authors must not submit code they cannot explain.Rule 5 sets a limit that is easy to enforce socially. If you cannot explain it, either learn what it does, simplify it, or do not submit it.
Making ownership visible in the workflow
A rule that lives only in a document gets forgotten. Put it in the places where authors already work.
The pull request template
The template makes the author state, at the moment of submission, that they have done the work. This is the same template the rest of the tutorial builds on:
## What changed and why
## How I verified it
- [ ] I read and understand every line in this PR
- [ ] I ran the tests locally
- [ ] New or changed behavior has tests
## AI assistance (per team policy)
- [ ] No AI tool was used
- [ ] AI tool used for part of this change (tool and scope: ____ )
- [ ] No secrets, customer data, or restricted code were shared with the toolA checkbox does not prove anything on its own. It does two useful things: it prompts the author to actually do the checks, and it creates a record. If a checked box turns out to be false, the conversation is about honesty, not about whether the author knew the rule.
Named reviewers for sensitive paths
Authorship stays with one person, but some areas need a second pair of qualified eyes. A CODEOWNERS file routes those changes to the right owners automatically:
# .github/CODEOWNERS
/auth/ @example-org/security-team
/payments/ @example-org/payments-team
/.github/ @example-org/platform-team
/docs/policies/ @example-org/engineering-leadsThis does not move responsibility from the author to the owners. It adds required review for sensitive paths, on top of the author's own duties.
Edge cases to settle in the policy
Most real disputes come from situations the first draft did not cover. Decide these in advance.
Agentic tools that open pull requests
Some tools can edit files, run commands, and open pull requests on their own. The rule still applies: the human who started the task, or who is assigned to the resulting PR, is the author. If a bot account opens the PR, name the human owner in the PR description, and require that person to review the diff before asking anyone else to. A PR with no human owner should not be merged.
Code copied from a teammate's AI session
If a colleague pastes AI-generated code into your branch, and you commit it, you own it. The same applies to snippets from chat threads and tickets. Ownership follows the commit and the PR, not the origin of the text.
Very large generated diffs
An author who submits a 3,000-line generated change cannot have understood it in the usual sense. State a size expectation, for example: split the work into reviewable pieces, and do not submit a diff the author has not read in full. Large mechanical changes, such as renames or formatting, can be allowed if the author describes how they were generated and how they were checked.
Authors who are new or junior
Accountability should not mean that juniors carry risk alone. The author still owns the change, but the team can expect more discussion before the PR is opened, and reviewers should ask explanation questions kindly. Later chapters on training and onboarding cover this.
Self-approval
The author must never be the only approver of their own change. Branch protection enforces this, and the next chapters on review and guardrails cover the settings.
Common mistakes
- Treating AI use as a mitigating factor. If "the AI suggested it" softens the response to a defect, authors learn to hand off judgment. Keep the response the same as for human-written code.
- Treating AI use as a suspicious act. If using a tool gets someone questioned, they stop disclosing. Ownership works only if honest disclosure is safe.
- Policy without a named person. Bot-authored or shared-session changes need one named human owner.
- Checkbox culture. If every box is ticked automatically, the template has become decoration. Reviewers should occasionally ask a question that only someone who read the code could answer.
Exercise
A teammate opens a pull request containing a function generated by an AI assistant. A reviewer asks why the function catches and silently ignores a database error. The teammate replies, "That's what the AI wrote." Under an author-accountability policy, what is wrong with this reply, and what should the author do next?
Show answer
The reply treats the tool as responsible, but the policy makes the author responsible for every line. The author should read the code, decide whether swallowing the error is correct (it usually is not), fix it by handling or propagating the error, add a test that covers the failure case, and explain the reasoning in the PR. If the author cannot explain the behavior, the change is not ready for review.