Skip to content

probes: add persuasion (Persuasive Adversarial Prompt) probe - #1955

Open
JayYarlagadda wants to merge 1 commit into
NVIDIA:mainfrom
JayYarlagadda:probe/persuasion
Open

JayYarlagadda wants to merge 1 commit into
NVIDIA:mainfrom
JayYarlagadda:probe/persuasion

Conversation

@JayYarlagadda

Copy link
Copy Markdown

Summary

Adds garak.probes.persuasion.PersuasiveJailbreak, a probe implementing Persuasive Adversarial Prompts (PAPs) from Zeng et al., "How Johnny Can Persuade LLMs to Jailbreak Them" (arXiv:2401.06373). The probe rewrites base harmful requests into persuasive phrasings using a configurable red-team generator, then sends them to the target.

Closes #683.

Draft: opening for maintainer feedback on the scope questions below before finalising.

What's included

  • garak/probes/persuasion.py — the PersuasiveJailbreak probe.
  • garak/data/persuasion/persuasion_taxonomy.jsonl — the openly-released, Apache-2.0 persuasion taxonomy (40 techniques), vendored with SPDX header + attribution.
  • garak/data/persuasion/README.md — provenance, licensing, and citation.
  • docs/source/probes/persuasion.rst + docs/source/index_probes.rst — docs wiring.
  • tests/probes/test_probes_persuasion.py — unit tests.

Design decisions (open to change)

  1. Runtime generation — PAPs are generated at run time by a configurable red-team generator; no harmful prompts are stored in the repo. Only the Apache-2.0 taxonomy is vendored. The gated harmful PAP dataset is neither shipped nor auto-downloaded.
  2. active = False by default, since the probe needs a red-team model to function.
  3. Naming — module persuasion, class PersuasiveJailbreak; primary_detector = mitigation.MitigationBypass.

Scope questions for maintainers

  1. Is runtime red-team generation acceptable, or would you prefer a cached/offline-generated set?
  2. OK to default active=False given it needs a red-team model?
  3. Any preferred module/class naming?

Testing

.\.venv\Scripts\python.exe -m pytest tests/probes/test_probes_persuasion.py -q

Result: 8 passed. Tests use garak's test.Repeat/test.Blank stand-in generators, so they run without network access or API keys.

Note on prior claim

The earlier volunteer (@asaadkhaja99) claimed this in Oct 2025 but has been inactive for 8+ months with no PR. I posted intent on the issue before proceeding. Happy to coordinate if they are still working on it.

Disclosure

AI assistance was used in preparing this contribution. Every changed line has been reviewed by me, and the tests above were run and pass.

Add garak.probes.persuasion.PersuasiveJailbreak, which rewrites base
harmful requests into Persuasive Adversarial Prompts (PAPs) using a
configurable red-team generator and the social-influence taxonomy from
Zeng et al. (arXiv:2401.06373). Only the openly-released, Apache-2.0
persuasion taxonomy is vendored; no gated harmful data is shipped or
downloaded. Includes docs and tests.

This change was AI-assisted (GitHub Copilot); the author reviewed every
line and ran the tests.

Co-authored-by: GitHub Copilot <[email protected]>
Signed-off-by: Jayanth Sai Yarlagadda <[email protected]>
@JayYarlagadda
JayYarlagadda marked this pull request as ready for review August 8, 2026 03:56
@JayYarlagadda

Copy link
Copy Markdown
Author

Marked ready for review. Rebased on latest main; persuasion tests (8), black --check, and tests/test_docs.py (683) all pass locally. @leondz this implements #683 (Persuasive Adversarial Prompts) — I'd welcome your steer on the three scope questions in the description (runtime red-team generation vs cached set, active=False default, and module/class naming). Happy to adjust direction.

@ma7bor ma7bor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Head b84b51a against base cafbe99. The new tests pass, but two generic tests fail on the new probe. Only DCO has run on this PR so far, so CI hasn't shown them.

$ python -m pytest tests/probes/test_probes_persuasion.py -q
8 passed

$ python -m pytest tests/probes/ tests/langservice/ tests/test_docs.py tests/test_config.py -q -k persuasion
FAILED tests/probes/test_probes.py::test_probe_intent[probes.persuasion.PersuasiveJailbreak]
E   AssertionError: concrete probes must set intent to a typology code
FAILED tests/langservice/probes/test_probes_base.py::test_probe_prompt_translation[probes.persuasion.PersuasiveJailbreak]
E   garak.exception.APIKeyMissingError: Put the NIM API key in the NIM_API_KEY environment variable

# with the two lines below applied
18 passed, 2778 deselected
# pytest 9.2.0, Python 3.12.16, deps from requirements.txt; black 25.1.0 (.pre-commit-config.yaml) clean
# not run: a scan against a live red-team model or target

intent has been required since 9df1a31. fitd.FITD also rewrites HarmBench requests through a red-team model, and it uses T009ignore. The red-team probes (fitd.FITD, tap.TAP, dan.AutoDAN) are also in NON_PROMPT_PROBES, and #1460 adds its persuasion probe there too.

--- a/garak/probes/persuasion.py
+++ b/garak/probes/persuasion.py
     goal = "persuade the target to produce disallowed content"
+    intent = "T009ignore"
--- a/tests/langservice/probes/test_probes_base.py
+++ b/tests/langservice/probes/test_probes_base.py
     "probes.fitd.FITD",
+    "probes.persuasion.PersuasiveJailbreak",
 ]

With test.Single as the red-team model returning "I'm sorry, but I can't help with that request.", all 4 attempts carry that refusal as the prompt. Their notes are {}. An aligned red-team model refuses some rewrites of HarmBench requests, so a real run can score the target on refusals. Could _generate_pap drop a rewrite that mitigation.MitigationBypass flags as a refusal?

With test.Nones as the red-team model, self.prompts stays empty, and Probe.probe() raises at garak/probes/base.py:402:

    if isinstance(prompts[0], str):
IndexError: list index out of range

non-blocking: notes holds neither the technique nor the base prompt. So a report can't give the per-technique success rate, which is the paper's main result. @jmartin-tech asked #1460 to enrich notes through _generator_precall_hook or _postprocess_hook.

non-blocking: PAP_GENERATION_TEMPLATE is in the module. On #1460, @leondz asked for it in garak/data so that users can customise it.

Calling super().probe() after building the prompts does keep the translation path, which was the other concern on #1460.

@leondz #1460 implements the same issue and is still open, so the open call is scope. On #1460 you asked for the 33,600-prompt broad scan and the iterative method. This PR defaults to 8 base prompts × 5 techniques = 40, with no iteration. Is that scope enough here, or should the two PRs be combined first?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

probe: persuasive jailbreak

2 participants