superred-optimizer-flip-attack
A FlipAttack single-turn jailbreak optimizer for the superred red-teaming framework.
Community port — not an official implementation. This module is an unofficial re-implementation of FlipAttack (Liu et al.) for superred. It is not affiliated with, endorsed by, or maintained by the original authors. See ASSUMPTIONS.md for every deliberate deviation from the paper and reference code.
FlipAttack scrambles the harmful task by flipping it — reversing characters or words — and then teaches the target, in the same prompt, how to unflip and follow it. The scrambled task slips past refusal filters that only recognize plain text, while a capable model still restores and executes it. It is a pure text transform: no attacker LLM is needed to build the prompt.
Reference: Liu et al., "FlipAttack: Jailbreak LLMs via Flipping,"
arXiv:2410.02832 (ICML 2025). Official
implementation: yueliu1999/FlipAttack.
See ASSUMPTIONS.md for the full paper-to-code mapping and every
deliberate departure.
Install
pip install superred-optimizer-flip-attack
Usage
from flip_attack_optimizer import FlipAttackOptimizer
# Default rotation starts with FCS (the paper's default mode).
optimizer = FlipAttackOptimizer()
# Paper-faithful single-mode behaviour: configure exactly one flip mode.
optimizer = FlipAttackOptimizer(flip_modes=["FCS"])
Wire it into a Controller like any other superred optimizer — see the
framework's architecture overview and a
target's README (e.g. superred-target-chatbot) for a full Controller.run() example.
License
MIT for this port's code (see LICENSE). The upstream reference
implementation,
yueliu1999/FlipAttack, is MIT
licensed. The vanilla and LangGPT prompt text, few-shot examples, and judge
prompt ported from it are credited in NOTICE, and its MIT copyright
notice is preserved in
LICENSES/FlipAttack-MIT.txt.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file superred_optimizer_flip_attack-0.1.0.tar.gz.
File metadata
- Download URL: superred_optimizer_flip_attack-0.1.0.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
277e39bb09d1df40b7127f59a8ec8958307202ee351f90a18e9b06413f1f5302
|
|
| MD5 |
0fa7bbd210289d0d97717242dc068dd8
|
|
| BLAKE2b-256 |
dc11ec22004bb089ca2c1ff2d717d30a44ffb9cf09af59bf7b0ed863e0497d84
|
Provenance
The following attestation bundles were made for superred_optimizer_flip_attack-0.1.0.tar.gz:
Publisher:
release.yml on RoldSI/superred-modules
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
superred_optimizer_flip_attack-0.1.0.tar.gz -
Subject digest:
277e39bb09d1df40b7127f59a8ec8958307202ee351f90a18e9b06413f1f5302 - Sigstore transparency entry: 2519617772
- Sigstore integration time:
-
Permalink:
RoldSI/superred-modules@1c1cbc87f3969cd4417cb4ecbd685252ad82c185 -
Branch / Tag:
refs/tags/superred-optimizer-flip-attack-v0.1.0 - Owner: https://github.com/RoldSI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1c1cbc87f3969cd4417cb4ecbd685252ad82c185 -
Trigger Event:
push
-
Statement type:
File details
Details for the file superred_optimizer_flip_attack-0.1.0-py3-none-any.whl.
File metadata
- Download URL: superred_optimizer_flip_attack-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae0600f814e6932f7feda1f3c87961d8c1e73fbe607937596e6f4268cfdd3fe4
|
|
| MD5 |
d55368f80696def8f95e36500a381536
|
|
| BLAKE2b-256 |
5e13028ddbacf31c1f779b0b5190e745eb13d1e89b8c66593bc6ee579306006d
|
Provenance
The following attestation bundles were made for superred_optimizer_flip_attack-0.1.0-py3-none-any.whl:
Publisher:
release.yml on RoldSI/superred-modules
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
superred_optimizer_flip_attack-0.1.0-py3-none-any.whl -
Subject digest:
ae0600f814e6932f7feda1f3c87961d8c1e73fbe607937596e6f4268cfdd3fe4 - Sigstore transparency entry: 2519617865
- Sigstore integration time:
-
Permalink:
RoldSI/superred-modules@1c1cbc87f3969cd4417cb4ecbd685252ad82c185 -
Branch / Tag:
refs/tags/superred-optimizer-flip-attack-v0.1.0 - Owner: https://github.com/RoldSI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1c1cbc87f3969cd4417cb4ecbd685252ad82c185 -
Trigger Event:
push
-
Statement type: