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
fix(scan): GOAT/Crescendo generators crash on empty languages list (#2602)
Both GOATAttackScenarioGenerator._select_objectives and
CrescendoAttackScenarioGenerator._select_objectives pick a random
language via `languages[int(rng.integers(len(languages)))]` with no
guard for an empty `languages` list. vulnerability_scan() accepts
languages: list[str] with no validation, so an empty list raises
`ValueError: high <= 0` from numpy instead of producing scenarios.
The sibling KnowledgeBaseScenarioGenerator._sample_languages already
handles this exact case correctly: `if not languages: return ["en"] *
scenario_count`. GOAT/Crescendo look like copy-pasted siblings (same
objectives-dict structure, same _select_objectives body) that never
received this guard.
Fix: `languages = languages or ["en"]` in both generators, mirroring
the existing correct fallback.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments