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.
Metadata
Release files for superred-optimizer-goat 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| superred_optimizer_goat-0.1.0.tar.gz | 25.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| superred_optimizer_goat-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.2 kB
Release files / superred_optimizer_goat-0.1.0.tar.gz
| Download URL | superred_optimizer_goat-0.1.0.tar.gz |
|---|---|
| Size | 25.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35e8e02b4ad26c877510b5d00146cf33eaa003893321d0fe8acb8b9c75a40ec1
|
|
BLAKE2b-256 checksum How to use checksums |
3db6dac4b848bab6221839af3ac18c41a6815c40facd60c3a9474d8b70326de7
|
| 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 21, 2026.
Transparency logRelease files / superred_optimizer_goat-0.1.0-py3-none-any.whl
| Download URL | superred_optimizer_goat-0.1.0-py3-none-any.whl |
|---|---|
| Size | 18.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5361c4fdf443a0b404232d1c41936a46ef61c70391a3f7c7ceb52324439ef233
|
|
BLAKE2b-256 checksum How to use checksums |
83b4b39fc5443f073cef9d1ea7293665882f367649721397996bd9d10bb68554
|
| 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 21, 2026.
Transparency logSecurity for superred-optimizer-goat 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.
Attestation for superred_optimizer_goat-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 21, 2026.
Transparency logA 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.