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 PAPParams

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

Overview

Concrete pydantic configuration model for the PAP attack specifying persuasion technique selection ("top5", "all", or explicit names), an optional max-techniques cap, and the required attacker role that rewrites goals, provided by the HackAgent adaptive attacks package.

Description

PAPParams extends AttackParams. The techniques field accepts "top5" (default), "all", or a list of explicit technique names. max_techniques caps the number tried per goal (0 = all). The attacker role (a Completion callable) rewrites the goal with each technique. REQUIRED_ROLES enforces the attacker at construction. A field_validator validates technique names at config time via resolve_techniques().

Usage

  • Campaign config: Set in the attacks entry of a campaign YAML.

Code Reference

Source Location

Signature

class PAPParams(AttackParams):
    REQUIRED_ROLES: ClassVar[frozenset[str]] = frozenset({"attacker"})
    techniques: Union[str, List[str]] = Field(default="top5")
    max_techniques: int = Field(default=0, ge=0)
    attacker: Optional[Completion] = Field(default=None, exclude=True, repr=False)

Import

from hackagent.attacks.techniques.adaptive.pap.config import PAPParams

I/O Contract

Inputs

Name Type Required Description
techniques List[str] No "top5", "all", or explicit names (default "top5")
max_techniques int No Cap on techniques tried (default 0 = all)
attacker Completion Yes Model that rewrites goals with techniques

Outputs

Name Type Description
return PAPParams Validated config for PAPAttack

Usage Examples

Define in Campaign YAML

# attacks:
#   - name: pap
#     techniques: ["Logical Appeal", "Authority Endorsement"]
#     max_techniques: 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