Saying that AI helped with your pull request does not replace review. The disclosure gives the reviewer context that the diff cannot show by itself: which tool helped, what part of the work it touched, and what you checked before asking for approval.

Start by reading the repository policy. Some projects ask for disclosure in the pull request body, others prefer a commit trailer, and some require both. A study of 281 contribution policies found different rules for the location, tool, and level of assistance to report (Hora, Robbes, and Zacchiroli, "The Landscape of AI Policies in Popular Open Source Projects", 2026). No universal sentence replaces the maintainer's instructions.

This guide separates four things that are often mixed together: disclosure, authorship, evidence, and approval. The postmortem guide for an AI-generated pull request covers what to reconstruct after a failure. This article starts earlier: what does a reviewer need to know to assess the change without guessing how it was produced?

For the broader skill context around working with agents, see the software engineering skills for coding agents.

Diagram showing a pull request with AI disclosure connected to scope, human verification, and a review decision.

Short answer

  • Read CONTRIBUTING.md, AI_POLICY.md, and the pull request template before choosing a format.
  • Name the tool and scope of assistance. Say whether it helped with research, code, tests, or text.
  • Connect the disclosure to verification: tests run, diff review, known risks, and limits of what you checked.
  • Disclosure does not make the AI the author or turn the contributor into a messenger. The person opening the PR must understand and own the change.

Read the repository policy before writing the disclosure

Do not start with the tool name. Start with the project's contribution contract. Look for CONTRIBUTING.md, AI_POLICY.md, the README, and files under .github/. The policy may say whether assistance is allowed, whether autonomous agents are restricted, whether an issue must exist before a PR, and which record the maintainer wants to keep.

GitHub documents that a pull request template fills the body of new pull requests. That makes it easier to ask for disclosure consistently, but the template cannot decide whether the statement is accurate. It only puts the question in the path of the person opening the change.

Public policies show why the local rule matters. Nextcloud requires a disclosure in the PR and an Assisted-by: trailer in commits containing assisted content. The Moby and Docker policy puts disclosure in the PR body and says not to use an agent trailer as co-authorship. Copying one project's rule into another can produce a record the maintainer did not ask for or, worse, hide the information in the wrong place.

Before opening the PR, answer:

  1. Does the policy allow assistance, require disclosure, or restrict autonomous agents?
  2. Does the record belong in the PR, the commit, an issue, or more than one place?
  3. Does the policy ask for the tool name, model version, extent of assistance, or only a general statement?
  4. Is there an additional requirement for licenses, dependencies, tests, or human review?

If the answer is not documented, ask the maintainer in an issue or discussion before generating a large change. Uncertainty about the format is not a reason to send an unreviewed contribution.

What should a useful disclosure say?

A short statement should help the reviewer understand AI involvement without reading an entire conversation. Include only details that change how the PR should be reviewed:

  • Tool: the product or agent used. Include the model version when the project asks for it or when it matters for interpreting the record.
  • Scope: research, planning, code, tests, documentation, review replies, or a combination.
  • Extent: a single suggestion, one file, most of the patch, or the whole workflow. Do not use "AI-assisted" as if these cases were identical.
  • Verification: the tests, checks, inspections, or reproductions you ran after the suggestion.
  • Limits: what you did not test, which risk remains open, and what still needs a specific review.

The disclosure does not need every prompt. Prompts can contain secrets, private data, or details that only make sense inside one session. The reviewer needs enough provenance to calibrate the reading, not a transcript that adds noise.

Here is a generic example. Adjust it to the project's policy:

## AI assistance

- Tool: Codex
- Use: helped explore the codebase and generated the first version of `src/cache.ts`.
- Tests: `npm test` and `npm run typecheck` passed locally.
- Human review: I read the diff, checked the invalidation contract, and wrote the missing-key cases.
- Limit: I did not measure load behavior or test the production provider integration.

This block does not claim that the code is correct. It tells the reviewer where to start and makes clear what has not been proven.

Where should it go: PR, commit, or both?

Use the location required by the repository. When there is no rule, the PR body is usually the first useful place because it sits next to the change description the reviewer already needs to read. A commit can carry an additional record when the project values permanent traceability or asks for a specific trailer.

Location What it explains best Risk when used alone
PR body Tool, scope, verification, and risk for this change It may disappear when a patch is copied or fail to follow a rewritten commit history
Commit trailer Provenance tied to one commit It may not explain what the AI did or what was verified
Issue or discussion Task context and prior approval It can drift away from the final diff
Repository file A rule that applies to many contributors It does not prove that this PR followed the rule

The study of contribution policies found PR descriptions and commit messages to be the most common locations among policies that specify where to disclose. That is a description of the corpus, not a reason to ignore your project's policy.

Do not use Co-authored-by: to assign authorship to a tool without checking the local rule. Moby says the co-author should be a person who actually worked on the change, while Nextcloud uses its own trailer for a different purpose, tracking assistance. The same trailer can carry different meaning across projects.

Disclosure is not proof of quality

The reviewer should be able to separate four questions:

  1. What was produced? The diff, files, and description answer this.
  2. How did AI participate? The disclosure gives tool and scope context.
  3. What was verified? Tests, diff review, reproduction, and checks answer only what they actually ran.
  4. Who decides and owns the result? The person opening the PR must explain the change and fix problems found in review.

