Repository navigation
fix(config): exit 1 when audit-keys finds a plaintext secret - #2401
Merged
Merged
Conversation
Plan #1469 as the OpenSpec change 1469-audit-keys-leak-exit-code. Replace the test that expected exit 0 for a plaintext secret. The new tests expect exit 1 for the table output and for the --json report.
devops config audit-keys exited 1 for a config file that it could not parse, but exited 0 for a confirmed plaintext secret. A CI step or a pre-commit hook thus failed on a broken file and passed on a leak. Each output branch now exits 1 when the audit is not compliant, after it prints the full report. The success line prints only on exit 0. The command help and the generated documents state the exit codes.
Owner
Author
|
Local results on
Other checks:
The real command, with
Before the fix, the leak case exited 0 in both outputs. |
dan-petty
marked this pull request as ready for review
October 28, 2026 14:02
dan-petty
pushed a commit
that referenced
this pull request
Oct 28, 2026
🤖 I have created a release *beep* *boop* --- ## [0.8.3](v0.8.2...v0.8.3) (2026-10-28) ### Bug Fixes * **ai:** the gateway sweep's URL error names no credential ([#2400](#2400)) ([2e6f1fd](2e6f1fd)), closes [#909](#909) * **config:** exit 1 when audit-keys finds a plaintext secret ([#2401](#2401)) ([ad0114f](ad0114f)), closes [#1469](#1469) * **security:** drop the Go ignores that the pinned gh build does not need ([#2402](#2402)) ([6052083](6052083)), closes [#1492](#1492) * **security:** refuse every loader and shell key that loads code into a child ([#2405](#2405)) ([86d5bce](86d5bce)), closes [#2205](#2205) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
This was referenced Oct 28, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
devops config audit-keysexited 1 for a config file that it could not read or parse (#1022), but exited 0 for a confirmed plaintext secret. Thus a CI step or a pre-commit hook failed on a broken file and passed on a leak. The owner decided that a confirmed leak fails the audit.Changes:
audit_keys_cmdinsrc/devops_cli/commands/config.pynow exits 1 when the audit is not compliant: when a config file holds a plaintext secret, or when it cannot read or parse a config file. Each output branch has one exit on the overall compliance, so the exit code agrees withis_compliantin the report.--json,--format json|yaml|markdown) print the full report before the exit. The success line prints only on exit 0.config_audit_keysruns the command, so it now reports a leak as a tool error that holds the full masked report. It already did this for a file that the audit cannot parse.devops docs generate --sync-readmewrote the same text intoREADME.md,docs/CLI_REFERENCE.md,docs/commands/config.mdanddocs/MCP_TOOLS.md.tests/test_config_audit_keys.pyreplaces the test that expected exit 0 for a leak with two tests that expect exit 1, one for the table output and one for the--jsonreport.openspec/changes/1469-audit-keys-leak-exit-code/records the plan, the premise check and the rejected alternatives. It adds a requirement for the exit codes to theconfig-commandscapability.Closes #1469