BUG: label queries only return the final conversation of an attack
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
问题出在 sqlite_memory.py 和 azure_sql_memory.py 中的 _get_message_pieces_memory_label_conditions,其 join 只会获取攻击最终会话中的消息片段。请调整 join 条件,使其同时匹配 ConversationEntry.attack_result_id == AttackResultEntry.id,以包含与该攻击结果关联的所有会话,然后运行提供的 mock target 复现脚本,确认标签查询能为 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
- 平均合并
- 2 天 17 小时
- 30 天内合并 PR
- 328
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/PyRIT 的其他 Issue
-
BUG UnicodeReplacementConverter writes characters outside the BMP as invalid five-digit \u escapes可能已有人在做 @ShivamSharma43 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
BUG Configuration keeps runtime-status errors after polling recovers可能已有人在做 @joeyvictorino 于 3 天前认领。 未关闭Bug: triage GUI help wanted
难度 2/5 1-3 小时 新手友好度 86/100
microsoft/PyRIT#2868 · 4 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
BUG: MemoryInterface.get_request_from_response fails with IndexError for non-zero starting sequence or sequence gaps可能已有人在做 @RohithPariki 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 25/100
维护者通常 2 天内回复
-
Conversation editor never revokes blob URLs of removed attachments可能已有人在做 @ManoharPaturi 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 25/100
维护者通常 2 天内回复
-
Scenario progress double-counts an attack result after its timestamp is bumped可能已有人在做 @ManoharPaturi 今天认领。 未关闭
难度 3/5 半天 新手友好度 25/100
维护者通常 2 天内回复
相似的 Issue
-
[Bug]: LangGraph Store sync put bypasses namespace validation可能已有人在做 @ktz03 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
volcengine/OpenViking#6050 ·
维护者通常 1 天内回复
-
[Bug]: Streamed /v1/chat/completions sends unredacted agent error text (keys) in the final chunk可能已有人在做 @rodricksz4h5 今天认领。 未关闭area/streaming comp/gateway P2 type/security
难度 2/5 1-3 小时 新手友好度 78/100
NousResearch/hermes-agent#138245 ·
维护者通常 1 天内回复
-
[oblt-aw][autodoc] Update user onboarding guide for mandatory trigger CODEOWNERS step可能已有人在做 @github-actions 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
correction metadata
难度 2/5 1 小时以内 新手友好度 68/100
acl-org/acl-anthology#10378 · 1 条评论 ·
维护者通常 1 天内回复
-
cloudtrail_multi_region_enabled_logging_management_events fails when the advanced event selector has a custom name可能已有人在做 @12YYCCYY16 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
prowler-cloud/prowler#13033 ·
维护者通常 1 天内回复