Skip to content

[BUG] Fix JSON path for converter class names in attack result queries#1512

Merged
jbolor21 merged 5 commits intomicrosoft:mainfrom
jbolor21:bjagdagdorj/fix-converter-json-path
Mar 18, 2026
Merged

[BUG] Fix JSON path for converter class names in attack result queries#1512
jbolor21 merged 5 commits intomicrosoft:mainfrom
jbolor21:bjagdagdorj/fix-converter-json-path

Conversation

@jbolor21
Copy link
Copy Markdown
Contributor

@jbolor21 jbolor21 commented Mar 17, 2026

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

Bolor and others added 2 commits March 17, 2026 15:25
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jbolor21 jbolor21 requested a review from Copilot March 17, 2026 22:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@jbolor21 jbolor21 changed the title Fix JSON path for converter class names in attack result queries [BUG] Fix JSON path for converter class names in attack result queries Mar 17, 2026
@jbolor21 jbolor21 merged commit 5ddee44 into microsoft:main Mar 18, 2026
38 checks passed
@jbolor21 jbolor21 deleted the bjagdagdorj/fix-converter-json-path branch March 18, 2026 12:21
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>
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.

4 participants