BUG: DenylistConverter and TransparencyAttackConverter identifiers ignore settings that change output
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
Direzione di ricerca
Read the identifier-building code for DenylistConverter and TransparencyAttackConverter, along with the shared behavior noted in #3287. Check how denylist, convergence_threshold, and convergence_patience affect output and are represented in identifiers; use the reproduction steps to verify each pair gets distinct identifiers and both denylist configurations register successfully.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Two converters leave settings that change their output out of their identifiers, so differently configured instances share one hash:
DenylistConverter:denylist. It does not override_build_identifier(), so it inherits theLLMGenericTextConverteridentifier, which hashes the system prompt template but not thedenylistthat is rendered into it. The denylist also decides whether the LLM is called at all.TransparencyAttackConverter:convergence_thresholdandconvergence_patience. Both control when the optimization loop stops early, but onlybenign_image_path,size,stepsandlearning_rateare included.
Because the default registry name comes from that hash, registering a second configuration without a custom name raises a duplicate-name error, and memory and analytics cannot tell the configurations apart. This is the same problem as #3287, for these two converters.
Steps/Code to Reproduce
import asyncio
import tempfile
from pathlib import Path
from PIL import Image
from pyrit.converter import DenylistConverter, TransparencyAttackConverter
from pyrit.prompt_target import OpenAIChatTarget
from pyrit.registry import ConverterRegistry
from pyrit.setup import IN_MEMORY, initialize_pyrit_async
asyncio.run(initialize_pyrit_async(memory_db_type=IN_MEMORY))
target = OpenAIChatTarget(endpoint="https://example.invalid/openai/v1", api_key="unused", model_name="gpt-4o")
benign = Path(tempfile.mkdtemp()) / "benign.jpg"
Image.new("L", (150, 150), color=200).save(benign, "JPEG")
pairs = [
(
DenylistConverter(converter_target=target, denylist=["bomb"]),
DenylistConverter(converter_target=target, denylist=["password", "exploit"]),
),
(
TransparencyAttackConverter(benign_image_path=benign, convergence_threshold=1e-6),
TransparencyAttackConverter(benign_image_path=benign, convergence_threshold=0.1),
),
(
TransparencyAttackConverter(benign_image_path=benign, convergence_patience=10),
TransparencyAttackConverter(benign_image_path=benign, convergence_patience=1),
),
]
for first, second in pairs:
print(first.get_identifier().unique_name, second.get_identifier().unique_name)
registry = ConverterRegistry()
registry.instances.register(DenylistConverter(converter_target=target, denylist=["bomb"]))
registry.instances.register(DenylistConverter(converter_target=target, denylist=["password"]))
Expected Results
Each pair has two different identifiers, and both DenylistConverter instances register.
Actual Results
DenylistConverter::0085bebb DenylistConverter::0085bebb
TransparencyAttackConverter::438424a1 TransparencyAttackConverter::438424a1
TransparencyAttackConverter::438424a1 TransparencyAttackConverter::438424a1
ValueError: Instance 'DenylistConverter::0085bebb' already exists
Screenshots
N/A
Versions
- OS: Windows 11
- Python version: 3.11.9
- PyRIT version: installed from main (f277fedd) in editable mode
- Lingua principale
- Python
- Stelle
- 4.6k
- Fork
- 962
- Merge medio
- 2g 16h
- PR unite (30g)
- 354
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
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: label queries only return the final conversation of an attackForse già presa @u7k4rs6 l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
microsoft/PyRIT#3095 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
microsoft/PyRIT#3325 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 53/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 46/100
I maintainer di solito rispondono entro 2 giorni
-
BUG: Tone, Tense, Translation, Noise, ScientificTranslation and Variation converter identifiers ignore a custom prompt_templateForse già presa @ShivamSharma43 l’ha presa oggi. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 20/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di microsoft/PyRIT
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
google-ai-edge/litert-torch#1346 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
geneontology/gocam-py#272 ·
-
pushed_authorization_request sends list authorization_details as a Python reprForse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
auth0/auth0-python#903 ·
I maintainer di solito rispondono entro 1 giorno