[BUG] Fix JSON path for converter class names in attack result queries#1512
Merged
jbolor21 merged 5 commits intomicrosoft:mainfrom Mar 18, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes attack-result JSON querying so converter class names are extracted from the correct atomic_attack_identifier structure, restoring converter option discovery and converter-based filtering.
Changes:
- Updated SQLite JSON paths used to filter/query converter class names to
$.children.attack.children.request_converters. - Updated Azure SQL JSON paths used to filter/query converter class names to
$.children.attack.children.request_converters. - Updated unit-test helper data construction to store request converters under
children["request_converters"]to match the persisted identifier shape.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
pyrit/memory/sqlite_memory.py |
Fixes SQLite JSON paths for converter extraction/filtering. |
pyrit/memory/azure_sql_memory.py |
Fixes Azure SQL JSON paths for converter extraction/filtering. |
tests/unit/memory/memory_interface/test_interface_attack_results.py |
Updates test data creation to reflect the corrected identifier JSON shape. |
tests/unit/memory/memory_interface/test_interface_attack_results.py
Outdated
Show resolved
Hide resolved
rlundeen2
approved these changes
Mar 17, 2026
romanlutz
approved these changes
Mar 18, 2026
riyosha
pushed a commit
to riyosha/PyRIT
that referenced
this pull request
Mar 24, 2026
microsoft#1512) Co-authored-by: Bolor <bjagdagdorj@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Fixing JSON path used in SQL queries that extract converter class names. Currently the GET /api/attacks/converter-options doesn't return the converter list. This occurs because the queries use
"$.children.attack.request_converter_identifiers"
but the stored structure is actually "$.children.attack.children.request_converters"
This is needed to correctly filter attacks by the converter(s) used
Tests and Documentation
Fixed unit tests to use this path (test_interface_attack_results.py) to create test data with this corrected path