superred-optimizer-tap
A Tree of Attacks with Pruning (TAP) jailbreak optimizer for the superred red-teaming framework.
TAP treats jailbreaking as a tree search. An attacker LLM proposes candidate prompts, off-topic ones are pruned away, every surviving prompt is sent to the real target, and each prompt/response pair is scored 1–10. The best branches are kept and expanded again, deepening the tree until a prompt scores a full 10 or the maximum depth is reached.
Reference: Mehrotra et al., "Tree of Attacks: Jailbreaking Black-Box LLMs
Automatically," arXiv:2312.02119
(NeurIPS 2024). Official implementation:
RICommunity/TAP (MIT License).
See ASSUMPTIONS.md for the full paper-to-code mapping and every
deliberate departure.
Install
pip install superred-optimizer-tap
Usage
from tap_optimizer import TapOptimizer
# Paper-aligned defaults (branching_factor=1, tree_width=10, tree_depth=10, ...).
optimizer = TapOptimizer()
# Reproduce a specific TAP experiment by setting the target opening string.
optimizer = TapOptimizer(target_str="Sure, here is", tree_depth=8)
Wire it into a Controller like any other superred optimizer — see the
framework's architecture overview and a
target's README (e.g. superred-target-chatbot) for a full Controller.run() example.
License
MIT for this port's code (see LICENSE). The upstream reference
implementation, RICommunity/TAP, is MIT
licensed. This port reimplements the TAP search and prompts against superred's
event model rather than vendoring upstream source files.
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_tap-0.1.0.tar.gz.
File metadata
- Download URL: superred_optimizer_tap-0.1.0.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3ab8e729afd0888632584540fc87f241d210c7c3d54a4b16be473eeb6053a63
|
|
| MD5 |
b3869ba0d6aa88bdf3af073cdac3cfb6
|
|
| BLAKE2b-256 |
9026305c19d26f3a7bf256b252cf8b488f952017aabaa4b88a716123dbcaf528
|
Provenance
The following attestation bundles were made for superred_optimizer_tap-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_tap-0.1.0.tar.gz -
Subject digest:
c3ab8e729afd0888632584540fc87f241d210c7c3d54a4b16be473eeb6053a63 - Sigstore transparency entry: 2227765820
- Sigstore integration time:
-
Permalink:
RoldSI/superred-modules@be1b4b03c78de2bec30d03265fcbd35605d2bd0e -
Branch / Tag:
refs/tags/superred-optimizer-tap-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@be1b4b03c78de2bec30d03265fcbd35605d2bd0e -
Trigger Event:
push
-
Statement type:
File details
Details for the file superred_optimizer_tap-0.1.0-py3-none-any.whl.
File metadata
- Download URL: superred_optimizer_tap-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.7 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 |
95fcb31e499bb817d8660836f43f43bc4c0ed016045d4b521c0b410313a8bb7a
|
|
| MD5 |
c046fae1854046ad1a521c45160e0aa1
|
|
| BLAKE2b-256 |
b6f127ed3159e7aa7afa6afd43791b9a65ab52e43083d63e8cfe4b2a2b1b906a
|
Provenance
The following attestation bundles were made for superred_optimizer_tap-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_tap-0.1.0-py3-none-any.whl -
Subject digest:
95fcb31e499bb817d8660836f43f43bc4c0ed016045d4b521c0b410313a8bb7a - Sigstore transparency entry: 2227766295
- Sigstore integration time:
-
Permalink:
RoldSI/superred-modules@be1b4b03c78de2bec30d03265fcbd35605d2bd0e -
Branch / Tag:
refs/tags/superred-optimizer-tap-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@be1b4b03c78de2bec30d03265fcbd35605d2bd0e -
Trigger Event:
push
-
Statement type: