Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#3,095 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
databases

調査の方向性

バグは sqlite_memory.py と azure_sql_memory.py の _get_message_pieces_memory_label_conditions にあり、そのJOINは攻撃の最終会話からのメッセージピースしか取得していません。JOIN条件を調整して ConversationEntry.attack_result_id == AttackResultEntry.id にも一致するようにし、攻撃結果に紐づくすべての会話を含めてください。その後、付属のモックターゲットによる再現スクリプトを実行し、PromptSendingAttack と RedTeamingAttack のラベルクエリが期待されるすべてのピースを返すことを確認してください。

索引モデルが issue の本文から書いたものです。

説明

get_message_pieces_async(labels=...) only returns pieces from the attack result's final conversation_id. Labels now live on AttackResultEntry, and the condition (_get_message_pieces_memory_label_conditions in sqlite_memory.py and azure_sql_memory.py) only joins on AttackResultEntry.conversation_id == PromptMemoryEntry.conversation_id. The 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/TAP, and every TAP branch except the best one. The memory docs still say labels apply "to all prompts sent by any attack".

Repro 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 ConversationEntry.conversation_id == PromptMemoryEntry.conversation_id AND ConversationEntry.attack_result_id == AttackResultEntry.id. Whether adversarial-chat prompts should come back is a design call (they'd also get picked up by label-based batch scoring), so filing as an issue first. #3063 touches the same functions for dotted keys.

主要言語
Python
スター
4.6k
フォーク
944
平均マージ
3日 1時間
マージ済み PR(30日)
278

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/PyRIT のほかの issue

microsoft/PyRIT の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。