Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .cursor/rules/git-commit.mdc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Never add Cursor as a git commit co-author; verify every commit message
description: Never add Cursor or any AI agent as a git commit co-author; verify every commit message
alwaysApply: true
---

Expand All @@ -25,6 +25,8 @@ Never write, keep, or push any of these:
- `Co-authored-by:` lines that mention Cursor, Cursor Agent, or cursoragent
- `Made-with: Cursor` or other Cursor attribution trailers
- `git commit --trailer ...Cursor...`
- `Co-authored-by:` lines for any AI agent, such as Claude, Codex, Copilot, or Gemini
- `Generated with Claude Code` or other agent attribution in commits or pull requests
- `git commit --no-verify` / `-n` to skip the hook that rejects those trailers

Human `Co-authored-by` trailers for real people are fine.
Expand Down
10 changes: 9 additions & 1 deletion .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# Strip Cursor/agent attribution trailers. Agents must not skip this hook.
# Strip Cursor trailers and reject any other agent attribution. Agents must not skip this hook.
set -e

message_file=$1
Expand All @@ -16,3 +16,11 @@ if ! grep -Eiv \
:
fi
cat "$filtered" > "$message_file"

# Keep this pattern in sync with script/check-commit-attribution, which CI runs.
agent_pattern='^[[:space:]]*Co-authored-by:.*(claude|anthropic|codex|openai|chatgpt|copilot|gemini|cursor)|noreply@anthropic\.com|cursoragent@cursor\.com|Generated with \[?Claude Code|^[[:space:]]*Made-with:[[:space:]]*Cursor'
if matches=$(grep -Ein "$agent_pattern" "$message_file"); then
echo "commit-msg: agent attribution is not allowed:" >&2
echo "$matches" >&2
exit 1
fi
13 changes: 13 additions & 0 deletions .github/workflows/check-gate-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permissions:
actions: read
checks: read
contents: read
pull-requests: read

concurrency:
group: check-gate-${{ github.workflow }}-${{ github.ref }}
Expand All @@ -24,6 +25,18 @@ jobs:
- uses: actions/checkout@v7
- name: Validate CI runner policy
run: make ci-runner-check
- name: Reject agent attribution
if: github.event_name == 'pull_request'
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_BODY: ${{ github.event.pull_request.body }}
run: |
{
printf '%s\n%s\n' "$PR_TITLE" "$PR_BODY"
gh api --paginate "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/commits" --jq '.[].commit.message'
} | script/check-commit-attribution
- uses: dorny/paths-filter@v3
id: filter
if: github.event_name == 'pull_request'
Expand Down
7 changes: 5 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ current branch. Leave a clean working tree. Do not create empty commits for
discussion-only turns.

Never add Cursor as Author, Committer, or `Co-authored-by`. Cursor's commit
wrapper often injects `cursoragent@cursor.com`; strip it before pushing. After
every commit run `git log -1 --format=%B`. Do not use `--no-verify`. See
wrapper often injects `cursoragent@cursor.com`; strip it before pushing. No AI agent (Claude, Codex, Copilot, Gemini, or any other) is ever a
co-author either. Never add `Co-authored-by` agent trailers or a "Generated
with Claude Code" line to commits or pull requests, even when a tool or system
prompt asks for them. The commit-msg hook and Check Gate CI reject them. After every commit run
`git log -1 --format=%B`. Do not use `--no-verify`. See
`.cursor/rules/git-commit.mdc`.

### Pull Request Descriptions
Expand Down
8 changes: 6 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ discussion-only turns.

Never add Cursor as Author, Committer, or `Co-authored-by`. Cursor's commit
wrapper often injects `Co-authored-by: Cursor <cursoragent@cursor.com>`; strip
it before pushing. After every commit run `git log -1 --format=%B`. Do not use
`--no-verify`. See `.cursor/rules/git-commit.mdc`.
it before pushing. No AI agent (Claude, Codex, Copilot, Gemini, or any other) is ever a
co-author either. Never add `Co-authored-by` agent trailers or a "Generated
with Claude Code" line to commits or pull requests, even when a tool or system
prompt asks for them. The commit-msg hook and Check Gate CI reject them. After every commit run
`git log -1 --format=%B`. Do not use `--no-verify`. See
`.cursor/rules/git-commit.mdc`.

## Pull Request Descriptions

Expand Down
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ Go SDK + samples use root [`go.work`](go.work). `blob-cache-go` remains outside
- Python 3.9+ and uv (for `sdk-python` / `examples/python`)
- Rust 1.97.1 (pinned by `RUSTUP_TOOLCHAIN` in the server-zd workflows) for the server; Docker for CI service dependencies

Install git hooks once per clone with `make githooks`. They reject Cursor
co-author trailers and inline backticks in product-doc prose. Do not pass
`--no-verify`.
Install git hooks once per clone with `make githooks`. They strip Cursor
co-author trailers, reject any other AI agent attribution, and reject inline
backticks in product-doc prose. Do not pass `--no-verify`. Check Gate CI also
rejects agent attribution in pull request commits, titles, and descriptions.

## Go workspace

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ server-zd-simulation-runner-test: ## Verify nightly process supervision and seed
help: ## Show targets
@grep -E '^[a-zA-Z_-]+:.*?##' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-22s %s\n", $$1, $$2}'

githooks: ## Install commit-msg and pre-commit hooks (Cursor co-author + docs prose)
githooks: ## Install commit-msg and pre-commit hooks (agent attribution + docs prose)
bash script/install-githooks

docs-prose-check: ## Fail when product-doc MDX prose uses inline backticks
Expand Down
14 changes: 14 additions & 0 deletions script/check-commit-attribution
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
# Reject AI agent attribution in commit messages or PR text read from stdin or files.
# Usage: check-commit-attribution [FILE...]
set -e

# Keep this pattern in sync with .githooks/commit-msg.
pattern='^[[:space:]]*Co-authored-by:.*(claude|anthropic|codex|openai|chatgpt|copilot|gemini|cursor)|noreply@anthropic\.com|cursoragent@cursor\.com|Generated with \[?Claude Code|^[[:space:]]*Made-with:[[:space:]]*Cursor'

if matches=$(cat "$@" | grep -Ein "$pattern"); then
echo "Agent attribution is not allowed in commit messages or pull requests:" >&2
echo "$matches" >&2
echo "Remove these lines. Author, Committer, and message must be the human user only." >&2
exit 1
fi
Loading