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 PAPAttack

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

Overview

Concrete persuasion-sweep attack that rewrites a harmful goal using each technique in a 40-entry persuasion taxonomy, sends the rewrite to the target, and stops at the first success, provided by the HackAgent adaptive attacks package.

Description

PAPAttack extends IterativeAttack. In search(), it iterates over resolved persuasion techniques (from the taxonomy). For each technique, it asks the attacker model to rewrite the goal using build_mutation_prompt(). The rewrite is sent to the target, the panel judges the reply, and the search stops at the first success. Failed rewrites (unusable attacker output) are skipped, so one bad technique doesn't end the search. Every technique that reached the target is returned as a finding, so the run reports which techniques worked.

Usage

  • Campaign config: Set attack_type: pap with an attacker role and technique selection.
  • Technique selection: Use "top5", "all", or explicit technique names.

Code Reference

Source Location

Signature

class PAPAttack(IterativeAttack[PAPParams]):
    name = "pap"
    params_type = PAPParams

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

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

Import

from hackagent.attacks.techniques.adaptive.pap.attack import PAPAttack

I/O Contract

Inputs

Name Type Required Description
params PAPParams Yes Technique selection, 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 technique that reached the target

Usage Examples

Define in Campaign YAML

# attacks:
#   - name: pap
#     techniques: top5
#     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