Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

BUG: DenylistConverter and TransparencyAttackConverter identifiers ignore settings that change output

クローズ
#3,313 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@ShivamSharma43 がすでに取り組んでいます。

2026年10月18日 から。

  • #3315 @ShivamSharma43 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
ai, security

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Python
スター
4.6k
フォーク
962
平均マージ
2日 16時間
マージ済み PR(30日)
354

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/PyRIT のほかの issue

microsoft/PyRIT の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。