Skip to content

Validate explicit empty field overrides in attack executor#1507

Open
biefan wants to merge 1 commit intoAzure:mainfrom
biefan:validate-empty-field-overrides
Open

Validate explicit empty field overrides in attack executor#1507
biefan wants to merge 1 commit intoAzure:mainfrom
biefan:validate-empty-field-overrides

Conversation

@biefan
Copy link
Contributor

@biefan biefan commented Mar 17, 2026

Summary

  • treat field_overrides=[] as an explicit value that still participates in length validation
  • apply the same fix to both execute_attack_async() and execute_attack_from_seed_groups_async()
  • add regression tests for the objective and seed-group execution paths

Problem

AttackExecutor currently uses truthiness checks for field_overrides. That means an explicit empty list is treated the same as None, so the documented length validation is skipped instead of raising a mismatch error for non-empty objectives or seed groups.

Validation

  • .venv/bin/pytest tests/unit/executor/attack/core/test_attack_executor.py -q
  • .venv/bin/ruff check pyrit/executor/attack/core/attack_executor.py tests/unit/executor/attack/core/test_attack_executor.py

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