GOAT (Generative Offensive Agent Tester) multi-turn jailbreak optimizer for superred
Project description
superred-optimizer-goat
A GOAT (Generative Offensive Agent Tester) multi-turn jailbreak optimizer for the superred red-teaming framework.
GOAT plays the attacker in an automated, multi-turn conversation: an attacker
LLM reasons about which adversarial technique to apply next, then sends a
message to the target, using the target's own replies (when visible) to adapt.
One superred run is one independent K-turn attack conversation; multiple
runs give the paper's ASR@k metric.
Reference: Pavlova et al., "Automated Red Teaming with GOAT: the Generative Offensive Agent Tester," arXiv:2410.01606 (Meta, 2024). See ASSUMPTIONS.md for the full paper-to-code mapping and every deliberate departure.
Install
pip install superred-optimizer-goat
Usage
from goat_optimizer import GOATOptimizer, ATTACKS, REFUSAL_SUPPRESSION
# Default: all seven Table 1 attacks available to the attacker LLM at once
# (the paper's main-result configuration).
optimizer = GOATOptimizer(max_turns=5, max_attempts=10)
# Per-attack ablation: restrict the attacker to a single technique.
optimizer = GOATOptimizer(attacks=(REFUSAL_SUPPRESSION,))
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.
Behaviour notes
- One run = one attempt. Each run builds a fresh attacker conversation
(
RunStartEvent); attempts are independent, not a continuation of the previous run's conversation. - Structured attacker output. The attacker LLM emits
{observation, thought, strategy, response}as one JSON object per turn (so theresponseslot can be lifted off its chain-of-thought reasoning cleanly); markdown fences around the JSON are tolerated. On a parse failure the optimizer does not retry — it substitutes a benign fallback message for that single turn and continues, rather than crashing the attempt. - Runs in all four adversarial information-access settings (response
visible/hidden × feedback available/unavailable) without a setting flag,
driven purely by which controllables/observables the
Controllerscope puts in view.max_no_response_runsbounds cost in the blind (no-response) settings. - No in-loop judge. Unlike some jailbreak optimizers, GOAT's own loop does
not score its own success; it delegates to
RunEndEvent.evaluation.success(the paper has no in-loop judge either — success is measured out of band). - Attack examples (paper Table 1's
aexcolumn) are intentionally omitted: the paper withholds them "to effectively balance disclosure of reproducible results and enabling of malicious actors," so this port does not fabricate substitutes.
License
MIT. See ASSUMPTIONS.md for the upstream reference; the
paper's own authors (Meta) never released official code, so only their
prompts/definitions (Table 1, Figs A.1-A.3) are reproduced (as text, not code)
and reimplemented here as new, original Python. Two third-party, unofficial
GOAT probes exist independently — NVIDIA's garak
scanner (garak/probes/goat.py, Apache-2.0) and Praetorian's
augustus scanner
(goat.Goat, Apache-2.0) — this port does not use, vendor, or derive from
either implementation.
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_goat-0.1.0.tar.gz.
File metadata
- Download URL: superred_optimizer_goat-0.1.0.tar.gz
- Upload date:
- Size: 25.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35e8e02b4ad26c877510b5d00146cf33eaa003893321d0fe8acb8b9c75a40ec1
|
|
| MD5 |
4cb346954ceb179f35114cdf4e47f68e
|
|
| BLAKE2b-256 |
3db6dac4b848bab6221839af3ac18c41a6815c40facd60c3a9474d8b70326de7
|
Provenance
The following attestation bundles were made for superred_optimizer_goat-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_goat-0.1.0.tar.gz -
Subject digest:
35e8e02b4ad26c877510b5d00146cf33eaa003893321d0fe8acb8b9c75a40ec1 - Sigstore transparency entry: 2214967179
- Sigstore integration time:
-
Permalink:
RoldSI/superred-modules@ff92389cd4ecc6690ecd16f410231274785c4afb -
Branch / Tag:
refs/tags/superred-optimizer-goat-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@ff92389cd4ecc6690ecd16f410231274785c4afb -
Trigger Event:
push
-
Statement type:
File details
Details for the file superred_optimizer_goat-0.1.0-py3-none-any.whl.
File metadata
- Download URL: superred_optimizer_goat-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.6 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 |
5361c4fdf443a0b404232d1c41936a46ef61c70391a3f7c7ceb52324439ef233
|
|
| MD5 |
3ccf746ee9a53db51d9815fdb3d09399
|
|
| BLAKE2b-256 |
83b4b39fc5443f073cef9d1ea7293665882f367649721397996bd9d10bb68554
|
Provenance
The following attestation bundles were made for superred_optimizer_goat-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_goat-0.1.0-py3-none-any.whl -
Subject digest:
5361c4fdf443a0b404232d1c41936a46ef61c70391a3f7c7ceb52324439ef233 - Sigstore transparency entry: 2214967215
- Sigstore integration time:
-
Permalink:
RoldSI/superred-modules@ff92389cd4ecc6690ecd16f410231274785c4afb -
Branch / Tag:
refs/tags/superred-optimizer-goat-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@ff92389cd4ecc6690ecd16f410231274785c4afb -
Trigger Event:
push
-
Statement type: