npm audit --omit=dev --audit-level=critical exits 0 while still printing the full report of high-severity vulnerabilities (CI looks green)
npm audit --omit=dev --audit-level=critical returns exit code 0 even though it still prints '# npm audit report' and '1 high severity vulnerability' and the 'npm audit fix' hint, because the exit code only reflects findings at or above the given level. Tested with npm 10.9.9 / node v22.23.3 in a fresh npm init -y project with npm i lodash@4.17.15 and npm i -D minimist@1.2.0: npm audit exit 1 (2 vulnerabilities: 1 high, 1 critical), npm audit --omit=dev exit 1 (1 high), npm audit --audit-level=critical exit 1 (the dev-only minimist is critical), npm audit --omit=dev --audit-level=critical exit 0. With --json the same run gives metadata.vulnerabilities {info:0,low:0,moderate:0,high:1,critical:0,total:1}, so a high finding stays in the output but does not fail the step.