answered from live GitHub & Hugging Face data

How can I set up a review process to differentiate between AI and human-generated pull requests in GitHub?

MaintActive · 11d ago
Stars0
Issues0 open

Verdict: Do not detect AI code from the diff. Require contributors to declare AI use in commit trailers, then gate those pull requests with labels and rulesets.

Code review tools cannot reliably tell AI-written code from human-written code. Your process should depend on declared attribution and on platform signals that GitHub already records.

Recommended process

  1. Set a disclosure rule for trailers. Ask contributors to add a trailer when an AI tool helped write a commit. Two conventions exist:

    • Assisted-by is the Linux kernel format. The kernel asks for Assisted-by: LLM [TOOL] and forbids AI agents from adding Signed-off-by (kernel guidance).
    • Co-authored-by is the GitHub format. It attributes a commit to more than one person. A co-author must use an email linked to their GitHub account for the commit to count toward their contributions (GitHub docs).

    Pick one convention and write it in CONTRIBUTING.md.

  2. Label pull requests from the trailers. Add a workflow that reads each commit message in the pull request. It applies a label such as ai-assisted when it finds the trailer. Apply labels with the labels REST endpoint, using POST /repos/{owner}/{repo}/issues/{issue_number}/labels.

    • I could not check the maintenance status of a ready-made action. One candidate, pujitha24/ai-contribution-check, checks Assisted-by and co-author trailers. It has 0 stars and an MIT license. I could not check its maintenance signals, so I do not recommend it yet.
  3. Turn on required reviews in a ruleset. Use a ruleset to require pull requests and approvals. You can require approval from a designated code owner. You can also require approval from someone other than the last person who pushed.

  4. Keep the Copilot extra-approval rule on. Copilot pull requests that are not attributed to a person need one more approval. This rule is on by default in rulesets. The docs say it applies when Copilot opens a pull request under its own app identity (rule details).

  5. Route AI-labelled pull requests to stricter reviewers. Use a required-reviewers team, scoped to sensitive paths. Set it up in the same ruleset.

What GitHub already marks for Copilot

GitHub Copilot cloud agent makes commits as Copilot. It names the developer who assigned the task as co-author. Its commits are signed and show as "Verified" (risks and mitigations). Those signals cover Copilot only. Other AI tools do not add them.

Limits

Recommendation

Start with trailers, a label workflow, and a ruleset. Add the community action only after you check its maintenance.

docs.github.com/en/pull-requests/how-tos/commit-changes/creating-a-commit-with-multiple-authorsdocs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesetsdocs.kernel.org/process/coding-assistants.htmlgit-scm.com/docs/git-interpret-trailersdocs.github.com/en/rest/issues/labelsgithub.com/pujitha24/ai-contribution-checkdocs.github.com/en/copilot/concepts/security-governance-and-network-settings/risks-and-mitigations
Answered live from GitHub & Hugging Face · anthropic/claude-haiku-5.5 · 10/31/2026

Ask your own open-source question →