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
7 changes: 7 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ page that documents it.

| Version | What changed | Documented in |
|---|---|---|
| [2.25.0](#v2250) | Risky settings in committed coding agent config files reported: MCP servers approved without asking, another API endpoint, full access, workflows anyone can start (opt-in) | [Agent config rules](rules.md#agent-config-rules) · [`[agent]`](configuration.md#agent) |
| [2.24.2](#v2242) | A Bitbucket Pipelines pipe runs `commit-check-ci` in a step with no install | [Bitbucket Pipelines](guides/other-ci.md#bitbucket-pipelines) |
| [2.24.0](#v2240) | `body_max_line_length` limits the length of a body line (opt-in); the JSON lists settings that are not in force in `notices` | [CC018](rules.md#cc018) · [Reading the JSON](example.md#reading-the-json) |
| [2.23.1](#v2231) | git's `Revert "..."` and `Reapply "..."` commits pass; `revert` is a default type again; several failures quote the message once | [CC001](rules.md#cc001) · [CC004](rules.md#cc004) · [CC007](rules.md#cc007) |
Expand Down Expand Up @@ -47,6 +48,12 @@ page that documents it.
| [2.5.0](#v250) | Organization-wide config with `inherit_from` | [Across an organization](guides/organization.md) |
| [2.0.0](#v200) | Configuration moved from YAML to TOML — breaking | [Migrating from v1](migration.md) |

## v2.25.0 (2026-11-27) { #v2250 }
Comment thread
shenxianpeng marked this conversation as resolved.
Resolved

### Added

* With `[agent] enabled = true`, `--files` reads the coding agent config files a commit touches (Claude Code, Codex, Gemini CLI, Cursor CLI, GitHub Copilot in VS Code and the Claude Code GitHub Action) and reports MCP servers approved without asking (CC601), API requests sent to another endpoint (CC602), an agent that runs without asking or without a sandbox (CC603), and an agent workflow anyone can start (CC604); `allow_mcp_servers` and `allow_api_endpoints` let named servers and endpoints through. ([Agent config rules](rules.md#agent-config-rules), [#744](https://github.com/commit-check/commit-check/pull/744))

## v2.24.2 (2026-11-24) { #v2242 }

### Added
Expand Down
2 changes: 1 addition & 1 deletion docs/compare/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Replace the hook:
```yaml title=".pre-commit-config.yaml"
repos:
- repo: https://github.com/commit-check/commit-check
rev: v2.24.2
rev: v2.25.0
hooks:
- id: check-message
```
Expand Down
17 changes: 16 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ Used from a hook definition, with no config file anywhere in the repository:
```yaml title=".pre-commit-config.yaml"
repos:
- repo: https://github.com/commit-check/commit-check
rev: v2.24.2
rev: v2.25.0
hooks:
- id: check-message
args:
Expand Down Expand Up @@ -333,6 +333,9 @@ The full mapping between the three forms:
| `max_size = "5MB"` (in files section) | `CCHK_FILES_MAX_SIZE=5MB` | `--files-max-size=5MB` |
| `prohibited_patterns = ["*.pem"]` (in files section) | `CCHK_FILES_PROHIBITED_PATTERNS=*.pem,.env` | `--files-prohibited-patterns=*.pem,.env` |
| `max_path_length = 250` (in files section) | `CCHK_FILES_MAX_PATH_LENGTH=250` | `--files-max-path-length=250` |
| `enabled = true` (in agent section) | `CCHK_AGENT_ENABLED=true` | `--agent-enabled=true` |
| `allow_mcp_servers = ["github"]` (in agent section) | `CCHK_AGENT_ALLOW_MCP_SERVERS=github,notes` | `--agent-allow-mcp-servers=github,notes` |
| `allow_api_endpoints = ["https://llm.example.com"]` (in agent section) | `CCHK_AGENT_ALLOW_API_ENDPOINTS=https://llm.example.com` | `--agent-allow-api-endpoints=https://llm.example.com` |

## Which value wins

Expand Down Expand Up @@ -466,6 +469,18 @@ Action do not check signatures; see [Verified commits](guides/github-app.md#veri

{.fields}

### `[agent]`

Read by `--files`. See [Agent config rules](rules.md#agent-config-rules).

| Option | Type | Default | Description |
|---|---|---|---|
| `enabled` | bool | false | Report risky settings in the coding agent config files a commit touches: MCP servers approved without asking ([CC601](rules.md#cc601)), API requests sent to another endpoint ([CC602](rules.md#cc602)), commands run without asking or outside the sandbox ([CC603](rules.md#cc603)), and agent workflows anyone can start ([CC604](rules.md#cc604)). |
| `allow_mcp_servers` | list[str] | [] (none allowed) | MCP servers, by name, that a committed setting may approve (CC601). A setting that approves every server is reported whatever the list holds. |
| `allow_api_endpoints` | list[str] | [] (none allowed) | API endpoint URLs a committed setting may send requests to (CC602), such as your company's LLM gateway. Matched exactly; a trailing slash is ignored. |

{.fields}

### `[pull_request]`

| Option | Type | Default | Description |
Expand Down
2 changes: 1 addition & 1 deletion docs/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pushed:
```yaml title=".pre-commit-config.yaml"
repos:
- repo: https://github.com/commit-check/commit-check
rev: v2.24.2
rev: v2.25.0
hooks:
- id: check-no-force-push
stages: [pre-push]
Expand Down
18 changes: 17 additions & 1 deletion docs/guides/ai-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A coding agent commits more often than a person, and when a hook rejects a
commit it can reach for `git commit --no-verify` to get past it. Agents that
work in the cloud often run no hook at all. Four layers keep the policy in
place, cheapest first. Only the last one cannot be skipped.
place, cheapest first. Only the check on the pull request cannot be skipped.

## Tell the agent

Expand Down Expand Up @@ -196,3 +196,19 @@ and a commit that skipped the hook still cannot merge, since both look at every
commit of the pull request. The App's check is named **Commit Check**
([enforcing it](github-app.md#enforcing-it)); the Action's takes its job's
name, `commit-check` in [the example](github-actions.md#making-it-a-required-check).

## Check the agent's own settings

The files that configure an agent live in the repository too, and one commit
to them changes what the agent does for everyone who opens it: an MCP server
approved in advance, requests sent to another endpoint, the sandbox turned off,
or anyone allowed to start the agent in CI. With `[agent] enabled = true`,
`--files` reports those settings in each commit that touches them, wherever it
runs: the `check-files` [pre-commit hook](pre-commit.md) or a CI job. The
[agent config rules](../rules.md#agent-config-rules) list the agents and
settings covered.

```toml title="cchk.toml"
[agent]
enabled = true
```
2 changes: 1 addition & 1 deletion docs/guides/github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ has one needs no Action-specific configuration.
| `branch` | `true` | Check the branch name |
| `author-name` | `false` | Check each commit's author name |
| `author-email` | `false` | Check each commit's author email |
| `files` | `false` | Check the files each commit changes against the [`[files]` rules](../rules.md#push-rules) of `cchk.toml` (size, prohibited paths, path length). Needs `fetch-depth: 0`: a commit the clone holds without its parent is skipped. Since v2.24.0 |
| `files` | `false` | Check the files each commit changes against the [`[files]` rules](../rules.md#push-rules) of `cchk.toml` (size, prohibited paths, path length) and, when enabled, the [`[agent]` rules](../rules.md#agent-config-rules). Needs `fetch-depth: 0`: a commit the clone holds without its parent is skipped. Since v2.24.0 |
| `pr-title` | `false` | Check the pull request title, the one that matters for squash merges, against the message rules a one-line title can meet: every `message` rule except a body (CC011), a sign-off (CC012) and an AI author (CC017). Pull request events only |
| `message-ai-attribution` | `false` | Check every commit against the [AI rules](policies.md#checking-ai-attribution-and-nothing-else) of `cchk.toml` (`ai_attribution`) only, author included, without the format rules. Takes the place of `message` |
| `pr-body-ai-attribution` | `false` | Check the [pull request description](policies.md#checking-a-pull-request-description) against the AI rules of `cchk.toml`, and its [AI declaration boxes](../rules.md#cc501) when `[pull_request] ai_declaration_checkboxes` is set. Pull request events only |
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/github-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ The App reads the same file the CLI reads, as it stands at the head of the
push or pull request, in the same four places: `cchk.toml`, `commit-check.toml`, `.github/cchk.toml`,
`.github/commit-check.toml`. Every option on the
[configuration page](../configuration.md) that belongs to a rule the App runs
applies, precedence included; the `[push]`, `[files]` and `[tag]` sections are
read but have nothing to act on here. Nothing is App-specific to set apart
applies, precedence included; the `[push]`, `[files]`, `[agent]` and `[tag]`
sections are read but have nothing to act on here. Nothing is App-specific to set apart
from `[pull_request]` (above), `[jira]` and `[commit] require_verified` (below);
the CLI and the Action ignore them, except `[pull_request] ai_declaration_checkboxes`
([CC501](../rules.md#cc501)), which all three read.
Expand Down
12 changes: 6 additions & 6 deletions docs/guides/other-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ there:
| `branch` | `true` | The name of the source branch, and `require_rebase_target` if it is set. |
| `author-name` | `false` | The author name of every commit. |
| `author-email` | `false` | The author email of every commit. |
| `files` | `false` | The files every commit changes, against the [`[files]` rules](../rules.md#push-rules). |
| `files` | `false` | The files every commit changes, against the [`[files]` rules](../rules.md#push-rules) and, when enabled, the [`[agent]` rules](../rules.md#agent-config-rules). |
| `pr-title` | `false` | The title, with the message rules a one-line title can meet. |
| `pr-body-ai-attribution` | `false` | The description, against the AI attribution rules. |

Expand Down Expand Up @@ -197,7 +197,7 @@ pipelines:
clone:
depth: full
script:
- pipe: commit-check/commit-check:2.24.2
- pipe: commit-check/commit-check:2.25.0
```

The pipe runs `commit-check-ci` from the commit-check release of the same
Expand All @@ -224,12 +224,12 @@ Each check is a variable, with the same defaults as the
| `BRANCH` | `true` | The name of the source branch, and `require_rebase_target` if it is set. |
| `AUTHOR_NAME` | `false` | The author name of every commit. |
| `AUTHOR_EMAIL` | `false` | The author email of every commit. |
| `FILES` | `false` | The files every commit changes, against the [`[files]` rules](../rules.md#push-rules). |
| `FILES` | `false` | The files every commit changes, against the [`[files]` rules](../rules.md#push-rules) and, when enabled, the [`[agent]` rules](../rules.md#agent-config-rules). |
| `PR_TITLE` | `false` | The title, with the message rules a one-line title can meet. |
| `PR_BODY_AI_ATTRIBUTION` | `false` | The description, against the AI attribution rules. |

```yaml
- pipe: commit-check/commit-check:2.24.2
- pipe: commit-check/commit-check:2.25.0
variables:
AUTHOR_EMAIL: 'true'
BRANCH: 'false'
Expand Down Expand Up @@ -271,7 +271,7 @@ with the **Pull requests: Read** scope, store it as a secured repository
variable named `BITBUCKET_ACCESS_TOKEN`, and switch the two checks on:

```yaml
- pipe: commit-check/commit-check:2.24.2
- pipe: commit-check/commit-check:2.25.0
variables:
PR_TITLE: 'true'
PR_BODY_AI_ATTRIBUTION: 'true'
Expand Down Expand Up @@ -356,7 +356,7 @@ steps:
builds a branch policy started.
- Add `--author-name --author-email` to the `commit-check` call in the loop
to check each commit's author as well, and `--files` to check the files
each commit adds (configured in the `[files]` section).
each commit adds (configured in the `[files]` and `[agent]` sections).
- The branch check also covers `require_rebase_target` (CC202), which needs
the target branch in the clone as `origin/<branch>`. Without it the rule
reports itself as skipped (`rebase target 'main' not found`) and the job
Expand Down
8 changes: 4 additions & 4 deletions docs/guides/pre-commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Add Commit Check to `.pre-commit-config.yaml`:
```yaml title=".pre-commit-config.yaml"
repos:
- repo: https://github.com/commit-check/commit-check
rev: v2.24.2
rev: v2.25.0
hooks:
- id: check-message
- id: check-branch
Expand Down Expand Up @@ -41,7 +41,7 @@ That is it. The next malformed commit message is rejected before it exists.
| `check-author-name` | `pre-commit` | [CC101](../rules.md#cc101) |
| `check-author-email` | `pre-commit` | [CC102](../rules.md#cc102) |
| `check-no-force-push` | `pre-push` | [CC301](../rules.md#cc301) |
| `check-files` | `pre-push` | [CC302–CC304](../rules.md#push-rules) |
| `check-files` | `pre-push` | [CC302–CC304](../rules.md#push-rules), [CC601–CC604](../rules.md#agent-config-rules) |
| `check-tag` | `pre-push` | [CC401](../rules.md#cc401) |

The three `pre-push` hooks need their own install too:
Expand All @@ -68,7 +68,7 @@ Options can be passed as hook arguments, which keeps everything in one file:
```yaml title=".pre-commit-config.yaml"
repos:
- repo: https://github.com/commit-check/commit-check
rev: v2.24.2
rev: v2.25.0
hooks:
- id: check-message
args:
Expand All @@ -90,7 +90,7 @@ colon, and lets the commit through:
```yaml title=".pre-commit-config.yaml"
repos:
- repo: https://github.com/commit-check/commit-check
rev: v2.24.2
rev: v2.25.0
hooks:
- id: check-message
args: [--fix]
Expand Down
Loading