Skip to content

Reject AI agent attribution in commits and pull requests - #1148

Merged
longquanzheng merged 1 commit into
mainfrom
reject-agent-attribution
Oct 31, 2026
Merged

longquanzheng merged 1 commit into
mainfrom
reject-agent-attribution

Conversation

@longquanzheng

@longquanzheng longquanzheng commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • .githooks/commit-msg still strips Cursor trailers, and now rejects any other AI agent attribution: Co-authored-by trailers for Claude, Codex, Copilot, Gemini, OpenAI, or Anthropic, and Claude Code generation footers.
  • New script/check-commit-attribution applies the same check to text on stdin. Check Gate CI runs it on every pull request's title, description, and commit messages, so a commit made without the hook still cannot merge.
  • CLAUDE.md, AGENTS.md, and .cursor/rules/git-commit.mdc state the rule for every agent, and CONTRIBUTING.md and the Makefile help describe the hook.

Why

Agent co-author trailers reached main through squash merges (c425bb9, ea1ad39, f2e9dd6) even though the repository rule says the commit author, committer, and message must be the human user only. The existing hook only handled Cursor. This makes the rule enforced, locally and in CI.

Testing

  • shellcheck on both scripts.
  • The hook rejects a Claude Co-authored-by trailer, strips a Cursor trailer and accepts the result, and accepts a plain message.
  • The CI script rejects a Claude Code generation footer.
  • The Check Gate step runs for the first time on this pull request.

@longquanzheng longquanzheng reopened this Oct 31, 2026
@longquanzheng
longquanzheng merged commit e3f1493 into main Oct 31, 2026
12 of 15 checks passed
@longquanzheng
longquanzheng deleted the reject-agent-attribution branch October 31, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant