answered from live GitHub & Hugging Face data
How can I implement a clear labeling system for AI-generated pull requests in my GitHub repository?
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)
- Create
ai-assistedwith a description such as "Contains code written or edited with an AI tool." - Create
ai-generatedfor PRs where an agent wrote most of the change. - 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
- Add a workflow that runs on pull request events. GitHub lists the supported
pull_requestactivity types in its events reference. - Detect AI involvement from the commit trailers in Step 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
- Add a
commit-msghook or a CI check. It should fail when a PR has AI-generated changes but noAssisted-byline. - 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.
- Choose the kernel-style
Assisted-bytrailer if you want a standard, tool-level record. - Choose
Co-authored-byif you want humans to keep contribution credit.
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.