Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

BUG: label queries only return the final conversation of an attack

Geschlossen Anfängerfreundlich
#3,095 4 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

@u7k4rs6 arbeitet bereits daran.

Seit 14.10.2026.

  • #3199 von @u7k4rs6 — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
85/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
databases

Rechercherichtung

Der Fehler liegt in _get_message_pieces_memory_label_conditions in sqlite_memory.py und azure_sql_memory.py, wo der Join nur Pieces aus der letzten Konversation eines Angriffs holt. Passe die Join-Bedingung an, sodass zusätzlich ConversationEntry.attack_result_id == AttackResultEntry.id gilt, um alle Konversationen einzubeziehen, die mit dem Attack-Result verknüpft sind. Führe danach die mitgelieferte Reproduktion mit dem Mock-Target aus, um zu bestätigen, dass Label-Abfragen für PromptSendingAttack und RedTeamingAttack alle erwarteten Pieces zurückgeben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

get_message_pieces_async(labels=...) only returns pieces from an attack result's final conversation_id. Labels now live on AttackResultEntry, and the condition in _get_message_pieces_memory_label_conditions (sqlite_memory.py and azure_sql_memory.py) only joins on AttackResultEntry.conversation_id == PromptMemoryEntry.conversation_id. Its docstring says it also matches labels on the piece itself, but that branch is gone.

So everything else an attack sent drops out of label queries: PromptSendingAttack retry attempts, Crescendo's pruned conversations, the adversarial chat in RedTeaming, Crescendo and TAP, and every TAP branch except the best one. The memory docs still say labels apply "to all prompts sent by any attack".

This is with mock targets:

PromptSendingAttack(max_attempts_on_failure=2): pieces sent in this attack=6, returned by labels query=2
RedTeamingAttack: objective-conv pieces=4, adversarial-conv pieces=5, returned by labels query=4

The Conversation table already has attack_result_id for these conversations, so one option is to also match when ConversationEntry.conversation_id equals PromptMemoryEntry.conversation_id and ConversationEntry.attack_result_id equals AttackResultEntry.id. Whether adversarial-chat prompts should come back is a design call, since they'd also get picked up by label-based batch scoring, so I'm filing this as an issue first. #3063 touches the same functions for dotted keys.

Vorherrschende Sprache
Python
Sterne
4.7k
Forks
980
Ø Merge
2 T. 9 Std.
Gemergte PRs (30 T.)
422

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

  • Kein Dockerfile und keine Docker-Compose-Datei
  • Hat eine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoft/PyRIT

Alle Issues in microsoft/PyRIT

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.