Skip to content

fix(gate): a path to a key file is not a credential on the command line (0.2.20) - #151

Merged
chrispezza merged 1 commit into
mainfrom
claude/key-file-150
Oct 12, 2026
Merged

chrispezza merged 1 commit into
mainfrom
claude/key-file-150

Conversation

@chrispezza

Copy link
Copy Markdown
Contributor

credential-on-the-command-line fired on an assignment whose value is a path to a key file. It stopped bouncer's own documented BOUNCER_LOCAL_API_KEY_FILE=<path> in seatbelt during a calibration run (#150), and 0.2.18's narrowing did not cover it: the name is all capitals with no space round the =.

What changed

shell-assigned-secret, the kind the hard rule reads, is no longer reported when the name ends in _FILE, _PATH or _DIR (or the same with a dash), or is GOOGLE_APPLICATION_CREDENTIALS. The test is on the name and not the value, because a secret can begin with a slash. Redaction is unchanged, so the value is still replaced in what is sent and logged.

stopped, as before no longer stopped by the rule
API_KEY=… ./run.sh API_KEY_FILE=/run/secrets/api-key ./run.sh
mysql --password=… prod mysql --password-file=/run/secrets/db prod
AWS_SECRET_ACCESS_KEY=… aws s3 ls GOOGLE_APPLICATION_CREDENTIALS=/home/user/sa.json gcloud auth list
SECRET_FILENAME=… ./run.sh SSH_PRIVATE_KEY_PATH=/home/user/.ssh/deploy ./run.sh

What it gives up

A real secret assigned to a variable whose name ends in _FILE, _PATH or _DIR is no longer stopped by the hard rule and is judged by the secrets question instead.

Checks

1709 tests pass. One holdout case added and FROZEN updated in the same commit; the mock asks on it by keyword, and the friction list says so. The policy file is unchanged, so CACHE_VERSION stays at 9. No new attack surface: it narrows a deny rule.

A copied policy gets this only if it already names shell-assigned-secret (0.2.18).

Closes #150.

🤖 Generated with Claude Code

…ne (0.2.20)

credential-on-the-command-line fired on API_KEY_FILE=/path, --password-file=,
SSH_PRIVATE_KEY_PATH= and GOOGLE_APPLICATION_CREDENTIALS=, including bouncer's
own BOUNCER_LOCAL_API_KEY_FILE (#150). The name contains a keyword and the
value is a location, which is how a key is kept off the command line.

shell-assigned-secret is no longer reported for a name ending in _FILE, _PATH
or _DIR, with either separator, or for GOOGLE_APPLICATION_CREDENTIALS. Read
from the name: a secret can begin with a slash. Redaction is unchanged.

One holdout case, refrozen.

Closes #150.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chrispezza
chrispezza merged commit 9714110 into main Oct 12, 2026
2 checks passed
@chrispezza
chrispezza deleted the claude/key-file-150 branch October 12, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hard rule credential-on-the-command-line fires on a path to a key file (API_KEY_FILE=…)

1 participant