Skip to main content

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

superred_optimizer_flip_attack-0.1.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

superred_optimizer_flip_attack-0.1.0-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file superred_optimizer_flip_attack-0.1.0.tar.gz.

File metadata

File hashes

Hashes for superred_optimizer_flip_attack-0.1.0.tar.gz
Algorithm Hash digest
SHA256 277e39bb09d1df40b7127f59a8ec8958307202ee351f90a18e9b06413f1f5302
MD5 0fa7bbd210289d0d97717242dc068dd8
BLAKE2b-256 dc11ec22004bb089ca2c1ff2d717d30a44ffb9cf09af59bf7b0ed863e0497d84

See more details on using hashes here.

Provenance

The following attestation bundles were made for superred_optimizer_flip_attack-0.1.0.tar.gz:

Publisher: release.yml on RoldSI/superred-modules

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file superred_optimizer_flip_attack-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for superred_optimizer_flip_attack-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae0600f814e6932f7feda1f3c87961d8c1e73fbe607937596e6f4268cfdd3fe4
MD5 d55368f80696def8f95e36500a381536
BLAKE2b-256 5e13028ddbacf31c1f779b0b5190e745eb13d1e89b8c66593bc6ee579306006d

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page