BUG remove_seeds_from_memory(harm_categories=...) deletes seeds whose categories only contain the value as a substring
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 4.5k
- Fork
- 896
- Merge medio
- 3g 8h
- PR unite (30g)
- 191
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/PyRIT
-
BUG HarmBench loader drops ContextString, so contextual behaviors are sent without their context Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Tutte le issue di microsoft/PyRIT
Issue simili
-
agent-ready documentation needs-triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
instance instance add
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
searxng/searx-instances#939 · 1 commento ·
-
area-deployment area-integrations triage:bot-seen
Difficoltà 2/5 Mezza giornata Idoneità per principianti 86/100