Skip to main content

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.

Metadata

Release files for superred-optimizer-tap 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for superred-optimizer-tap 0.1.0
File Size Uploaded Provenance
superred_optimizer_tap-0.1.0.tar.gz 22.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for superred-optimizer-tap 0.1.0
File Interpreter ABI Platform
superred_optimizer_tap-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.9 kB

Release files / superred_optimizer_tap-0.1.0.tar.gz

Download URL superred_optimizer_tap-0.1.0.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c3ab8e729afd0888632584540fc87f241d210c7c3d54a4b16be473eeb6053a63
BLAKE2b-256 checksum
How to use checksums
9026305c19d26f3a7bf256b252cf8b488f952017aabaa4b88a716123dbcaf528
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

Release files / superred_optimizer_tap-0.1.0-py3-none-any.whl

Download URL superred_optimizer_tap-0.1.0-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95fcb31e499bb817d8660836f43f43bc4c0ed016045d4b521c0b410313a8bb7a
BLAKE2b-256 checksum
How to use checksums
b6f127ed3159e7aa7afa6afd43791b9a65ab52e43083d63e8cfe4b2a2b1b906a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

Security for superred-optimizer-tap 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for superred_optimizer_tap-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page