Repository navigation
FEAT: Add char_split attack technique in extra.py - #3381
Merged
Roman Lutz (romanlutz) merged 5 commits intoOct 26, 2026
Merged
Roman Lutz (romanlutz) merged 5 commits into
Roman Lutz (romanlutz) merged 5 commits into
Conversation
Absarahmedofficial
force-pushed
the
feat/char-split-output-converter
branch
from
October 22, 2026 23:02
660c0d4 to
de4c0b6
Compare
Roman Lutz (romanlutz)
approved these changes
Oct 26, 2026
Roman Lutz (romanlutz)
left a comment
Contributor
There was a problem hiding this comment.
Excellent contribution! I'm adding a couple of tests but this is good to merge.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5702ce84-3326-45d7-8b0e-32f10eb5c16e
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5702ce84-3326-45d7-8b0e-32f10eb5c16e
This was referenced Oct 26, 2026
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.
Description
Registers the
char_splitattack technique inpyrit/setup/initializers/techniques/extra.pyby composingPromptTemplateConverterandSearchReplaceConverteronPromptSendingAttackviaAttackConverterConfig:PromptTemplateConverter): Appends output-formatting instructions asking the target to insert'.'between adjacent letters inside each word while leaving spaces, hyphens, and punctuation unchanged.SearchReplaceConverter): Normalizes the response before scoring with a single-pass regex (pattern=r"(\.){2}|(?<=\S)\.(?=\S)",replace=r"\1") that unescapes doubled periods (..->.) and strips single intra-word periods (.->"").This replaces the earlier OutputFormatConverter/CharSplitOutputConverter approach in this PR, per the review discussion. Those files are removed.
cc Roman Lutz (@romanlutz)
Tests and Documentation
EXTRA_TECHNIQUE_NAMESandtest_default_registers_only_coreintests/unit/setup/test_technique_initializer.py.TestCharSplitTechniqueintests/unit/setup/techniques/test_extra_techniques.pycovering factory wiring, request prompt formatting, response decoding/unescaping, and end-to-end execution throughAttackExecutor.