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
gcgjudge'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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c35a83c33580af20686249ba1fbf25b15917a03f73480888231db5d567d90d6d
|
|
| MD5 |
9cb8dd2ae9e621288ede38c5803b6b6b
|
|
| BLAKE2b-256 |
46223eba5f326066bc7be39efed078e55b923a2ea4e7b74d815b597b346f9e6b
|
Provenance
The following attestation bundles were made for superred_optimizer_pair-0.1.0.tar.gz:
Publisher:
release.yml on RoldSI/superred-modules
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
superred_optimizer_pair-0.1.0.tar.gz -
Subject digest:
c35a83c33580af20686249ba1fbf25b15917a03f73480888231db5d567d90d6d - Sigstore transparency entry: 2219269123
- Sigstore integration time:
-
Permalink:
RoldSI/superred-modules@44b3a2514b4d75fe7ebc3f015aa13ff3b6e8380c -
Branch / Tag:
refs/tags/superred-optimizer-pair-v0.1.0 - Owner: https://github.com/RoldSI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@44b3a2514b4d75fe7ebc3f015aa13ff3b6e8380c -
Trigger Event:
push
-
Statement type:
File details
Details for the file superred_optimizer_pair-0.1.0-py3-none-any.whl.
File metadata
- Download URL: superred_optimizer_pair-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec3280405ff33cb0ea085a5ff8b3189eb821205f6ddbe160f603b87e36b4f62b
|
|
| MD5 |
34cbea89282e7e7a25ac284e14c1fe8b
|
|
| BLAKE2b-256 |
db8c78449140cd7c1b6f8e6fe4e7a7286bf2f650d279225a35989ded06e0de80
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
superred_optimizer_pair-0.1.0-py3-none-any.whl -
Subject digest:
ec3280405ff33cb0ea085a5ff8b3189eb821205f6ddbe160f603b87e36b4f62b - Sigstore transparency entry: 2219269266
- Sigstore integration time:
-
Permalink:
RoldSI/superred-modules@44b3a2514b4d75fe7ebc3f015aa13ff3b6e8380c -
Branch / Tag:
refs/tags/superred-optimizer-pair-v0.1.0 - Owner: https://github.com/RoldSI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@44b3a2514b4d75fe7ebc3f015aa13ff3b6e8380c -
Trigger Event:
push
-
Statement type: