MAINT: Consolidate GCG attack manager logging - #2364
Merged
Roman Lutz (romanlutz) merged 2 commits intoAug 13, 2026
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
hannahwestra25
approved these changes
Aug 12, 2026
hannahwestra25
left a comment
Contributor
There was a problem hiding this comment.
small nit but lgtm!
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e3a9538e-1885-494e-bf76-efe6b826ffdd
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
tests/unit/executor/promptgen/gcg/test_multi_prompt_attack.py.uv run pytest tests\unit\executor\promptgen\gcg\test_multi_prompt_attack.py -q -rswas attempted locally; the module was skipped because the optional GCG dependencies (torch,mlflow, etc.) are not installed.