Repository navigation
FIX: Include the inline template value in the TextJailbreakConverter identifier - #4085
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The resolved jailbreak_template case remains in KNOWN_GAPS, causing the strict xfail contract test to fail with XPASS(strict) until the obsolete entry is removed.
1 open issue
What changed in this PR
Addresses #3760 by making TextJailbreakConverter identifiers distinguish different inline templates, preventing shared hashes and default registry names.
Changes:
- Add a content hash of the resolved template while preserving its source.
- Add a regression test asserting that different inline templates produce different identifiers.
| File | Description |
|---|---|
tests/unit/converter/test_text_jailbreak_converter.py |
Tests identifier uniqueness for two inline templates. |
pyrit/converter/text_jailbreak_converter.py |
Includes a truncated SHA-256 template hash in identifier parameters. |
Review effort: Balanced
|
The underlying issue is assigned to someone else so I'm closing this as duplicate unless the issue owner releases it or doesn't respond. |
…mplate-identifier
The inline-template gap is fixed by the template value hash, so the strict xfail in the identifier contract test would now fail as XPASS. Also check the identifier hash first in the regression test and update the _build_identifier docstring to mention the template value hash. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Resolve the KNOWN_GAPS conflict: main removed the PolicyPuppetryConverter entry (microsoft#4084) and this branch removed the TextJailbreakConverter entry, so only the CodeChameleonConverter entries remain. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Hi Roman Lutz (@romanlutz) — thanks for freeing #3760 and for the approval. One heads-up in case your settings require an approval on the latest head: since that approval I had to merge
CI is green on Is there anything else you need before this can land? If it is waiting on a code owner, a pointer to who that is would help. Happy to reshape the change too — e.g. split the hash into its own PR, or drop it in favour of whatever the identifier convention settles on — if that makes it easier to take. |

Description
TextJailbreakConverter._build_identifieronly recordedtemplate_source, which is the constant<string_template>for every inlineTextJailBreak. Two converters built from different inline jailbreaks therefore shared one hash and one default registry name.Fixes #3760