Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

BUG: DenylistConverter and TransparencyAttackConverter identifiers ignore settings that change output

Aperta
#3,313 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@ShivamSharma43 ci sta già lavorando.

Dal 18/10/2026.

  • #3315 di @ShivamSharma43 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
ai, security

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 the LLMGenericTextConverter identifier, which hashes the system prompt template but not the denylist that is rendered into it. The denylist also decides whether the LLM is called at all.
  • TransparencyAttackConverter: convergence_threshold and convergence_patience. Both control when the optimization loop stops early, but only benign_image_path, size, steps and learning_rate are 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

Apri in Codespaces

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/PyRIT

Tutte le issue di microsoft/PyRIT

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.