Skip to main content

AutoDAN-Turbo lifelong-strategy jailbreak optimizer for superred

Project description

superred-optimizer-autodan-turbo

An AutoDAN-Turbo lifelong-strategy jailbreak optimizer for the superred red-teaming framework.

AutoDAN-Turbo discovers jailbreak strategies from scratch, with no human-designed seed strategies, and remembers what worked in a strategy library that persists across attempts. One superred run is one paper "epoch" against the goal: generate an attack (cold, or informed by retrieved strategies), probe the target, score the response, and — if the score improved — mine a new {Strategy, Definition} pair into the library for future runs to retrieve.

Reference: Liu et al., "AutoDAN-Turbo: A Lifelong Agent for Strategy Self-Exploration to Jailbreak LLMs," arXiv:2410.05295 (ICLR 2025 spotlight). Official implementation: SaFo-Lab/AutoDAN-Turbo (MIT License; GitHub org renamed from SaFoLab-WISC since the paper's release — old links redirect). See ASSUMPTIONS.md for the full paper-to-code mapping and every deliberate departure.

Install

pip install superred-optimizer-autodan-turbo

Usage

from autodan_turbo_optimizer import AutoDANTurboOptimizer

optimizer = AutoDANTurboOptimizer(max_attempts=10, break_score=8.5)

The strategy library lives on the optimizer instance and persists across every run of that instance (not just within one task), matching the paper's "lifelong" framing — construct a fresh optimizer for an unrelated experiment if you don't want strategies to carry over.

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.

Behaviour notes

  • Score-based 3-tier retrieval replaces upstream's FAISS embedding retrieval step (avg strategy score ≥5 or in [2,5) → retrieve and use; otherwise cold/find_new_strategy), matching upstream's post-FAISS score filter's decision boundary without the embedding-index dependency — a documented v1 simplification, not a silent behavior change.
  • Refusal filter. If the attacker's own output looks like a refusal, the optimizer falls back to the raw goal text as the jailbreak prompt for that turn rather than sending a refusal to the target.
  • Runs in all four adversarial information-access settings: a cold attacker every run when responses aren't visible (settings 1, 2); the full lifelong loop (internal scorer + library growth + retrieval) when responses are visible (settings 3, 4). External evaluator success early-stops settings 2 and 4.
  • Single-line score/JSON parsers replace upstream's two-stage wrapper LLM calls, halving scorer/summarizer cost per turn.

License

MIT for this port's code. Prompt templates (attacker ×3, scorer, summarizer) are reproduced verbatim from the upstream reference implementation (MIT License, Copyright (c) 2023 Xiaogeng Liu) — see ASSUMPTIONS.md for exact source files.

Project details


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_autodan_turbo-0.1.0.tar.gz (39.0 kB view details)

Uploaded Source

Built Distribution

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

File details

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

File metadata

File hashes

Hashes for superred_optimizer_autodan_turbo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b95e5a89e168309738ed2943c9416b420dfcd0469e060e2a45f17eb20e1c9a98
MD5 9b3411a2f65e5f355fee521fd3be64db
BLAKE2b-256 27e979e6bcfc98e5c80c4a31c8e41e6f1fe2799e1de592ae5694b728ba4f6679

See more details on using hashes here.

Provenance

The following attestation bundles were made for superred_optimizer_autodan_turbo-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_autodan_turbo-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for superred_optimizer_autodan_turbo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61a8dcc620757ab78334f8bb497739ebf2851f84646082e256e6285057ecb77b
MD5 21a54050c68fbd1be4afbc4aad15d0f4
BLAKE2b-256 b4399ea1d5b50b4b83f05c3a99b4df4a8bb218742c9ee7f24ae412ac30a8dbff

See more details on using hashes here.

Provenance

The following attestation bundles were made for superred_optimizer_autodan_turbo-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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page