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.

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_tap-0.1.0.tar.gz (22.2 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_tap-0.1.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

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

Hashes for superred_optimizer_tap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c3ab8e729afd0888632584540fc87f241d210c7c3d54a4b16be473eeb6053a63
MD5 b3869ba0d6aa88bdf3af073cdac3cfb6
BLAKE2b-256 9026305c19d26f3a7bf256b252cf8b488f952017aabaa4b88a716123dbcaf528

See more details on using hashes here.

Provenance

The following attestation bundles were made for superred_optimizer_tap-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_tap-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for superred_optimizer_tap-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95fcb31e499bb817d8660836f43f43bc4c0ed016045d4b521c0b410313a8bb7a
MD5 c046fae1854046ad1a521c45160e0aa1
BLAKE2b-256 b6f127ed3159e7aa7afa6afd43791b9a65ab52e43083d63e8cfe4b2a2b1b906a

See more details on using hashes here.

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

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

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