Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AISecurityLab Hackagent AutoDANTurboAttack

From Leeroopedia
Knowledge Sources
Domains Security_Testing, Adaptive_Attacks
Last Updated 2026-10-29 00:00 GMT

Overview

Concrete lifelong strategy-learning jailbreak attack that searches for reusable named tactics (not just prompts), building a growing strategy library indexed by response embeddings, provided by the HackAgent adaptive attacks package.

Description

AutoDANTurboAttack extends IterativeAttack and runs in two phases. In the warm-up phase (run-scoped prepare()), the attacker explores each goal freely while the panel scores, and the summarizer distils the gap between each goal's weakest and strongest attempt into a named strategy added to the StrategyLibrary. In the lifelong phase (per-goal search()), the library is retrieved against the target's last response, the attacker is told which strategies to reuse or avoid, and every score improvement is summarized into a new strategy. Three roles are required: attacker (crafts prompts), summarizer (names strategies), and embedder (indexes strategies by response embedding).

Usage

  • Lifelong jailbreak research: Use when you want an attack that learns across goals and carries strategies forward.
  • Strategy discovery: The library that AutoDAN-Turbo builds is itself a research output — named tactics that worked.
  • Campaign config: Set attack_type: autodan_turbo with attacker, summarizer, and embedder roles.

Code Reference

Source Location

Signature

class AutoDANTurboAttack(IterativeAttack[AutoDANTurboParams]):
    name = "autodan_turbo"
    params_type = AutoDANTurboParams

    def __init__(self, params: AutoDANTurboParams) -> None: ...

    async def prepare(
        self, goals: list[str], target: Target, judge: Optional[Judge] = None
    ) -> None: ...

    async def search(
        self, goal: str, target: Target, judge: Optional[Judge]
    ) -> list[Finding]: ...

Import

from hackagent.attacks.techniques.adaptive.autodan_turbo.attack import AutoDANTurboAttack

I/O Contract

Inputs

Name Type Required Description
params AutoDANTurboParams Yes Config with epochs, break_score, roles
goals list[str] Yes Goals to attack (prepare phase)
target Target Yes Callable target model
judge Judge No Panel scorer (0-10 verdict)

Outputs

Name Type Description
search() list[Finding] Judged attempts with scores and trace
library StrategyLibrary Growing named-strategy library

Usage Examples

Run AutoDAN-Turbo via Campaign YAML

# In campaign.yaml:
# attacks:
#   - name: autodan_turbo
#     epochs: 50
#     break_score: 8.5
#     skip_warmup: false
#     attacker: {connection: {type: litellm, ...}}
#     summarizer: {connection: {type: litellm, ...}}
#     embedder: {connection: {type: litellm, ...}}

Inspect the Strategy Library

# After a run, the attack's library contains learned strategies:
# attack.library.all() → {"Storytelling": {"Strategy": ..., "Definition": ..., "Example": [...], ...}}

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment