Skip to main content

superred-optimizer-gptfuzzer

A GPTFuzzer jailbreak optimizer for the superred red-teaming framework.

GPTFuzzer treats jailbreaking as fuzzing. It starts from a pool of human-written jailbreak templates, mutates them (crossover, expand, generate-similar, rephrase, shorten), inserts the harmful goal in place of the template's [INSERT PROMPT HERE] slot, and uses an MCTS-Explore selector plus a RoBERTa success classifier to keep and grow the templates that work.

Reference: Yu et al., "GPTFUZZER: Red Teaming Large Language Models with Auto-Generated Jailbreak Prompts," arXiv:2309.10253 (2023). Official implementation: sherdencooper/GPTFuzz (MIT License). See ASSUMPTIONS.md for the full paper-to-code mapping and every deliberate departure.

Install

GPTFuzzer's default success classifier is the official hubert233/GPTFuzz RoBERTa model, so this package depends on torch and transformers; they are installed automatically.

pip install superred-optimizer-gptfuzzer

The classifier weights are downloaded lazily on the first response-visible run. If the weights or dependencies are unavailable, the optimizer can fall back to a lightweight refusal-string classifier; set allow_predictor_fallback=False to require the official model and fail fast instead.

Usage

from gptfuzzer_optimizer import GPTFuzzerOptimizer

# Default budgets follow the official runner (max_query=1000, max_jailbreak=1,
# energy=1) — one mutation, one query per run.
optimizer = GPTFuzzerOptimizer()

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, sherdencooper/GPTFuzz, is MIT licensed. The bundled seed templates originate from that repository's GPTFuzzer.csv; its MIT copyright notice is preserved in NOTICE and LICENSES/GPTFuzz-MIT.txt. torch, transformers, and the hubert233/GPTFuzz model are third-party components under their own licenses.

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_gptfuzzer-0.1.0.tar.gz (61.3 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_gptfuzzer-0.1.0-py3-none-any.whl (60.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for superred_optimizer_gptfuzzer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f1e3902a718831f724d2357a1ccc20a265a250d6cc2f2672ebf80df3665420eb
MD5 8fdeb73e9e4acba1ae06fc9197de6506
BLAKE2b-256 f565d4acc159accb76ff8e0a63fcefd0d4dac329002b63ff8ea78f9ba2f41cb4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for superred_optimizer_gptfuzzer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 684b7bf341c01deacf4a4d1d755e5cd1245c7da0c4e9a18a662ab7feb7dd30fe
MD5 de8bf1cb2330ff8bb3812d67e0b5e72d
BLAKE2b-256 72671895897449a5f12af3f93a8852f198b5dec477f4cefd9e2a44506d954393

See more details on using hashes here.

Provenance

The following attestation bundles were made for superred_optimizer_gptfuzzer-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 Sentry Error logging StatusPage Status page