answered from live GitHub & Hugging Face data

How do I use commit trailers like Generated-by to differentiate AI-written code from human contributions in GitHub?

MaintMaintained · 6mo ago
Stars2
Issues0 open
MaintMaintained · 2mo ago
Stars0
Issues0 open
MaintMaintained · 2mo ago
Stars0
Issues0 open

GitHub does not give Generated-by any meaning. Use a trailer key that your team agrees on, and enforce it in your own tooling.

GitHub's docs give trailer meaning only to Co-authored-by and on-behalf-of. I found no GitHub feature that reads or filters Generated-by or Assisted-by.

What each trailer does

Trailer Who reads it Effect
Co-authored-by: Name <email> GitHub Adds a second author. The commit counts on that person's contribution graph only if the email is linked to their GitHub account (GitHub docs).
on-behalf-of: @org <email> GitHub Shows an organization badge. Requires a signed commit and a verified domain (same page).
Assisted-by: ... Kernel convention, tooling Discloses AI help. The kernel guide I read does not define this trailer.
Generated-by: ... No standard found Only your team's convention.

Git accepts any key made of letters, digits and hyphens (git-interpret-trailers). So both Assisted-by and Generated-by are valid syntax.

How to mark AI-written commits

  1. Pick one key. Use Assisted-by if you follow kernel-style rules. Otherwise, pick Generated-by and write it in your CONTRIBUTING.md.
  2. Put the trailer in a block after the body. Leave one blank line before the trailer block, as GitHub's example shows:
    git commit -m "Refactor usability tests.
    
    Split the fixture setup into a helper.
    
    Assisted-by: Claude Code (model-name)"
    
  3. Do not add Signed-off-by for AI. The kernel rule says AI agents must not add it. A human adds their own Signed-off-by to certify the Developer Certificate of Origin (kernel guide).
  4. Use Co-authored-by for humans only. Use it when a person co-wrote the change and their email is linked to GitHub. Do not use it as the AI marker.
  5. Check the trailers before you push.
    git log -1 --format=%B | git interpret-trailers --parse
    
  6. Automate the check. A commit-msg hook or CI job can reject commits that lack the key. I found one small project for this: bcmyguest/assisted-by. It is a Claude Code plugin that enforces the Assisted-by: trailer. It has 2 stars, was last pushed 166 days ago, and has no declared license (NOASSERTION). It is maintained, but adoption is very low. Review it before you depend on it.

Limits

Recommendation

Use Assisted-by: on every AI-assisted commit, and add a CI check that fails when it is missing. This follows the kernel's vocabulary, and the check makes the rule real. Use Generated-by: only if your own policy needs a different meaning.

If you want the agent's identity and the accountable human recorded for you, githug does this. Agent commits carry trailers that name the human, the agent and the run.

docs.kernel.org/process/coding-assistants.htmlgit-scm.com/docs/git-interpret-trailersdocs.kernel.org/process/submitting-patches.htmldocs.github.com/en/pull-requests/how-tos/commit-changes/creating-a-commit-with-multiple-authorsgithub.com/bcmyguest/assisted-bygithub.com/rokokol/ai-commit-trailers-skillgithub.com/quanxinwang18-a11y/pi-git-attributiongithub.com/JordanNewell/assisted-by
Answered live from GitHub & Hugging Face · anthropic/claude-haiku-5.5 · 11/29/2026

Ask your own open-source question →