Skip to content

FIX: Include the custom template value in the PolicyPuppetryConverter identifier - #4084

Merged
Roman Lutz (romanlutz) merged 3 commits into
microsoft:mainfrom
HhH666-ux:fix-policy-puppetry-template-identifier
Nov 15, 2026
Merged

Roman Lutz (romanlutz) merged 3 commits into
microsoft:mainfrom
HhH666-ux:fix-policy-puppetry-template-identifier

Conversation

@HhH666-ux

Copy link
Copy Markdown
Contributor

Description

PolicyPuppetryConverter._build_identifier recorded only the template name. A custom SeedPrompt usually has no name, so converters wrapping different templates shared one hash and one default registry name.

  • Add a hash of the configured template value to the identifier parameters.
  • Add a regression test with two different custom templates.

Fixes #3759

Copilot AI balanced review requested due to automatic review settings November 9, 2026 04:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The PolicyPuppetry identifier fix leaves its setting in KNOWN_GAPS, causing the strict-xfail contract test to fail with XPASS(strict) until the stale entry is removed.

1 open issue
What changed in this PR

Addresses #3759 by making PolicyPuppetryConverter identifiers distinguish custom template content, preventing different unnamed templates from sharing an identifier and default registry name.

Changes:

  • Adds a truncated SHA-256 template-content hash to identifier parameters.
  • Adds a regression test asserting that different custom templates produce different hashes.
File Description
tests/​unit/​converter/​test_policy_puppetry_converter.py Tests identifier differences between two custom templates.
pyrit/​converter/​policy_puppetry_converter.py Includes template content in identifier generation.

Review effort: Balanced

@romanlutz

Copy link
Copy Markdown
Contributor

Closing for now, mirroring the handling of #3760/#4085: issue #3759 is assigned to Ayoub (@Ayoubhm07), who gets until 11/11 to say whether they want to implement it. If they pass, this PR will be reopened and reviewed. In general, please claim an issue and wait for ownership confirmation before starting work, so maintainers can coordinate and avoid duplicated effort.

The identifier now includes a template content hash, so the contract
test's strict xfail for this setting would XPASS. The samples module
already provides two distinct custom templates for the check.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@HhH666-ux

Copy link
Copy Markdown
Contributor Author

Same check-in for this one — 11/11 has passed, so has the owner released #3759? The prompt_template entry is already gone from KNOWN_GAPS (d5d555c) and the branch is ready to rebase on request.

@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Nov 15, 2026
Merged via the queue into microsoft:main with commit d139509 Nov 15, 2026
62 checks passed
Roman Lutz (romanlutz) added a commit to HhH666-ux/PyRIT that referenced this pull request Nov 16, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: PolicyPuppetryConverter identifies a custom template by its name only

3 participants