FIX Stop using deprecated AttackResult.attack_identifier in attack_service#1644
Open
romanlutz wants to merge 1 commit intomicrosoft:mainfrom
Open
FIX Stop using deprecated AttackResult.attack_identifier in attack_service#1644romanlutz wants to merge 1 commit intomicrosoft:mainfrom
romanlutz wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Replace ar.attack_identifier with ar.get_attack_strategy_identifier() in attack_service.py. Remove writing the deprecated attack_identifier DB column in _update_attack_after_message_async — only atomic_attack_identifier (the source of truth) is now updated. Add tests for: - Flat/legacy atomic identifier fallback converter merge path - Deprecated attack_identifier column not written to update_fields - DB read prefers atomic_attack_identifier over stale attack_identifier Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jsong468
approved these changes
Apr 22, 2026
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.
Summary
Migrate
attack_service.pyaway from the deprecatedAttackResult.attack_identifierproperty (scheduled for removal in 0.15.0).Changes
Production code (
pyrit/backend/services/attack_service.py):ar.attack_identifierwithar.get_attack_strategy_identifier()(the non-deprecated equivalent)attack_identifierkey inupdate_fieldsduring converter merging — onlyatomic_attack_identifier(the source of truth) is now updatedTests (
tests/unit/backend/test_attack_service.py,tests/unit/memory/test_memory_models.py):get_attack_strategy_identifier()and checkatomic_attack_identifierin update_fieldsattack_identifiercolumn is not written to update_fieldsatomic_attack_identifierover staleattack_identifierWhy this is safe
AttackResult.attack_identifierjust delegates toget_attack_strategy_identifier()— identical return valueatomic_attack_identifieratomic_attack_identifierget it reconstructed on read viaAttackResultEntry.get_attack_result()attack_identifierDB column becoming stale is harmless:get_attack_result()always prefersatomic_attack_identifierEliminates ~42
DeprecationWarningemissions during unit tests.