Skip to content

ci: enforce commit signing and reject agent attribution in commits #5831

Open

Description

@purp

User Story

I maintain OpenShell and review PRs from org members and collaborators every day. I need the repository to enforce its own contribution rules on commits, so reviewers don't have to check signatures and commit trailers by eye.

Description

Two commit rules are documented but not enforced anywhere:

  1. Cryptographic commit signing. CONTRIBUTING.md ("DCO sign-off is separate from cryptographic commit signing") and CI.md#commit-signing say org members and collaborators sign their commits. No rule or workflow checks it: none of the repository rulesets (dco, main-integrity, docs-website, main) has required_signatures, mise run pre-commit only runs format, lint, and license checks, and the DCO check covers only the Signed-off-by trailer. PR #5550 currently carries an unsigned commit (d6d57f0dc), and no check flags it.
  2. No agent attribution. AGENTS.md says never to mention Claude or any AI agent in commits, PR descriptions, or issues (no author attribution, no Co-Authored-By, no "Generated with" footers). Nothing checks this either, and agent harnesses add these footers by default.

Proposed behavior

Add a required PR check, Commit Policy, that fails with a message naming the offending commit and the rule:

  • Signing: every commit the PR adds must show GitHub verification verified: true, when its author is an org member or collaborator with write access or higher. External contributors and bot authors (for example Dependabot) are exempt, matching the existing docs.
  • Attribution: no commit message, PR title, or PR body may contain a Co-authored-by: trailer naming an AI agent, or a "Generated with ..." agent footer. Applies to all authors.

Notional output:

Commit Policy: 2 problems
  d6d57f0dc  not cryptographically signed (author is a collaborator); see CI.md#commit-signing
  a1b2c3d4e  Co-authored-by trailer names an AI agent; see AGENTS.md

Context

  • Related: CONTRIBUTING.md#dco, CI.md#commit-signing, AGENTS.md (Commits section).
  • A required_signatures rule on the main ruleset (managed in ai-openshell/infra) is complementary but not sufficient: it cannot exempt external contributors and does not cover attribution. It also acts at merge time, while a PR check gives feedback while the author can still fix the commits.
  • Open question for maintainers: which agent names and domains the attribution check should recognize. The proposed starting list is Claude, Anthropic, Copilot, Codex, Cursor, Gemini, and noreply addresses of those vendors, kept in one place so it is easy to extend.

Definition of Done

  • Commit Policy runs on pull requests and in the merge queue.
  • An unsigned commit by an org member or collaborator fails the check.
  • An unsigned commit by an external contributor or a bot does not fail the check.
  • A Co-authored-by: trailer or "Generated with" footer naming an agent fails the check, in a commit message or the PR title or body.
  • Unit tests cover each rule and each exemption.
  • CI.md and CONTRIBUTING.md describe the check and how to fix a failure.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions