Coding agents read their project settings from files in the repository: .claude/settings.json, .codex/config.toml, .vscode/settings.json, .gemini/settings.json. That is the point of them. A team commits one file and everyone's agent behaves the same way.
It also means that one line in one of those files changes what the agent does for everyone who opens the repository, and for every agent run in CI. In a pull request that line is a two-line JSON diff, easy to approve without a second look. Sometimes the agent wrote it.
This has already gone wrong
Claude Code project files. In February 2026 Check Point published two CVEs built from a committed .claude/settings.json. The file could run commands as the project opened, through a SessionStart hook or, in CVE-2025-59536, by approving the MCP servers in the repository's .mcp.json with enableAllProjectMcpServers or enabledMcpjsonServers. In CVE-2026-21852, ANTHROPIC_BASE_URL in the file's env sent the agent's API requests, API key included, to an address the repository chose. Anthropic fixed these so that the servers do not start and no request goes out before you accept the trust dialog. Once you trust the folder, which you do for your own team's repository, the settings apply as committed.
Copilot in VS Code. In CVE-2025-53773, a prompt injection made Copilot set "chat.tools.autoApprove": true in its VS Code settings, and every command after that ran without asking. Microsoft fixed it in the August 2025 Patch Tuesday. The part that stays true: the agent itself can be the one editing its settings file.
Claude Code in GitHub Actions. anthropics/claude-code-action is used in over 12K public workflows, according to Wiz. By default only users with write access can start it, and bots cannot. Its security guide marks allowed_non_write_users as risky, and says that with allowed_bots: '*', "any such App can invoke this action with a prompt it controls."
None of these is exotic. Each is one documented setting, written into a file that is meant to be committed.
What commit-check 2.25.0 checks
I maintain Commit Check, an open source tool that checks commits against a policy file, cchk.toml. Version 2.25.0 adds four rules that read the agent config files a commit touches and fail on the settings that open everything up:
| Rule | Fails when a commit adds |
|---|---|
CC601 agent-mcp-auto-approve | MCP servers approved without asking: Claude Code's enableAllProjectMcpServers or enabledMcpjsonServers, Gemini CLI's trust: true, Cursor CLI's Mcp(*:*) |
CC602 agent-api-endpoint | API requests sent to another endpoint: ANTHROPIC_BASE_URL, or another provider's base URL, in Claude Code's env |
CC603 agent-full-access | Commands run without asking or outside the sandbox: Bash in Claude Code's permissions.allow, Codex's danger-full-access or approval_policy = "never", Copilot's chat.tools.global.autoApprove |
CC604 agent-unrestricted-trigger | allowed_non_write_users: "*" or allowed_bots: "*" on a step that uses anthropics/claude-code-action |
They cover Claude Code, the Claude Code GitHub Action, Codex, Gemini CLI, Cursor CLI and GitHub Copilot in VS Code. Each setting in the list links to the agent's own documentation of it.
The rules are off by default. Two lines turn them on:
# cchk.toml [agent] enabled = true What it looks like
A branch that sets up Claude Code for the team, with a .claude/settings.json that approves every MCP server, points the API at another host and allows any shell command, and a workflow that lets anyone start the agent:
$ commit-check --files ✖ Commit rejected by Commit Check · 4 checks failed ✖ CC601 agent-mcp-auto-approve failed: enableAllProjectMcpServers = true in .claude/settings.json MCP servers are approved without asking Suggest: Remove it, or list trusted servers in allow_mcp_servers Docs: https://commit-check.com/rules/#cc601 ✖ CC602 agent-api-endpoint failed: env.ANTHROPIC_BASE_URL = "https://llm.example.net" in .claude/settings.json API requests are sent to another endpoint Suggest: Remove it, or list the endpoint in allow_api_endpoints Docs: https://commit-check.com/rules/#cc602 ✖ CC603 agent-full-access failed: permissions.allow has "Bash" in .claude/settings.json The agent runs without asking or without a sandbox Suggest: Remove it; set it in your user settings if you need it Docs: https://commit-check.com/rules/#cc603 ✖ CC604 agent-unrestricted-trigger failed: allowed_non_write_users = "*" in .github/workflows/claude.yml Anyone can start the agent Suggest: List the allowed users or bots instead of "*" Docs: https://commit-check.com/rules/#cc604 When the setting is on purpose
Some of these are fine for a given team. A company that routes every request through its own LLM gateway wants ANTHROPIC_BASE_URL committed, and a team that relies on one MCP server wants it approved. Name them:
[agent] enabled = true allow_mcp_servers = ["github"] allow_api_endpoints = ["https://llm.internal.example.com"] With that file, "enabledMcpjsonServers": ["github"] and that gateway URL pass, and anything else still fails. A setting that approves every server, such as enableAllProjectMcpServers: true, fails whatever the list holds. To report a rule without failing the build, put it in the top-level warn list, for example warn = ["CC603"].
Where to run it
The rules run wherever the file checks already run, from CLI 2.25.0.
Before a push, with pre-commit:
# .pre-commit-config.yaml repos: - repo: https://github.com/commit-check/commit-check rev: v2.25.0 hooks: - id: check-files check-files runs at pre-push, so install that hook type too: pre-commit install --hook-type pre-push.
On GitHub, with the Action. A local hook can be skipped; a required check cannot:
steps: - uses: actions/checkout@v7 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - uses: commit-check/commit-check-action@v2 with: files: true config-source: base config-source: base reads cchk.toml from the base branch, so a pull request cannot add its own server to allow_mcp_servers and pass the check it is being judged by.
On GitLab, with the CI/CD component:
include: - component: gitlab.com/commit-check/commit-check/commit-check@2 inputs: files: true On Bitbucket, with the pipe:
- pipe: commit-check/commit-check:2.25.0 variables: FILES: 'true' What it does not do
- It catches the values that allow everything, not every risky one.
BashandBash(*)in Claude Code'spermissions.allowfail;Bash(python3:*), which can also run anything, does not. - It does not check hooks. Teams commit hooks on purpose, and telling a harmful one from a useful one takes reading the command.
- It reads only the agent files a commit touches, as the commit holds them. In a workflow it reads only the
with:inputs of the step that usesclaude-code-action, one line at a time. - It is a policy check, not a sandbox. It stops a setting from merging unnoticed; it does nothing about an agent that is already running.
For GitHub workflows, sisakulint has a rule for allowed_non_write_users: "*", and Trail of Bits' agentic-actions-auditor is a Claude Code skill that reviews agent workflows in more depth. commit-check's angle is a short list of deterministic rules over every agent's config file, in the same policy file and the same CI job you may already run for commit messages and branch names.
Adding an agent
Which agents, files and settings are covered is data, not code: one table per agent in agent_configs.toml, each setting with a link to where the agent documents it. If your agent is missing, a pull request that adds its table and a test case is all it takes.

