You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reject explicitly missing config files instead of silently using defaults #3706
Is your feature request related to a problem? Please describe.
An explicitly supplied config path that does not exist is silently omitted, so a typo can leave the CLI using unintended defaults. Existing unit tests intentionally codify this behavior; this is a proposed safety/UX change, not a claim that current behavior is an untested regression.
Describe the solution you'd like
Raise a ConfigError for a missing explicitly supplied --config-file while keeping the auto-discovered default config optional. Update the tests that currently assert silent omission.
Describe alternatives you've considered, if relevant
Alternatively, emit a prominent warning, but failing fast is less likely to apply surprising server settings.
Additional context
Reproduction: pyrit_scan list-targets --config-file /does/not/exist.yaml --server-url http://127.0.0.1:18741 --auth-mode none exits 0 without mentioning the absent file. References: config reader, current tests.
Tested commit d3446e0, PyRIT 1.2.0.dev0, offline Linux scope; the current behavior is intentionally tested. Recovery evidence: files/evidence/round1/scan-invalid-args.txt; local path is not an attachment.
Additional reproduction details
This is the exact observed command: pyrit_scan list-targets --config-file /does/not/exist.yaml --server-url http://127.0.0.1:18741 --auth-mode none; it prints No targets found in registry. and exits 0. The optional local config shape is memory_db_type: in_memory, env_files: [], initializers: [], with loopback URL and auth_mode: none; no credentials are needed. Current tests intentionally preserve omission of nonexistent config paths.
Activity
SpinachDigital commentedon Nov 1, 2026
Taking this up — will open a PR shortly.