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 CrescendoAttack

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

Overview

Concrete multi-turn conversation escalation attack that grows one conversation with the target a turn at a time, backtracking on refusals instead of restarting, so the harmful question reads as the next step, provided by the HackAgent multi-turn attacks package.

Description

CrescendoAttack extends IterativeAttack. Unlike PAIR/TAP which send each attempt cold, Crescendo maintains one growing conversation with the target. The attacker proposes progressively more specific questions; each accepted turn is appended to the target's history and the whole conversation is re-sent. Refusals are backtracked: the refused turn is dropped from history and the attacker rephrases the same step (costing a backtrack, not a turn). Once the backtrack budget is spent, a refusal is accepted and the conversation moves on. The attack maintains two conversations: the target's (the attack surface) and the attacker's planning log (trimmed to keep_last_n turns).

Usage

  • Campaign config: Set attack_type: crescendo with an attacker role and turn/backtrack budgets.

Code Reference

Source Location

Signature

class CrescendoAttack(IterativeAttack[CrescendoParams]):
    name = "crescendo"
    params_type = CrescendoParams

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

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

Import

from hackagent.attacks.techniques.multi_turn.crescendo.attack import CrescendoAttack

I/O Contract

Inputs

Name Type Required Description
params CrescendoParams Yes Turn/backtrack budgets, attacker role
goal str Yes The harmful goal
target Target Yes Callable target model
judge Judge No Panel scorer

Outputs

Name Type Description
search() list[Finding] One finding per turn (including backtracked)

Usage Examples

Define in Campaign YAML

# attacks:
#   - name: crescendo
#     max_turns: 10
#     max_backtracks: 10
#     attacker:
#       connection: {type: litellm, provider: openai, model: gpt-4o}

Related Pages

Implements Principle

Page Connections

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