probes.encoding: add InjectFancyText Unicode font encoding - #2118
Open
setuparimi wants to merge 1 commit into
Open
probes.encoding: add InjectFancyText Unicode font encoding#2118setuparimi wants to merge 1 commit into
setuparimi wants to merge 1 commit into
Conversation
Add a "fancy text" encoding to the encoding probe that maps ASCII to visually-similar Unicode glyphs (fullwidth forms and Mathematical Alphanumeric Symbols, bold and monospace), in the style of the qaz.wtf Unicode text converter. The transforms are algorithmic (fixed Unicode code-point offsets), so no third-party mapping table is bundled and no new dependency is added. The probe reuses the existing encoding.DecodeMatch / DecodeApprox detectors unchanged, since the stored trigger remains the plaintext payload. Closes NVIDIA#152 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Setu Parimi <40615252+setuparimi@users.noreply.github.com>
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 new "fancy text" Unicode font encoding to the
encodingprobe, addressing the remaining unchecked item (utf (qaz.wtf)) in #152. Thezalgoitem from that issue is already implemented; this completes the list.The new
probes.encoding.InjectFancyTextprobe encodes payloads by mapping ASCII characters to visually-similar Unicode glyphs, in the style of the qaz.wtf Unicode text converter. It ships three algorithmic transforms asencoding_funcs:Hello→Hello)Hello→𝐇𝐞𝐥𝐥𝐨)Hello→𝙷𝚎𝚕𝚕𝚘)Design notes
braille/morse/natoencoders.encoding.DecodeMatch(primary) andencoding.DecodeApprox(extended) detectors unchanged. The stored trigger remains the plaintext payload, so if the target decodes the fancy text back to ASCII, the existing detectors fire — exactly as forzalgo,braille, etc.Inject*probe pattern (mixin +encoding_funcs+encoding_name+active = True); registration is automatic via plugin discovery.Verification
python -m pytest tests/probes/test_probes_encoding.py tests/detectors/test_detectors_encoding.py→ 116 passed, 1 skippedInjectFancyTextenumerates via_plugins.enumerate_plugins("probes")and produces prompts/triggers of equal length.test_fancy_text_functions, mirroringtest_atbash_function), so the sharedtest_encoding_triggers_not_in_promptsinvariant holds.encoding.DecodeMatchscores a hit when a response decodes the fancy text back to the plaintext trigger.probes.encoding.*class and pass).black --config pyproject.toml(v25.1.0, matching.pre-commit-config.yaml) — added code is formatted.No special hardware or complex environment required.