Skip to main content

PAIR jailbreak optimizer for superred

Project description

superred-optimizer-pair

PAIR (Prompt Automatic Iterative Refinement) jailbreak optimizer for the superred red-teaming framework.

PAIR is a query-efficient, black-box jailbreak method: an attacker LLM iteratively refines an adversarial prompt against a target model, using a judge to score each attempt and feeding the target's response back as the next iteration's context.

Install

pip install superred-optimizer-pair

Credits / upstream

This optimizer is a faithful reimplementation of PAIR (Prompt Automatic Iterative Refinement) for the superred framework.

  • PAIR - Chao et al., "Jailbreaking Black Box Large Language Models in Twenty Queries" (arXiv:2310.08419), https://github.com/patrickrchao/JailbreakingLLMs. MIT License, Copyright (c) 2023 PAIR Team. The attacker system prompts, the GPT-judge prompt and Rating: [[n]] format, the init/feedback message formats, the GCG refusal keyword dictionary, and the runtime defaults are ported verbatim from this repository and are redistributed here under its MIT license.
  • Persuasion prompt examples - the logical-appeal and authority-endorsement worked examples derive from Zeng et al., "How Johnny Can Persuade LLMs to Jailbreak Them" (arXiv:2401.06373), reaching this module through the PAIR repository.
  • Refusal dictionary - the gcg judge's refusal-string list originates from GCG (Zou et al., arXiv:2307.15043, https://github.com/llm-attacks/llm-attacks, MIT, Copyright (c) 2023 Andy Zou), via PAIR.

Our superred integration code is MIT-licensed (see LICENSE and NOTICE).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

superred_optimizer_pair-0.1.0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

superred_optimizer_pair-0.1.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file superred_optimizer_pair-0.1.0.tar.gz.

File metadata

  • Download URL: superred_optimizer_pair-0.1.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for superred_optimizer_pair-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c35a83c33580af20686249ba1fbf25b15917a03f73480888231db5d567d90d6d
MD5 9cb8dd2ae9e621288ede38c5803b6b6b
BLAKE2b-256 46223eba5f326066bc7be39efed078e55b923a2ea4e7b74d815b597b346f9e6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for superred_optimizer_pair-0.1.0.tar.gz:

Publisher: release.yml on RoldSI/superred-modules

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file superred_optimizer_pair-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for superred_optimizer_pair-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec3280405ff33cb0ea085a5ff8b3189eb821205f6ddbe160f603b87e36b4f62b
MD5 34cbea89282e7e7a25ac284e14c1fe8b
BLAKE2b-256 db8c78449140cd7c1b6f8e6fe4e7a7286bf2f650d279225a35989ded06e0de80

See more details on using hashes here.

Provenance

The following attestation bundles were made for superred_optimizer_pair-0.1.0-py3-none-any.whl:

Publisher: release.yml on RoldSI/superred-modules

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page