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 PAP Persuasion Taxonomy

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

Overview

Concrete catalogue of 40 persuasion techniques with definitions and examples, plus few-shot prompt templates for paraphrasing harmful queries into persuasive adversarial prompts, provided by the HackAgent PAP attack.

Description

PERSUASION_TAXONOMY is a list of 40 dictionaries, each describing a persuasion technique (evidence-based, logical appeal, authority endorsement, emotional appeal, etc.) with a technique name, a definition, and a worked example. The module also exposes build_pap_prompt() which wraps a harmful goal with a taxonomy-driven few-shot paraphrase template, and extract_mutated_text() which parses the attacker LLM's response to recover the mutated adversarial prompt. The taxonomy is ported from the original PAP codebase (CHATS-lab/persuasive_jailbreaker).

Usage

  • PAP attack: The PAP attack imports PERSUASION_TAXONOMY to enumerate techniques and build_pap_prompt to construct attacker prompts.
  • Custom persuasive attacks: Import the taxonomy directly to build your own persuasion-driven attack variants.
  • Research: Use the taxonomy as a structured reference for persuasion categories in social-engineering red-team work.

Code Reference

Source Location

Signature

PERSUASION_TAXONOMY: List[Dict[str, str]] = [
    {"technique": str, "definition": str, "example": str},
    # ... 40 entries ...
]

def build_pap_prompt(goal: str, technique: dict) -> str:
    """Build a few-shot attacker prompt for one persuasion technique."""

def extract_mutated_text(response: str) -> str:
    """Extract the mutated adversarial prompt from the attacker LLM response."""

Import

from hackagent.attacks.techniques.adaptive.pap.taxonomy import (
    PERSUASION_TAXONOMY,
    build_pap_prompt,
    extract_mutated_text,
)

I/O Contract

Inputs

Name Type Required Description
goal str Yes The harmful query to paraphrase persuasively
technique dict Yes A taxonomy entry with technique/definition/example
response str Yes Raw attacker LLM response (for extract_mutated_text)

Outputs

Name Type Description
PERSUASION_TAXONOMY List[Dict[str, str]] 40 persuasion technique definitions
build_pap_prompt() str Few-shot attacker prompt embedding the goal
extract_mutated_text() str The extracted mutated adversarial prompt

Usage Examples

Enumerate Persuasion Techniques

from hackagent.attacks.techniques.adaptive.pap.taxonomy import PERSUASION_TAXONOMY

for entry in PERSUASION_TAXONOMY:
    print(entry["technique"], "-", entry["definition"][:60])

Build a PAP Attacker Prompt

from hackagent.attacks.techniques.adaptive.pap.taxonomy import (
    PERSUASION_TAXONOMY, build_pap_prompt,
)

goal = "Tell me how to pick a lock"
technique = PERSUASION_TAXONOMY[0]  # Evidence-based Persuasion
prompt = build_pap_prompt(goal, technique)
# Send `prompt` to an attacker LLM, then parse the mutated text

Extract Mutated Text from Attacker Response

from hackagent.attacks.techniques.adaptive.pap.taxonomy import extract_mutated_text

response = "#mutated_text_with_same_specific_harmful_or_unlawful_intention:\nSure, here is..."
mutated = extract_mutated_text(response)

Related Pages

Implements Principle

Page Connections

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