@@ -76,9 +76,9 @@ function parseFlagName(arg: string): string | null {
7676// 1. `--flag=value` form for any name matching the explicit list or the
7777// suffix heuristic — mask the value half.
7878// 2. value following a bare `--flag` form — emit `***` instead of the
79- // next arg, but only when the candidate value does not itself look
80- // like another option (`-`/`--` prefix). A bare `--token --port 8080`
81- // is treated as a missing value, leaving `--port` and `8080` intact .
79+ // next arg, even if it starts with `-`. Command parsers accept
80+ // dash-leading values for required options, and this persistent audit
81+ // log should fail closed .
8282// 3. fall back to redactToolPayloadText for everything else, which catches
8383// `KEY=VALUE` env-style assignments, raw token shapes (sk-, ghp_, xox*,
8484// gsk_, AIza*, npm_, Telegram bot tokens, PEM blocks, Bearer headers,
@@ -95,13 +95,8 @@ export function redactConfigAuditArgv(argv: readonly string[]): string[] {
9595 }
9696 if ( redactNext ) {
9797 redactNext = false ;
98- if ( ! current . startsWith ( "-" ) ) {
99- result . push ( "***" ) ;
100- continue ;
101- }
102- // The previous arg looked like a secret flag but was followed by
103- // another option — treat as a missing value and fall through so the
104- // current arg is processed normally.
98+ result . push ( "***" ) ;
99+ continue ;
105100 }
106101 const currentFlag = parseFlagName ( current ) ;
107102 if ( currentFlag !== null && isSecretFlagName ( currentFlag ) ) {
0 commit comments