BUG: CodeChameleonConverter custom functions do not reach its identifier
I maintainer di solito rispondono entro 2 giorni
@Ayoubhm07 ci sta già lavorando.
Dal 2/11/2026.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
Direzione di ricerca
Read codechameleon_converter.py, especially _build_identifier and the custom encryption/decryption handling at the referenced lines. Review the two strict xfail tests proposed in #3477 and settle whether identity should come from a caller-provided stable identifier or a fingerprint of the effective functions and rendered decrypt source. Done means converters using different custom functions have distinct identifiers, with tests covering the chosen behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
With encrypt_type="custom", CodeChameleonConverter._build_identifier records only encrypt_type (codechameleon_converter.py:113). The encryption function decides the encoded prompt, and the decryption function's source is rendered into the prompt the model sees (source read at :150, rendered at :140-142), so converters built with different functions share one hash. As discussed in #3477, a qualified name is not enough either: two functions can share it with different code, closures or configuration.
Steps/Code to Reproduce
Run on main at 791e12c6e. Save as a file, since inspect.getsource needs one.
import asyncio
from pyrit.converter import CodeChameleonConverter
from pyrit.setup import IN_MEMORY, initialize_pyrit_async
def reverse_text(text):
return text[::-1]
def upper_text(text):
return text.upper()
async def main() -> None:
await initialize_pyrit_async(memory_db_type=IN_MEMORY, silent=True)
for function in (reverse_text, upper_text):
converter = CodeChameleonConverter(encrypt_type="custom", encrypt_function=function, decrypt_function=function)
result = await converter.convert_async(prompt="hello world")
line = next(line for line in result.output_text.splitlines() if "need to solve" in line)
print(line.strip(), converter.get_identifier().unique_name)
asyncio.run(main())
Expected Results
Different functions, different identifiers.
Actual Results
The encrypted_problem you need to solve is: dlrow olleh CodeChameleonConverter::505647f9
The encrypted_problem you need to solve is: HELLO WORLD CodeChameleonConverter::505647f9
Versions
- OS: Windows 11
- Python version: 3.12.0
- PyRIT version: source checkout of
mainat791e12c6e
System:
python: 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)]
executable: C:\dev\pyr-main\Scripts\python.exe
machine: Windows-11-10.0.26300-SP0
Python dependencies:
pyrit: 1.2.0.dev0
Cython: None
numpy: 2.4.6
openai: 2.54.0
packaging: 26.3
pip: 23.2.1
scipy: 1.17.1
setuptools: 84.2.1
sqlite3: None
torch: None
transformers: 5.20.2
Possible directions from #3477: a stable identifier passed by the caller, or a fingerprint of the effective function and rendered decrypt source. The test proposed in #3477 marks both settings as strict xfail linked to this issue. I can take this one once the direction is settled.
- Lingua principale
- Python
- Stelle
- 4.7k
- Fork
- 1k
- Merge medio
- 2g 3h
- PR unite (30g)
- 465
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
-
Scenario objective previews can split supplementary Unicode during truncationForse già presa @Aadithya-kl l’ha presa oggi. ApertaBug: triage help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
microsoft/PyRIT#3870 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
URLDataTypeSerializer treats mixed-case HTTP(S) schemes as local pathsForse già presa @akhil9tiet l’ha presa oggi. ApertaBug: triage help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
microsoft/PyRIT#3861 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Parameter required status is lost after wire round-tripForse già presa @its-amann l’ha presa oggi. ApertaBug: triage help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
microsoft/PyRIT#3854 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
BUG: LLMGenericTextConverter identifier changes between processes for set-valued template parametersForse già presa @samrudhi03 l’ha presa oggi. ApertaBug: triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/PyRIT#3841 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
BUG: SelfAskGeneral scorers leave their output keys out of the identifierForse già presa @Hrushikesh-ramilla l’ha presa 2 giorni fa. ApertaBug: triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di microsoft/PyRIT
Issue simili
-
needs-area-label
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 2 giorni
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Official-Space-AI/OpenPhysGraspGen#114 ·
I maintainer di solito rispondono entro 2 giorni
-
changelog investigate
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ramnes/notion-sdk-py#441 ·
-
qa_bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NVIDIA-NeMo/Gym#5644 ·
I maintainer di solito rispondono entro 2 giorni
-
BUG: catalog database credentials printed to logs at startupForse già presa @cjboyle l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno