What you will be able to do
- Explain why an engineer stays accountable for code an agent wrote, and why 'Claude already checked it' does not move that accountability
- Spot when an AI review is being treated as a sign-off, and name the control that keeps a human approving every change to main
- Limit a CI agent's permissions so that it can propose changes but a person still owns the merge
- Pick controls that keep credentials out of agent-generated code, and explain why rules that rely on a prompt or a reviewer's memory are weaker
Key concept
Outcome ownership — The person who merges or ships a change is responsible for what it does, whether a human or an agent wrote it. Review, tests and gates exist so that this person can carry that responsibility. None of them takes it over.
1.Who owns code an agent wrote
The engineer who ships a change owns it, no matter who typed it. Claude Code can write a feature, its tests and its pull request description in one session. When that code breaks in production, the agent cannot answer for it. The engineer who merged it does. The AI Fluency framework calls this competency Diligence: owning the final result fully, regardless of AI's role. One sentence sums it up: you own the outcome, not the output. "AI wrote it" explains nothing and excuses nothing.
Ownership is a practical test, not only a principle. Before shipping, the owner should be able to explain what the code actually does, not just what it should do. They should know whether the acceptance tests and edge cases still pass, and how they will find out whether it works after launch. This matters more for AI-generated code because it fails in predictable places. AI output is often technically complete but misses the point. It also has known blind spots in concurrency, security, and anything that only breaks at scale. A reviewer who skims a diff that compiles is checking exactly what the agent is already good at.
Being open about AI's role is part of ownership. Asking 'have you been transparent about AI's role?' is one of the responsibility checks before shipping. Teams that build on agents keep a record they can audit. One medical-coding startup has auditors review both the agent's output and its reasoning, and says that 'everything is versioned and auditable.' That record does not replace a named human owner. It lets that owner, and anyone auditing them later, see what the agent did.
Checkpoint 1 of 8· Check yourself
Claude Code wrote a feature, its tests and the PR description in one session. The PR description says Claude generated the change. A reviewer saw that the diff compiled and the tests passed, then merged it. A week later it fails in production because of a concurrency bug. Which statement matches how ownership works here?
Whoever ships a change owns its outcome, whether a person or an agent wrote it. Saying Claude wrote the code, or keeping an audit trail of what it did, makes the record transparent but leaves the person who merged it responsible.
“You own the outcome, not the output. “AI wrote it” explains nothing and excuses nothing.”Source: academy.claude.com
2.Why an AI review is not the accountable approval
AI review finds problems. It does not approve anything. Managed Code Review sends several agents over the diff and the surrounding code, filters out false positives, ranks the findings by severity, and posts them as inline comments plus a check run named Claude Code Review. That check run never concludes as a failure. A review only reads the diff and the surrounding code. It does not build or run anything, and inside a review its repository access is read-only. It is designed to inform a human decision, not to make one.
The same applies to the other ways Claude can review code. /code-review checks your branch in a fresh subagent that never saw your conversation, so the reasoning that produced the code does not sway it. A custom reviewer subagent with only Read, Grep, Glob cannot edit anything. Both make good second readers. Anthropic's guidance on automated security reviews states the limit plainly: they should complement, not replace, your existing security practices and manual code reviews.
The failure to watch for is quiet. Engineers start merging agent-authored pull requests after a skim, because a Claude review already ran. Each merge then has nobody actually responsible for it. The author handed responsibility to the agent, and the agent never had any. Making that Claude review a required status check does not fix this. It just turns 'Claude approved it' into an official rule.
| Option | What starts it | Where it runs |
|---|---|---|
| Code Review | Pull request activity, or an @claude review comment | Anthropic infrastructure |
| /code-review | You run the command on your branch | Your Claude Code session |
| Claude in your own CI | Pipeline events, such as every pull request | Your own CI runners |
| Your own reviewer subagent or skill | You or Claude invoke it during a session | Wherever you run Claude Code |
Checkpoint 2 of 8· Check yourself
A platform lead suggests making the Claude Code Review check run a required status check. Engineers could then merge agent-authored pull requests after a quick skim. What does this change about accountability for those merges?
An AI review reads the diff and posts findings, and its check run never concludes as a failure. It informs a human decision but does not own it. Making it a required check leaves no one accountable if engineers merge after a skim, because a person still has to sign off on the merge.
“Where does the result go, and who signs off? A PR, a comment, or a summary, and then a person approving the merge”Source: code.claude.com
3.The control that keeps a human on every merge
Human ownership survives only if the merge cannot happen without a person approving it. Claude Code's best-practices guide asks the same closing question of every agent workflow: where does the result go, and who signs off? Its answer is a PR, a comment or a summary, and then a person approving the merge, the deploy, or anything else you can't take back. The teams quoted in Anthropic's startup guide are not having agents merge to main and hoping for the best.
The control that achieves this is enforced on the protected branch. For example, branch protection on main can require an approving review from a code owner who did not write the change. Two details make it work. Enforcement means the platform blocks the merge, so nobody has to remember the rule. Independence means the approver is someone other than the author, the same reason /code-review uses a reviewer that never saw the conversation.
Other controls look similar but fail one of those two tests. A pull request template with a 'I read every line' checkbox is a request, and the reader who skims the code will skim the checkbox too. The reviewer subagent example in the best-practices guide shows the difference: its read-only limit is enforced by Claude Code rather than requested in a prompt. A required status check that runs another Claude session is enforced, but no human approves anything. Setting the agent's permission mode to plan changes how the code gets written, not who signs off on the merge.
| Control | Enforced by the platform? | Independent human approves? |
|---|---|---|
| Required approval from a non-author code owner on main | Yes | Yes |
| Required status check running a separate Claude review | Yes | No |
| PR template checklist confirming every line was read | No | Self-attested by the author |
| Default permission mode set to plan | Shapes authoring only | No |
Checkpoint 3 of 8· Match them up
A team is weighing four controls for agent-authored changes that reach main. Match each control to how it fares on the two tests of enforcement at the merge and an independent human approver.
Tap a term, then the definition that fits it.
Only the non-author code-owner approval passes both tests: the platform blocks the merge, and the approver is someone other than the author. A Claude status check is enforced but has no human approver. A checklist is only a request the author signs for themselves. Plan mode affects how the code is written, not who approves the merge.
“Where does the result go, and who signs off? A PR, a comment, or a summary, and then a person approving the merge”Source: code.claude.com
Checkpoint 4 of 8· Exam question
A 40-engineer company has adopted Claude Code CLI. Metrics show engineers merging agent-authored pull requests after a quick skim because "Claude already checked it." Leadership wants the control that keeps a human accountable for every change reaching main. Which control should the platform team put in place?
Correct answer: A — Enable branch protection on main that requires one approving review from a code owner who did not author the pull request.
- A. Correct: a branch protection rule is enforced by the platform, so no pull request reaches main until a code owner other than the author has approved it, which puts a named person on record for every change.
- B. Incorrect: a second Claude session is an automated reviewer. It can be a useful extra check, but it cannot be held accountable, and the merge no longer needs a person to approve it.
- C. Incorrect: a checklist is self-attestation by the same author who already merges after a skim. Nothing enforces it or requires a second person, so unreviewed changes can still reach main.
- D. Incorrect: plan mode only changes how the agent works, and the code is still merged by whoever applied it. Nothing requires another person's review, so the skim-and-merge habit is unaffected.
4.Agents in CI: let them propose, never let them merge
An agent running in CI should be able to open pull requests and nothing more powerful. When Claude Code runs in GitHub Actions from issue comments, a workflow is writing code with nobody watching the session. Its permissions decide whether human review is something the platform enforces or something everyone just hopes happens. The best-practices checklist asks what the agent is allowed to touch: permission rules, dontAsk, the sandbox, a worktree, the one branch it may push to.
The Claude Code GitHub Action has checks on who can start a run. On issue and pull request events, the user who triggers it must have write access to the repository. It also rejects a bot actor unless you list it in allowed_bots, which keeps bots from triggering Claude in a loop. Those checks control who can start a run. They do not control what the run can merge. That limit comes from how you scope the workflow token. Give it branch-write and pull-request scopes, no merge rights, and no ability to bypass branch protection. The pull requests it opens then go through the same required code-owner approval as everyone else's. The workflow files themselves are sensitive: Anthropic's security-guidance plugin flags edits under .github/workflows/ because they can grant repository-level permissions.
Two shortcuts quietly remove the human. Auto-merge that triggers on green checks plus a Claude approval comment means no person ever approves the change. Running the workflow under a repository admin's personal access token means the merge carries a person's name although that person never reviewed it, and admin rights can usually bypass protections. Signed commits from the agent's bot identity show which identity pushed a commit. They do not show that anyone reviewed it.
Anthropic's own incident-response agent shows the model working under pressure. On its own, it asked a code-writing Claude instance over Slack to fix a problem. The fix went to a pull request that a human reviewed before it was pushed to production. The agent behaved in a way nobody had planned, and the control still held, because the only write-like action still required a human review.
Claude can push to its branch and comment, but it cannot merge. The pull request waits until a code owner approves it and someone with merge rights merges it, so a human still owns the change.
Checkpoint 5 of 8· Check yourself
Your team runs the Claude Code GitHub Action from issue comments, so it writes code without anyone watching the session. Which workflow setup keeps a person accountable for each change the agent makes that reaches main?
Ownership holds only if the agent's most powerful action is a pull request that a person approves before it merges. Under an admin's token, a person's name is on the merge but nobody reviewed it, and admin rights can bypass protections. Auto-merge means no person approves. Trigger checks and signed commits record who started a run or pushed a commit, not that anyone reviewed the change.
“the only write-like action still required a human review.”Source: claude.com
Checkpoint 6 of 8· Exam question
A team runs Claude Code in a GitHub Actions workflow that opens pull requests from issue comments. Security wants human ownership of everything merged. Which TWO measures achieve this? Choose two.(Select 2)
Correct answers: A, C — Limit the workflow token to branch-write and pull-request scopes, with no bypass of branch protection and no merge rights.; Require a CODEOWNERS-listed person's approval in branch protection, applied to the pull requests the workflow opens.
- A. Correct: a token limited to branch-write and pull-request scopes can propose changes but cannot merge or override branch protection, so a person has to complete the merge.
- B. Incorrect: status checks and an approving comment from Claude's own review step are automated signals, so the agent's pull requests merge with no person involved at any point.
- C. Correct: a required review from a CODEOWNERS-listed person in branch protection means a named owner must approve each of the workflow's pull requests before it can merge.
- D. Incorrect: an admin's token gives the workflow admin authority, so it can merge or bypass protections itself. The person's name appears on the actions, but they never reviewed the changes.
- E. Incorrect: signed commits prove who authored a change, here the bot, but they do not require anyone to review or approve it. The pull request can still merge without a person's sign-off.
5.Keeping credentials out of agent-generated code
Secrets need controls that work even when a reviewer misses something. In a large AI-generated diff, a hard-coded key is one line among hundreds. The reliable controls work in two places: before the agent sees a secret, and at the moment code tries to enter the repository.
On the input side, a Claude Code permission deny rule stops the agent from reading local secret files at all. A key the agent never read cannot end up pasted into a file or a log. Deny rules hold firm: --allowedTools adds allow rules for one session, but a deny rule from any settings file still blocks the tool it names. Set the rule in project or managed settings so that it applies to everyone on the team.
{
"permissions": {
"allow": ["Bash(npm run *)"],
"ask": ["Bash(git push *)"],
"deny": ["Read(./.env)"],
"defaultMode": "acceptEdits"
}
}On the output side, the strongest check is deterministic and runs at the gate. A repository-side scanner that rejects any push containing a recognised credential pattern stops the key before it lands in history. Anthropic's advice on verification loops follows the same principle: a deterministic, project-specific rule catches what a generic linter or a person will miss, and anything you keep enforcing by hand belongs in an automated check. Compare the weaker options. A CLAUDE.md rule saying 'read keys from environment variables' is guidance the agent usually follows, not a block. Asking reviewers to search diffs for 'password' still depends on a busy person remembering. A nightly scan of the default branch finds the key only after it has been committed, when the only remaining fix is rotating it.
Pattern warnings inside the session help, but they are not a gate. The security-guidance plugin lets a repository define rules such as substrings sk_live_ and AKIA, and attach a reminder like 'Hardcoded API key prefix. Load credentials from the secret manager.' The reminder is warning text added to Claude's context. It nudges the author. The push-time rejection is what stops the key.
Checkpoint 7 of 8· Match them up
An agent-generated diff of several hundred lines contains one hard-coded API key. Match each control to how it handles that key.
Tap a term, then the definition that fits it.
Of these controls, only the push-time scanner is a deterministic check at the gate, so the key never reaches history. The nightly scan acts after the commit. The CLAUDE.md rule and the plugin warning only advise the agent or author, and the manual search depends on someone remembering to do it.
“so every session applies the same checks automatically instead of relying on a human to remember them”Source: claude.com
Checkpoint 8 of 8· Exam question
A platform team wants to prevent credentials from reaching the repository through agent-generated code. Reviewers sometimes miss hard-coded keys in large diffs. Which TWO controls are the most reliable? Choose two.(Select 2)
Correct answers: A, C — Enable push protection and secret scanning on the repository, which rejects pushes that contain recognised credential patterns.; Add Claude Code permission deny rules for reading .env files, which keeps local secrets out of the agent's context.
- A. Correct: push protection is an enforced, deterministic check that rejects a push containing a recognised credential pattern, whoever or whatever wrote the code and whether or not a reviewer spots it.
- B. Incorrect: CLAUDE.md content is advisory context the model can overlook or misapply, so it cannot enforce that no key is hard-coded and does not give a reliable safeguard for a security requirement.
- C. Correct: deny rules for reading
.envfiles are enforced by Claude Code's permission system, so the agent never ingests those local secrets and cannot copy them into the code it generates. - D. Incorrect: this relies on manual diligence, the weakness already seen with large diffs, and a keyword search misses keys whose surrounding names do not match the listed terms.
- E. Incorrect: a scheduled scan detects a credential only after it has been committed to the branch, so it reaches the repository and has to be rotated instead of being prevented.
Sources
(12)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“You own the outcome, not the output.”
↩︎ Who owns code an agent wrote“Have you been transparent about AI’s role?”
↩︎ Who owns code an agent wrote“You own the outcome, not the output. “AI wrote it” explains nothing and excuses nothing.”
↩︎ Checkpoint - 2.
“AI has predictable blind spots in concurrency, security, and anything that only breaks at scale.”
↩︎ Who owns code an agent wrote - 3.https://claude.com/blog/claude-code-guide-for-startupsSecondary source
“Everything is versioned and auditable”
↩︎ Who owns code an agent wrote“none of these startups are having agents merge to main and hoping for the best.”
↩︎ The control that keeps a human on every merge - 4.https://code.claude.com/docs/en/code-reviewOfficial docs
“a review works from reading the diff and the surrounding code, without building or running your code.”
↩︎ Why an AI review is not the accountable approval“The check run doesn’t conclude as a failure.”
↩︎ Prediction - 5.https://code.claude.com/docs/en/best-practicesOfficial docs
“/code-review reviews the diff in a fresh subagent that never saw your conversation. It isn’t swayed by the reasoning that produced the code.”
↩︎ Why an AI review is not the accountable approval“and then a person approving the merge, the deploy, or anything else you can’t take back.”
↩︎ The control that keeps a human on every merge“Now it’s a reviewer that can’t edit anything, and that limit is enforced by Claude Code rather than requested in a prompt.”
↩︎ The control that keeps a human on every merge“What’s it allowed to touch? Permission rules, dontAsk, the sandbox, a worktree, the one branch it may push to.”
↩︎ Agents in CI: let them propose, never let them merge“that limit is enforced by Claude Code rather than requested in a prompt.”
↩︎ Exam trap 2“Where does the result go, and who signs off? A PR, a comment, or a summary, and then a person approving the merge”
↩︎ Checkpoint“Where does the result go, and who signs off? A PR, a comment, or a summary, and then a person approving the merge”
↩︎ Checkpoint - 6.https://support.claude.com/en/articles/11932705-automated-security-reviews-in-claude-codeOfficial docs
“they should complement, not replace, your existing security practices and manual code reviews.”
↩︎ Why an AI review is not the accountable approval“they should complement, not replace, your existing security practices and manual code reviews.”
↩︎ Exam trap 1 - 7.https://code.claude.com/docs/en/github-actionsOfficial docs
“on issue and pull request events, the triggering user must have write access to the repository.”
↩︎ Agents in CI: let them propose, never let them merge“the Claude Code GitHub Action rejects a bot actor unless you list it in allowed_bots, which keeps bots from triggering Claude in a loop.”
↩︎ Agents in CI: let them propose, never let them merge - 8.https://code.claude.com/docs/en/security-guidanceOfficial docs
“Workflow files: edits under .github/workflows/, which can grant repository-level permissions”
↩︎ Agents in CI: let them propose, never let them merge“Hardcoded API key prefix. Load credentials from the secret manager.”
↩︎ Keeping credentials out of agent-generated code - 9.https://claude.com/blog/ciso-guide-to-agentic-aiSecondary source
“The fix went to a pull request that a human reviewed before pushing it to production.”
↩︎ Agents in CI: let them propose, never let them merge“the only write-like action still required a human review.”
↩︎ Exam trap 3“the only write-like action still required a human review.”
↩︎ Checkpoint - 10.https://code.claude.com/docs/en/settings-referenceOfficial docs
“a deny rule from any settings file still blocks a tool it names”
↩︎ Keeping credentials out of agent-generated code“a deny rule from any settings file still blocks a tool it names”
↩︎ Exam trap 4 - 11.
“Anything you keep having to enforce by hand as a manual check qualifies for capture as a loop.”
↩︎ Keeping credentials out of agent-generated code“so every session applies the same checks automatically instead of relying on a human to remember them”
↩︎ Checkpoint
Also cited
“Diligence means owning the final result fully, regardless of AI’s role.”
↩︎ Key concept