Skip to content

MAINT: Consolidate GCG attack manager logging - #2364

Merged
Roman Lutz (romanlutz) merged 2 commits into
microsoft:mainfrom
romanlutz:romanlutz-gcg-logging-consolidation
Aug 13, 2026
Merged

MAINT: Consolidate GCG attack manager logging#2364
Roman Lutz (romanlutz) merged 2 commits into
microsoft:mainfrom
romanlutz:romanlutz-gcg-logging-consolidation

Conversation

@romanlutz

Copy link
Copy Markdown
Contributor

Description

The GCG attack-manager variants duplicated JSON log initialization and parameter updates, allowing their schemas and recorded run metadata to drift. This consolidates that behavior into shared helpers so individual, progressive, and evaluation attacks initialize the same structured log, capture model and tokenizer metadata consistently, and persist run parameters before constructing the multi-prompt attack.

The evaluation path also records the test count and preserves a stable empty-result contract when no controls are supplied. Unit coverage verifies the exact schemas, update ordering, filtering behavior, and result partitioning.

Tests and Documentation

  • Added targeted unit coverage in tests/unit/executor/promptgen/gcg/test_multi_prompt_attack.py.
  • uv run pytest tests\unit\executor\promptgen\gcg\test_multi_prompt_attack.py -q -rs was attempted locally; the module was skipped because the optional GCG dependencies (torch, mlflow, etc.) are not installed.
  • Documentation changes are not applicable.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@hannahwestra25 hannahwestra25 self-assigned this Aug 12, 2026
Comment thread pyrit/executor/promptgen/gcg/attack/base/attack_manager.py Outdated

@hannahwestra25 hannahwestra25 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit but lgtm!

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e3a9538e-1885-494e-bf76-efe6b826ffdd
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Aug 13, 2026
Merged via the queue into microsoft:main with commit 3c3929b Aug 13, 2026
54 checks passed
@romanlutz
Roman Lutz (romanlutz) deleted the romanlutz-gcg-logging-consolidation branch August 13, 2026 04:50
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.

3 participants