answered from live GitHub & Hugging Face data

How do I use commit trailers like Co-authored-by to attribute AI-generated changes in GitHub?

Use Co-authored-by for people, and use a separate trailer to record AI assistance. GitHub only links Co-authored-by to a GitHub account. It does not define an AI-specific trailer, so you must choose and document one for your project.

What GitHub does with Co-authored-by

GitHub reads Co-authored-by trailers and shows every listed author on the commit. For a co-author's name to count toward their contribution graph, the email must be one associated with their GitHub.com account. If the person keeps their email private, use their GitHub no-reply address (GitHub Docs).

Steps: add a co-author on the command line

  1. Get the name and GitHub-linked email of each human co-author.
  2. Write the commit message subject and body. Add an empty line after the body.
  3. Add one trailer line for each co-author.
  4. Commit and push.
git commit -m "Refactor usability tests.

Co-authored-by: NAME <NAME@EXAMPLE.COM>
Co-authored-by: ANOTHER-NAME <ANOTHER-NAME@EXAMPLE.COM>"

The same format works in the GitHub web editor. Add each trailer line in the extended description box before you commit (GitHub Docs).

Recording AI assistance

Git treats any key: value line in the trailer block as a trailer. You can add your own key with git interpret-trailers (git docs). The example below uses Assisted-by, which is a project choice, not a GitHub standard:

git commit -m "Fix retry logic in sync worker

Assisted-by: Claude Code (model-id)
Co-authored-by: Jane Doe <jane@example.com>"

The Linux kernel sets a clear rule for AI. AI agents must not add Signed-off-by tags. Only the human submitter can certify the Developer Certificate of Origin. That human reviews the code, takes responsibility, and adds their own Signed-off-by (kernel docs). The kernel page I read does not name an AI trailer, so check your project's own rules before you pick one.

Recommendation

  1. Credit the accountable human with Co-authored-by or Signed-off-by, as your project requires.
  2. Record the tool and model with a plain trailer, such as Assisted-by. Write the rule in CONTRIBUTING.md so every contributor uses the same key.
  3. Never put an AI agent in Signed-off-by, if your project follows the kernel rule.

If you run more than one coding agent, give each agent its own identity. githug does this: each agent gets its own key and commits show the agent as author. Its commit trailers name the accountable human, the agent, and the run. Co-authored-by for the human is opt-in and off by default. The tool is in beta and free to use.

git-scm.com/docs/git-interpret-trailersdocs.kernel.org/process/coding-assistants.htmldocs.github.com/en/pull-requests/how-tos/commit-changes/creating-a-commit-with-multiple-authors
Answered live from GitHub & Hugging Face · anthropic/claude-haiku-5.5 · 11/23/2026

Ask your own open-source question →