Skip to content

feat: optional validation — Co-Authored-By trailer, if present, must specify a human, not an AI agent #2

Description

@javier-godoy

Summary

As AI-assisted development becomes more common, commit messages may include Co-Authored-By: trailers that credit AI agents (GitHub Copilot, Claude, etc.). The Co-Authored-By trailer is a Git convention for crediting human co-authors, and crediting an AI agent with this trailer misrepresents authorship.

This issue requests an optional validation rule that fails a commit if any Co-Authored-By trailer names a known AI agent instead of a human.

Proposed Behavior

When the feature is enabled, the action should:

  1. Parse the commit body for Git trailers — lines of the form Token: value appearing after a blank line.
  2. For each Co-Authored-By: Name <email> trailer found, check whether Name or email matches a known AI agent pattern.
  3. If a match is found, fail the commit with a message such as:

    Co-Authored-By trailer must specify a human author, not an AI agent

The check must be opt-in (disabled by default), enabled via an action input, for example:

- uses: FlowingCode/action-conventional-commits@vX.Y.Z
  with:
    disallow-ai-coauthors: true

Known AI Agent Patterns (initial list)

The detection should cover at least the following well-known patterns (name or email):

Agent Typical trailer value
Anthropic Claude ... <noreply@anthropic.com>
GitHub Copilot GitHub Copilot <copilot@github.com>
GitHub Actions bot ... <...github-actions[bot]...>
Generic bot accounts name or email containing [bot]

The list should be extensible (e.g., a hardcoded array in source that can grow over time).

Acceptance Criteria

  • The feature is disabled by default; existing users see no behavior change.
  • When enabled, commits with a Co-Authored-By trailer matching a known AI agent pattern are rejected with a clear error message.
  • Commits with no Co-Authored-By trailer, or with a trailer that does not match any AI pattern, pass normally.
  • Unit tests cover: no trailer, human trailer, known AI trailer (each known agent), and unknown email (should pass).
  • action.yml is updated with a documented disallow-ai-coauthors boolean input (default false).
  • README documents the new input and the validation rule.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions