BUG remove_seeds_from_memory(harm_categories=...) deletes seeds whose categories only contain the value as a substring
还没有人认领这个 Issue。
评估
调研方向
Start at remove_seeds_from_memory and the list-filter handling for harm_categories, authors, groups, and parameters; inspect the existing _get_condition_json_array_match helper and the related seed-memory tests. Confirm that remove filters match whole list elements by default while get_seeds keeps substring behavior. Done means the reported hate example removes only the exact category and regression coverage passes.
由索引模型根据 Issue 内容生成。
描述
remove_seeds_from_memory(harm_categories=["hate"]) also deletes seeds tagged hate_speech, and even whatever. The list filters (harm_categories, authors, groups, parameters) go through field.contains(value), which is an unescaped LIKE '%value%' on the JSON text.
For get_seeds the substring match looks intentional (there are tests for it). But the remove methods already default value to an exact match so a short value can't wipe out more than you meant, and the list filters never got the same treatment.
seeds = [SeedPrompt(value="a", harm_categories=["hate"]),
SeedPrompt(value="b", harm_categories=["hate_speech"]),
SeedPrompt(value="c", harm_categories=["whatever"])]
await memory.add_seeds_to_memory_async(seeds=seeds, added_by="t")
memory.remove_seeds_from_memory(harm_categories=["hate"]) # removes all 3
Suggested fix: when exact=True (the default for removes), match whole list elements using the existing _get_condition_json_array_match helper, and leave get_seeds as is.
- 主要语言
- Python
- 星标
- 4.5k
- 派生
- 896
- 平均合并
- 3 天 5 小时
- 30 天内合并 PR
- 200
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/PyRIT 的其他 Issue
-
BUG HarmBench loader drops ContextString, so contextual behaviors are sent without their context 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 5/5 一周以上 新手友好度 35/100
相似的 Issue
-
bug priority:low
难度 2/5 1-3 小时 新手友好度 76/100
CyberAgent/psd2svg#436 ·
-
area/install-update comp/cli comp/desktop P3 sweeper:risk-compatibility type/bug
难度 2/5 1-3 小时 新手友好度 86/100
NousResearch/hermes-agent#122386 · 1 条评论 ·
-
ai-generated
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 78/100
vllm-project/production-stack#1105 ·
-
难度 2/5 1-3 小时 新手友好度 88/100