Repository navigation
Closed
Labels
area:workflowDeveloper workflow, commands, rules, skillsbugSomething isn't workingeffort:smallLess than 1 hoursemver:patchBug fix, backward-compatible
Description
Description
AI agents (Cursor, Codex, etc.) inject their own identity into commits and PR messages in multiple ways:
- Adding
Co-authored-by: Cursor <[email protected]>trailers to commit messages - Setting themselves as git author/committer
- Mentioning agent names in PR descriptions
The current git_commit skill has a "NEVER add Co-authored-by" note, but agents still do it. There is no enforcement mechanism — the validate-commit-msg commit-msg hook does not check for agent fingerprints.
Steps to Reproduce
- Ask a Cursor agent or Codex worktree agent to commit staged changes
- Inspect the commit with
git log --format=fullorgit log --format='%b' - Observe
Co-authored-by: Cursor <[email protected]>trailer, or agent set as author/committer
Expected Behavior
Commits and PR messages contain zero traces of AI agent identity. A pre-commit or commit-msg hook actively rejects commits containing known agent fingerprints (e.g. cursor, claude, codex, chatgpt, copilot, cursoragent).
Actual Behavior
Agent identity leaks into commit trailers, author fields, and PR descriptions despite skill-level rules telling agents not to do it.
Environment
- All agent-driven commit flows: interactive
/git_commit, autonomousworktree_execute,worktree_ci-fix,worktree_pr
Possible Solution
- Extend
validate-commit-msg(or add a new pre-commit hook) to scan the full commit message for a blocklist of agent-related keywords/patterns:Co-authored-by,cursor,claude,codex,chatgpt,copilot,[email protected], etc. Reject the commit if any match is found. - Strengthen rules in
CLAUDE.md,git_commitSKILL, and all worktree skills. - Consider a
prepare-commit-msghook that stripsCo-authored-bytrailers automatically.
Changelog Category
Fixed
- TDD compliance (see
.cursor/rules/tdd.mdc)
Metadata
Metadata
Assignees
Labels
area:workflowDeveloper workflow, commands, rules, skillsbugSomething isn't workingeffort:smallLess than 1 hoursemver:patchBug fix, backward-compatible
Activity
gerchowl commentedon Feb 23, 2026
Design
Overview
Three enforcement layers to strip all AI agent identity from commits and PRs:
prepare-commit-msghook — auto-stripsCo-authored-bytrailers before the commit is finalizedcommit-msghook (extendvalidate-commit-msg) — rejects commits whose message body contains blocklisted agent patternspr-title-check) — scans PR title and body for agent fingerprintsCanonical blocklist:
.github/agent-blocklist.tomlSingle source of truth for all agent patterns, referenced by all hooks and CI.
Component 1:
prepare-commit-msghook (auto-strip trailers)A local pre-commit hook (stage:
prepare-commit-msg) that:COMMIT_EDITMSGtrailerpatterns from the blocklistRuns before
commit-msgvalidation, so trailers injected by the editor/agent are silently stripped.Component 2: Extend
validate-commit-msg(reject remaining fingerprints)Add a new validation step to the existing
validate_commit_message()function:blocked_patterns_file: Path | None(False, "Commit message contains blocked AI agent fingerprint: '<match>'")on first match--blocked-patterns <path>forwarded from pre-commit configThe
.pre-commit-config.yamlcommit-msg hook gains the new arg:Component 3: Pre-commit hook for author/committer identity
A new local pre-commit hook (stage:
pre-commit) implemented as a small Python script:.github/agent-blocklist.tomlGIT_AUTHOR_NAME,GIT_AUTHOR_EMAIL,GIT_COMMITTER_NAME,GIT_COMMITTER_EMAIL(from env) andgit config user.name/git config user.emailnamesoremailspattern (case-insensitive substring), reject with a clear errorAdded as a
localhook in.pre-commit-config.yaml.Component 4: Extend
pr-title-check.ymlCI workflowAdd a second step to the existing
pr-title-check.yml:${{ github.event.pull_request.body }}.github/agent-blocklist.tomlnamesandemailspatternsCan reuse a shared helper function extracted from
validate-commit-msg.Component 5: Strengthen skill rules
Update the "NEVER add Co-authored-by" notes in:
git_commit/SKILL.mdworktree_execute/SKILL.mdworktree_pr/SKILL.mdCLAUDE.mdReplace with: "Never add Co-authored-by trailers. Never set git author/committer to an AI agent identity. Never mention AI agent names in commit messages or PR descriptions. The pre-commit hooks will reject violations."
What this does NOT cover
Sync to workspace template
Both
.pre-commit-config.yamland.github/agent-blocklist.tomlare synced toassets/workspace/per the project's sync manifest pattern.test: add agent fingerprint rejection tests for validate-commit-msg
fix: reject AI agent identity fingerprints in validate-commit-msg
fix: block cursor.com and 'Made with Cursor' branding in validate-com…
fix: reject AI agent identity fingerprints in validate-commit-msg (#164)
gerchowl commentedon Feb 24, 2026
Implementation Plan
Issue: #163
Branch: bugfix/163-wrong-identity-tags
Tasks
.github/agent-blocklist.tomlwith trailers, names, emails patterns per design —.github/agent-blocklist.toml— verify:uv run python -c "import tomllib; tomllib.load(open(.github/agent-blocklist.toml,rb))"succeedsscripts/prepare-commit-msg-strip-trailers.py— verify: manual test strips Co-authored-by linepackages/vig-utils/src/vig_utils/validate_commit_msg.py— verify:uv run pytest packages/vig-utils/tests/test_validate_commit_msg.py -v -k agentscripts/check-agent-identity.py— verify: rejects when GIT_AUTHOR_EMAIL matches blocklist.pre-commit-config.yaml— verify:just precommitruns.github/workflows/pr-title-check.yml— verify: workflow file validscripts/manifest.toml— verify:just sync-workspacerunsCLAUDE.md,.cursor/skills/— verify: grep finds updated textCHANGELOG.md— verify: entry under Unreleasedfix(vigutils): AI agent identity enforcement — blocklist, prepare-com…
gerchowl commentedon Feb 24, 2026
Autonomous Run Complete
fix(vigutils): AI agent identity enforcement (#163) (#194)
c-vigo commentedon Feb 25, 2026
@gerchowl The fix does not seem consistent. PRs #200 and #201 do not mention Cursor, but the commit messages do, e.g. 6d9dca5
fix: correct IN_CONTAINER guard in workspace githooks (#239)
fix(ci): make commit-message enforcement real (#1026)
chore(ci): scaffold check-agent-identity and approve the perf commit …
chore(ci): wire check-pr-agent-fingerprints into commit-checks (#1058)
chore: release 1.2.0 (#253)
chore: release 1.2.0 (#1068)