feat(buffs): add Caesar cipher buff - #2087
Open
albrodfer1 wants to merge 2 commits into
Open
Conversation
Signed-off-by: Alberto Rodriguez <65337726+albrodfer1@users.noreply.github.com>
albrodfer1
force-pushed
the
feature/caesar-probe
branch
from
August 18, 2026 14:04
e925f79 to
dfcad05
Compare
Collaborator
|
New probes should include a demonstration that the probe gets hits on a reasonable target - do you have that? |
Signed-off-by: Alberto Rodriguez <65337726+albrodfer1@users.noreply.github.com>
Author
Hi @leondz, thanks for your message. Since this feature is a buff, in order to prove its value, I selected an existing probe Using the buff significantly decreases the model score against the probe: Baseline: 75.8% Run details
Attached files
|
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.
What this does
Adds a
Caesarbuff (buffs.encoding.Caesar) that shift-encodes probe prompts with a Caesar cipher, so any probe's prompts can be tested against a target's ability to decode-and-follow shifted text (a jailbreak/obfuscation vector).DEFAULT_PARAMS = {"shift": 5}.Follows the existing
buffs.encoding.Base64/CharCodeidiom (transform()rewritingattempt.prompt). Auto-discovered — no registration needed. Leavespost_buff_hook = False, so the raw model response is scored.Verification
python -m pytest tests/buffs/→ 14 passed, 1 skippedHello, World! xyz XYZ→Mjqqt, Btwqi! cde CDE(wrap + case preserved, non-letters untouched), covered bytest_caesar_shiftintests/buffs/test_buffs.pytest_buff_structure/test_buff_load_and_transformcover load + transformpython -m garak -t test.Blank --spec 'probes.test.Test,buffs.encoding.Caesar'— buff loads, expands attempts, and the report contains correctly-encoded prompts (The quick brown fox jumps over the lazy dog→Ymj vznhp gwtbs ktc ozrux tajw ymj qfed itl)