Repository navigation
MAINT: Make XL-SafetyBench _row_value keyword-only - #4824
Open
Lenin Mookiah (leninworld) wants to merge 2 commits into
Open
Lenin Mookiah (leninworld) wants to merge 2 commits into
Lenin Mookiah (leninworld) wants to merge 2 commits into
Conversation
_row_value in pyrit.datasets.seed_datasets.remote.xl_safety_bench_dataset now takes key after *, and its 23 calls in the module pass it by name. Remove its entry from the keyword-only baseline and add tests that pin the helper's behaviour (stripped values, missing column and None cell give an empty string) and its keyword-only key. Relates to microsoft#4216
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the change making _row_value’s key argument keyword-only.
No open issues 🎉
What changed in this PR
Advances #4216 by making XL-SafetyBench’s private _row_value helper require key as a keyword argument, without changing return values.
Changes:
- Updates all 23 loader calls to pass
key=. - Removes the helper from the keyword-only baseline.
- Adds tests for cell normalization and rejection of positional
keyarguments.
| File | Description |
|---|---|
tests/unit/datasets/test_xl_safety_bench_dataset.py |
Tests normalization and keyword-only enforcement. |
pyrit/datasets/seed_datasets/remote/xl_safety_bench_dataset.py |
Updates the helper signature and all callers. |
build_scripts/keyword_only_baseline.txt |
Removes the migrated helper’s exemption. |
Review effort: Balanced
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hannahwestra25
approved these changes
Dec 4, 2026
hannahwestra25
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for contributing! Merged the latest main into this branch; no source changes were needed.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses part of issue #4216.
Description
Make
_row_valueinpyrit.datasets.seed_datasets.remote.xl_safety_bench_datasetkeyword-only, and clear it from the keyword-only baseline._row_value(row, *, key):rowstays the one positional parameter, and the helper's 23 calls in the module (the jailbreak, jailbreak-objectives and cultural loaders) passkey=by name.build_scripts/keyword_only_baseline.txt.Nonecell (a short CSV row) gives"". One more test checks that passingkeypositionally raisesTypeError.Relates to #4216