Skip to content

fix: reject AI agent identity fingerprints in validate-commit-msg - #164

Merged
gerchowl merged 4 commits into
devfrom
bugfix/163-wrong-identity-tags
Feb 24, 2026
Merged

gerchowl merged 4 commits into
devfrom
bugfix/163-wrong-identity-tags

Conversation

@gerchowl

@gerchowl gerchowl commented Feb 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

Extend validate-commit-msg to actively reject commits containing AI agent identity fingerprints (Co-authored-by trailers, cursoragent, claude, codex, chatgpt, copilot). The commit-msg hook now blocks these patterns before any other validation.

Closes #163

Type of Change

  • fix -- Bug fix

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • Added _contains_agent_fingerprint() to scan full commit message for blocklist patterns
  • Blocklist: Co-authored-by, cursoragent, claude, codex, chatgpt, copilot (case-insensitive; agent names as whole words)
  • Agent check runs first, before subject/body/Refs validation
  • 6 new tests in TestAgentFingerprints (TDD)

Changelog Entry

Fixed

  • validate-commit-msg rejects AI agent identity fingerprints (#163)
    • Commit-msg hook now rejects commits containing Co-authored-by, cursoragent, claude, codex, chatgpt, copilot
    • Enforced before other validation; applies to full message including subject-only mode

Testing

  • Tests pass locally (uv run pytest packages/vig-utils/tests/test_validate_commit_msg.py — 121 passed)
  • Manual testing: commit with Co-authored-by: Cursor <[email protected]> rejected

Manual Testing Details

echo -e "feat: add x\n\nRefs: #163\n\nCo-authored-by: Cursor <[email protected]>" > /tmp/msg
uv run validate-commit-msg /tmp/msg
# Exit 1, error about agent fingerprint

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have updated CHANGELOG.md in the [Unreleased] section
  • I have added tests that prove my fix is effective
  • New and existing unit tests pass locally

Refs: #163

@gerchowl
gerchowl merged commit 2bc231d into dev Feb 24, 2026
12 of 14 checks passed
@gerchowl
gerchowl deleted the bugfix/163-wrong-identity-tags branch February 24, 2026 15:03
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