Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

BUG: DenylistConverter and TransparencyAttackConverter identifiers ignore settings that change output

Đã đóng
#3,313 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@ShivamSharma43 đang làm issue này rồi.

Từ ngày 18/10/2026.

  • #3315 của @ShivamSharma43 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
ai, security

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Python
Star
4.6k
Fork
962
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
390

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/PyRIT

Tất cả issue của microsoft/PyRIT

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.