Skip to main content

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 the response slot 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 Controller scope puts in view. max_no_response_runs bounds 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 aex column) 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


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_goat-0.1.0.tar.gz (25.6 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_goat-0.1.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

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

Hashes for superred_optimizer_goat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 35e8e02b4ad26c877510b5d00146cf33eaa003893321d0fe8acb8b9c75a40ec1
MD5 4cb346954ceb179f35114cdf4e47f68e
BLAKE2b-256 3db6dac4b848bab6221839af3ac18c41a6815c40facd60c3a9474d8b70326de7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for superred_optimizer_goat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5361c4fdf443a0b404232d1c41936a46ef61c70391a3f7c7ceb52324439ef233
MD5 3ccf746ee9a53db51d9815fdb3d09399
BLAKE2b-256 83b4b39fc5443f073cef9d1ea7293665882f367649721397996bd9d10bb68554

See more details on using hashes here.

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

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 Pingdom Monitoring Sentry Error logging StatusPage Status page