---
id: scan-secrets
track: coding
version: 0.1.3
label: blocks
keyword: block
where: write turn-end
sha256: c7cf363c6eb8a8ed47287beef9c06fe76dfd2d9c0ccc203fe74e32fba0e92a94
source: https://github.com/open-coder-ai/chock-catalog/tree/1e60d211c1bb767152c6ab0167932da06ab3a10f/base/scan-secrets
catalog_ref: 1e60d211c1bb767152c6ab0167932da06ab3a10f
---

# Scan Secrets

scan-secrets · version 0.1.3

Blocks — Blocks on an agent's file writes and at turn end. Chock adds friction. It is not a security boundary. 

In a git repo: at commit (Chock refuses the commit, locally and in CI.)



## What it does

Blocks credentials: vendor tokens (AWS, GitHub, GitLab, Slack, OpenAI, HF, ...), JWTs, private-key and PGP blocks, named key/token/secret/password values (JSON, YAML, env, HCL, code), URI creds, Authorization literals, CLI password flags; files by path (.env*, keys). Misses: split or encoded values, quoted values with spaces, unlisted names, reference- or placeholder-like values. Runs: commit, agent write, turn end. Pragma same line; agent: only if in HEAD; MCP gateway: never.

## Its label on each agent

- Claude Code (tested): Blocks — Blocks on an agent's file writes and at turn end. Builder: /coding/builder/#client=claude-code&p=scan-secrets
- Cursor (tested): Blocks — Blocks on an agent's file writes and at turn end. Builder: /coding/builder/#client=cursor&p=scan-secrets
- Codex (tested): Blocks — Blocks on an agent's file writes and at turn end. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run). Builder: /coding/builder/#client=codex&p=scan-secrets
- GitHub Copilot (tested): Blocks — Blocks at turn end only. It does not check a file write when it happens. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run). Builder: /coding/builder/#client=copilot&p=scan-secrets
- Devin (tested): Blocks — Blocks at turn end only. It does not check a file write when it happens. If the hook errors, the action goes through (vendor docs only, not witnessed). Builder: /coding/builder/#client=devin&p=scan-secrets
- Grok (tested): Not graded yet for Grok. Builder: /coding/builder/#client=grok&p=scan-secrets
- goose (tested): Not graded yet for goose. Builder: /coding/builder/#client=goose&p=scan-secrets
- Antigravity (tested): Not graded yet for Antigravity. Builder: /coding/builder/#client=antigravity&p=scan-secrets
- OpenHands (untested): Not graded yet for OpenHands. Builder: /coding/builder/#client=openhands&p=scan-secrets
- Kimi Code (untested): Not graded yet for Kimi Code. Builder: /coding/builder/#client=kimi-code&p=scan-secrets
- Factory Droid (untested): Not graded yet for Factory Droid. Builder: /coding/builder/#client=factory-droid&p=scan-secrets

## What it misses

Split or encoded values, quoted values with spaces, unlisted names, reference- or placeholder-like values.

## Examples

- Refused: A staged file contains an AWS access key ID pattern.
- Allowed: A commit adds a source file containing the word 'password' in a comment without a secret value.

## Latest change

0.1.3 · 2026-10-25 — Hardening (SR-2d2d): a \`-p\<password\>\` argument is now refused for the whole mysql and mariadb client family (mysql, mysqldump, mysqladmin, mysqlsh, mysqlpump, mysqlimport, mysqlcheck, mysqlshow, mysqlslap, mysqlbinlog, mariadb and mariadb-dump, -admin, -import, -check, -show, -slap, -binlog), and sshpass keeps its \`-p \<password\>\` and \`-p\<password\>\` forms. The match stays inside the tool's own command: a pipe, \`;\` or \`&\` ends it, so \`mysqldump db | ssh -p2222 host\` and \`mysqldump db && tar -pxzf a.tar\` no longer read the next command's -p as a password. -p on mkdir, ssh, tar and cp was never matched. A mysql-family \`-p\` followed by a separate word is a prompt plus a database name, so it stays allowed. Tests: test_scan_secrets_sr2d2.py; eval case tc-059.

## Provenance

- Tested by 59 of 59 cases run automatically
- SHA-256: `c7cf363c6eb8a8ed47287beef9c06fe76dfd2d9c0ccc203fe74e32fba0e92a94`
- Catalog commit: https://github.com/open-coder-ai/chock-catalog/commit/1e60d211c1bb767152c6ab0167932da06ab3a10f
- Source: https://github.com/open-coder-ai/chock-catalog/tree/1e60d211c1bb767152c6ab0167932da06ab3a10f/base/scan-secrets (catalog path `base/scan-secrets`)
- Presets: Secrets
- JSON: `/api/coding/policies/scan-secrets.json`
- Report a problem: https://chock.sh/report/?policy=scan-secrets&version=0.1.3&page=%2Fcoding%2Fpolicies%2Fscan-secrets%2F
