---
id: scan-secrets
track: coding
version: 0.1.5
label: blocks
keyword: block
where: write turn-end
sha256: 9d99cab3f5657d37554d6bd899396d95847825c7ff0d8ec4bd3f850a4a5e8a00
source: https://github.com/open-coder-ai/chock-catalog/tree/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4/base/scan-secrets
catalog_ref: e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4
---

# Scan Secrets

scan-secrets · version 0.1.5

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-, placeholder- or expression-like values (a call, a subscript, a member chain). 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-, placeholder- or expression-like values (a call, a subscript, a member chain).

## 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.5 · 2026-11-15 — Code that handles a password is no longer refused (SS-1; hardening review of 2026-11-15, REVIEW-secrets sections 4 and 4b). The two bare alternatives, \`password\[=:\]\<12+ characters\>\` and \`(api|secret|auth)\[_-\]?(key|token)\[=:\]\<20+ characters\>\`, matched any run of characters, so \`password = getpass.getpass()\`, \`password = request.json\["password"\]\`, \`password: formData.get("password"),\` and \`password: \<your-password\>\` were blocked. They now match a literal value: silent on a placeholder (\`\<...\>\`, \`***\`, \`xxxx\`, \`...\`, \`%(\`, \`#{\`, \`\[\[\`, your/example/changeme/redacted/null words) and on an expression (an identifier chain followed by \`(\`, \`\[\` or \`\<\`; a member chain without a digit such as \`event.target.value\`; for key and token also a snake_case or UPPER_CASE name). \`password::\` is a path, not an assignment. Provider formats, the named key rule, the quoted alternatives and the command-password alternatives are unchanged. Misses text now names expressions; a dotted passphrase of letters only (\`correct.horse.battery\`) is read as a member chain. Measured: the 58 lines of the review's idioms and placeholders, 42 refused before, 0 after; eval suite 59 of 59 before, 64 of 64 after (tc-060 to tc-064, all allow, five of which 0.1.4 fails); every committed refusing case still blocks; replay over first-parent history, chock-catalog 243 commits and 430603 added lines: 141 lines refused before and after, 0 disappear, 0 appear; open-coder-ai/chock 281 commits and 253827 added lines: 44 before and after, 0 and 0. Tests: the scan-secrets pattern tests and the guard-memory-writes copy test.

## Provenance

- Tested by 64 of 64 cases run automatically
- SHA-256: `9d99cab3f5657d37554d6bd899396d95847825c7ff0d8ec4bd3f850a4a5e8a00`
- Catalog commit: https://github.com/open-coder-ai/chock-catalog/commit/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4
- Source: https://github.com/open-coder-ai/chock-catalog/tree/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4/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.5&page=%2Fcoding%2Fpolicies%2Fscan-secrets%2F
