Overview
Concrete pydantic configuration model for the AutoDAN-Turbo attack specifying search length (epochs, iterations), break score, warm-up toggle, and three required model roles (attacker, summarizer, embedder).
Description
AutoDANTurboParams extends AttackParams with fields controlling the lifelong strategy search: epochs (attempts per goal per phase), break_score (0-10 threshold to stop), warmup_iterations and lifelong_iterations (passes over goals), and skip_warmup. Three model roles are injected as Completion / Embedder callables: attacker (writes jailbreak prompts), summarizer (distils strategies), and embedder (indexes strategies by response embedding). The REQUIRED_ROLES class var enforces all three at construction.
Usage
- Campaign config: Set in the attacks entry of a campaign YAML under the attack's parameters.
- Role injection: The roles are resolved by resolve_campaign from model specs and injected as callables.
Code Reference
Source Location
Signature
class AutoDANTurboParams(AttackParams):
REQUIRED_ROLES: ClassVar[frozenset[str]] = frozenset({"attacker", "embedder", "summarizer"})
epochs: int = Field(default=100, ge=1)
break_score: float = Field(default=8.5, ge=0.0, le=10.0)
warmup_iterations: int = Field(default=1, ge=1)
lifelong_iterations: int = Field(default=1, ge=1)
skip_warmup: bool = Field(default=False)
attacker: Optional[Completion] = Field(default=None, exclude=True, repr=False)
summarizer: Optional[Completion] = Field(default=None, exclude=True, repr=False)
embedder: Optional[Embedder] = Field(default=None, exclude=True, repr=False)
Import
from hackagent.attacks.techniques.adaptive.autodan_turbo.config import AutoDANTurboParams
I/O Contract
Inputs
| Name |
Type |
Required |
Description
|
| epochs |
int |
No |
Attempts per goal per phase (default 100)
|
| break_score |
float |
No |
Jailbreak threshold 0-10 (default 8.5)
|
| skip_warmup |
bool |
No |
Skip warm-up phase (default False)
|
| attacker |
Completion |
Yes |
Attacker model callable
|
| summarizer |
Completion |
Yes |
Summarizer model callable
|
| embedder |
Embedder |
Yes |
Embedding model callable
|
Outputs
| Name |
Type |
Description
|
| return |
AutoDANTurboParams |
Validated config for AutoDANTurboAttack
|
Usage Examples
Define in Campaign YAML
# attacks:
# - name: autodan_turbo
# epochs: 50
# break_score: 8.5
# skip_warmup: false
# attacker:
# connection: {type: litellm, provider: openai, model: gpt-4o}
# summarizer:
# connection: {type: litellm, provider: openai, model: gpt-4o}
# embedder:
# connection: {type: litellm, provider: openai, model: text-embedding-3-small}
Related Pages
Implements Principle
Page Connections
Double-click a node to navigate. Hold to expand connections.