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.

Metadata

Release files for superred-optimizer-flip-attack 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for superred-optimizer-flip-attack 0.1.0
File Size Uploaded Provenance
superred_optimizer_flip_attack-0.1.0.tar.gz 19.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for superred-optimizer-flip-attack 0.1.0
File Interpreter ABI Platform
superred_optimizer_flip_attack-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.9 kB

Release files / superred_optimizer_flip_attack-0.1.0.tar.gz

Download URL superred_optimizer_flip_attack-0.1.0.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
277e39bb09d1df40b7127f59a8ec8958307202ee351f90a18e9b06413f1f5302
BLAKE2b-256 checksum
How to use checksums
dc11ec22004bb089ca2c1ff2d717d30a44ffb9cf09af59bf7b0ed863e0497d84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Release files / superred_optimizer_flip_attack-0.1.0-py3-none-any.whl

Download URL superred_optimizer_flip_attack-0.1.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae0600f814e6932f7feda1f3c87961d8c1e73fbe607937596e6f4268cfdd3fe4
BLAKE2b-256 checksum
How to use checksums
5e13028ddbacf31c1f779b0b5190e745eb13d1e89b8c66593bc6ee579306006d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Security for superred-optimizer-flip-attack 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for superred_optimizer_flip_attack-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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