answered from live GitHub & Hugging Face data

How can I implement a clear labeling system for AI-generated pull requests in my GitHub repository?

MaintStale · 2.5y ago
Stars319
Issues24 open
MaintStale · 5.4y ago
Stars270
Issues32 open
MaintStale · 4.2y ago
Stars92
Issues20 open

Use one label for AI involvement, plus a commit trailer for the details. The label is visible in review queues. The trailer records which tool helped and stays in git history.

Step 1: Create the labels

GitHub labels are per repository. Anyone with write access can create them. (Managing labels)

  1. Create ai-assisted with a description such as "Contains code written or edited with an AI tool."
  2. Create ai-generated for PRs where an agent wrote most of the change.
  3. Use a distinct color so reviewers see the label in lists.

Only users with triage access can apply and dismiss labels by hand. (Managing labels)

Step 2: Apply the label automatically

  1. Add a workflow that runs on pull request events. GitHub lists the supported pull_request activity types in its events reference.
  2. Detect AI involvement from the commit trailers in Step 3.
  3. Add the label with a script or an action.

I could not check actions/labeler or other labeling actions. The GitHub API rate-limited my requests, so I cannot confirm their maintenance status or activity. Check the last release and open issues before you adopt one.

Step 3: Mark commits with a trailer

Use a trailer. Two conventions exist, and they differ in scope:

Trailer Used by Meaning Source
Assisted-by: LLM [TOOL] Linux kernel Records AI help. Lists only specialist tools, not git or editors. Kernel AI coding assistants guide
Co-authored-by: Name <email> GitHub Credits a human co-author. Counts toward that person's contribution graph. GitHub co-author docs

The kernel rules also say AI agents must not add Signed-off-by. Only a human can certify the Developer Certificate of Origin. (Kernel guide)

Git can add trailers for you. Set trailer.<alias>.key, trailer.<alias>.cmd, and trailer.<alias>.ifmissing in the git config. Then run git interpret-trailers. (git-interpret-trailers)

Example commit message:

Refactor parser error handling

Assisted-by: LLM Claude

Step 4: Enforce it

  1. Add a commit-msg hook or a CI check. It should fail when a PR has AI-generated changes but no Assisted-by line.
  2. Ask contributors to state AI use in the PR template. A checkbox works well.

Recommendation

Start with two labels and a PR template checkbox. Add the workflow once the team uses the trailer. Trailers alone do not show in review queues. Labels alone do not show which tool or run wrote the code.

If you run coding agents that push under their own identity, githug does this today. Each agent gets its own key, and its commits carry trailers that name the accountable human, the agent, and the run. The hug CLI sets this up for Claude Code, Codex, Cursor, or any agent that runs git.

docs.kernel.org/process/coding-assistants.htmldocs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labelsdocs.github.com/en/pull-requests/how-tos/commit-changes/creating-a-commit-with-multiple-authorsgithub.com/chrisneagu/FTC-Skystone-Dark-Angels-Romania-2020github.com/Sfedfcv/redesigned-pancakegithub.com/klonnet23/helloy-wordgithub.com/jaityron/new-pac-wikigithub.com/ukasik123/Testscript-3git-scm.com/docs/git-interpret-trailersdocs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows
Answered live from GitHub & Hugging Face · anthropic/claude-haiku-5.5 · 10/25/2026

Ask your own open-source question →