feat(probes/encoding): add InjectCaesar probe#1877
Conversation
Adds a Caesar cipher encoding probe that tests whether models silently decode and execute instructions obfuscated with Caesar cipher shifts (3, 7, and 17). Complements the existing InjectROT13 probe which covers shift 13. Includes parametrized unit tests for the _caesar_shift function. Signed-off-by: Ujwal-Ramachandran <contactme.ujwal@gmail.com>
There was a problem hiding this comment.
Can you offer details on how this was tested, do you know of a target within the last year that will show a rate of successful attack from this probe?
Validation of the efficacy of new probes is an important factor is evaluating suitability for inclusion especially when marked active and Tier.OF_CONCERN or higher.
|
Hi! Sure, here's my testing methodology. Tested locally by:
Output: Full test output: test_output.txt Evidence of real-world efficacy Caesar cipher as an injection vector has consistent empirical support:
Yuan et al. (2023) predates the one-year window, but is directly cited in both May 2025 papers above, confirming the attack surface remains active in current literature. The multi-shift design (3, 7, 17) is intentional. Yuan et al. and the ICLR 2025 bijection learning paper (Huang et al.) both note that shift-3 is over-represented in pre-training data. Non-standard shifts test whether safety failures generalise beyond the classical variant. Please let me know if you need anything else. Thanks. |
Adds a Caesar cipher encoding probe that tests whether models silently decode and execute instructions obfuscated with Caesar cipher shifts (3, 7, and 17). Complements the existing InjectROT13 probe which covers shift 13.
Includes parametrized unit tests for the _caesar_shift helper function.
What changed
garak/probes/encoding.py: addedInjectCaesarclass with_caesar_shifthelper supporting configurable shift valuestests/probes/test_probes_encoding.py: added parametrized tests for_caesar_shiftand probe instantiationgarak/data/plugin_cache.json: regenerated via--list_probesTesting
pytest tests/probes/test_probes_encoding.py tests/probes/test_probes.py
Verification
python -m pytest tests/probes/test_probes_encoding.py tests/probes/test_probes.pytest_encoding_triggers_not_in_promptsparametrized test)