Skip to content

FIX: Coerce typed scenario parameters in scan CLI#2092

Open
biefan wants to merge 1 commit into
microsoft:mainfrom
biefan:fix/scan-scenario-param-coercion
Open

FIX: Coerce typed scenario parameters in scan CLI#2092
biefan wants to merge 1 commit into
microsoft:mainfrom
biefan:fix/scan-scenario-param-coercion

Conversation

@biefan

@biefan biefan commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Description

  • Fix pyrit_scan handling of scenario-declared CLI parameters so invalid boolean tokens are rejected instead of silently becoming false.
  • Coerce list parameter elements, such as list[int], before sending scenario_params to the backend.
  • Coerce typed choices before argparse validation so numeric choices are compared using the correct type.

Tests and Documentation

  • uv run -m pytest tests/unit/cli/test_pyrit_scan.py tests/unit/cli/test_pyrit_shell.py -q
  • uv run -m pytest tests/unit/cli -q
  • uv run -m ty check pyrit/cli/pyrit_scan.py tests/unit/cli/test_pyrit_scan.py
  • uv run pre-commit run --files pyrit/cli/pyrit_scan.py tests/unit/cli/test_pyrit_scan.py

Documentation changes are not needed for this CLI bug fix.

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.

1 participant