The Requests policy places responsibility and code understanding on the contributor and rejects unsupervised agents. The Moby policy also asks that anything helped by AI be read and edited by a person before publication.

That changes how the disclosure should read. "Claude Code generated this PR" is incomplete. "I used Claude Code to propose the change and tests; I reviewed the diff, ran suite X, and have not measured Y" supports a technical conversation. The second sentence is better because it connects assistance to a verification action and a limit.

If you cannot explain the flow, failure cases, and reason for the changed files, stop before opening the PR. Asking the same agent for a more convincing summary does not close the gap. Reduce the task, read the code, run an independent proof, or ask another person for help.

When a repository uses an automated reviewer, treat it as another signal. The AI code review workflow in GitHub Actions shows how to separate diff analysis from comment publication, but tests and human approval remain independent decisions.

Use the template to ask for evidence, not an empty checkbox

A template can prevent omissions. It should not turn "I reviewed everything" into a statement nobody can inspect. Prefer questions that point to artifacts:

## Verification

- [ ] The problem links to an issue or a reproducible explanation.
- [ ] The diff contains no out-of-scope files or refactors.
- [ ] Relevant tests are listed with the observed result.
- [ ] The behavior change has a failure case or documented limit.
- [ ] I can explain every part of the patch without reopening the AI conversation.

## AI assistance

- Tool and version, if required by policy:
- Where the tool helped:
- What a person reviewed or rewrote:
- What remains unproven:

The last field matters. A checkbox that allows only "yes" pressures people to hide uncertainty. The correct answer may be "not verified" or "not applicable", with a short explanation.

For decisions that will still matter after the merge, pair the PR with an engineering decision record for code written with an AI agent. The disclosure explains the tool's involvement; the record explains why the team chose that design.

Do not ask the agent to fill and publish this block without review. The tool can help locate tests and files, but the disclosure is a statement from the contributor. The PR body should answer the first human reader, not act as an automatic report of every agent step.

What if the policy does not exist yet?

Do not invent a repository-wide rule from one external policy. For your next PR, use a short statement in the body, give the scope of assistance, list the verification, and ask whether the maintainer prefers another record. If the contribution is to an open-source project, also read its rules for prior issues, licenses, security, and autonomous agents.

If you maintain the repository, write a small policy before automating enforcement. It should answer whether AI is allowed, what must be disclosed, where the record lives, what the contributor must verify, and which submissions will not be accepted. The PR template can remind people of the rule, but the policy should explain it.

Avoid two easy decisions that appear to solve everything:

  • require the tool name without asking for understanding, tests, or responsibility;
  • ban all assistance without distinguishing a small autocomplete suggestion from an agent that opened and changed an entire PR.

The policy study found both disclosure requirements and missing guidance across many projects. The lack of a standard is a reason to write the context clearly, not to treat a label as a quality guarantee.

Common disclosure failures

Hide AI involvement because the patch was reviewed. Review is a reason to open the PR with more confidence, not a reason to omit information when the policy asks for it.

Put everything in the commit when the policy asks for the PR. The reviewer may never find the trailer while reading the change description.

Use the model name as if it were an audit. The tool and version do not say which files were generated or which tests passed.

Publish the full transcript. The conversation can expose secrets, customer data, and internal instructions without making the diff easier to understand.

Check every box without evidence. A checkbox is a reminder. Command output, tests, and stated limits are the parts another person can discuss.

Treat disclosure as automatic co-authorship. Authorship, licensing, and trailers have their own rules. Follow the project and keep human accountability explicit.

Frequently asked questions

Do I need to disclose a small autocomplete suggestion?

It depends on the policy. Some projects exempt trivial help, while others ask for any use of generative tools. If there is no rule, describe the case when assistance changed a meaningful part of the code, tests, or documentation. Do not turn a personal interpretation into a guarantee for the repository.

Should I put the model name in the pull request?

Only when the policy asks for it or when the name is needed to understand the record. The important part is what the tool did, how far it went, and how you checked the result. A name without context does not help the reviewer decide where to look.

Does the disclosure protect me from an AI-generated mistake?

No. It creates process transparency, but it does not transfer responsibility to the tool. The contributor still needs to understand, test, and stand behind what they submitted, within the rules and obligations that apply to the project.

Conclusion

A useful disclosure answers a real reviewer question: how was this change produced, and what has already been checked? It does not replace tests, diff reading, design judgment, or human approval.

Read the repository policy, name the tool and scope in the right place, and record verification with honest limits. If someone asks why the code works, the answer must come from your understanding of the system. AI may have sped up investigation or written the first patch. The person opening the pull request still owns the change.

The same separation helps when presenting AI-assisted work in a software engineer portfolio: the tool is part of the method, while the evidence shows judgment.

How this analysis was done

Samuel Fajreldines is the author responsible for this article. The research compared GitHub's pull request template documentation, public contribution policies from Nextcloud, Moby, and Requests, a study of 281 open-source contribution policies, and recent public discussions. The PR template is an illustrative editorial synthesis, not a universal policy or benchmark. AI assistance supported discovery, source organization, drafting, image creation, and localization; it did not replace reading the policies or create first-hand review experience in an external project. The author maintains RemoteCode as a work tool.

Sources