Skip to main content

Simple, reproducible red teaming pipeline for GPT-OSS via Ollama with DeepSeek-based prompt generation

Project description

gpt-oss-redteam

Simple, reproducible red teaming pipeline for GPT‑OSS models via Ollama, with DeepSeek-based adversarial prompt generation.

  • DeepSeek API to generate adversarial prompts from high-level HITL prompts (preserves [insert ...]).
  • Ollama for local GPT‑OSS inference with a fake tools manifest (one string arg: input, description: "put all information here").
  • Logs every run to JSONL for later analysis (full model JSON when available).
  • Minimal analyzer: refusal rate and 95% CI.
  • Minimal CLI for end-to-end runs.

Quickstart

Prereqs:

  • Python 3.9+
  • Ollama running locally and the model pulled: ollama pull gpt-oss:20b
  • DeepSeek API key in env: DEEPSEEK_API_KEY=...

Install (editable):

pip install -e .

Run the full pipeline with 20 prompts × 100 runs each (2,000 total):

# Create a starter prompts file you can edit
python -m gpt_oss_redteam.cli init --out prompts.txt

# Edit prompts.txt to include one prompt per line (each may include [insert ...])

# Run pipeline
gpt-oss-redteam all \
  --prompts-file prompts.txt \
  --runs-per-prompt 100 \
  --generation-batch-size 10 \
  --ollama-model gpt-oss:20b \
  --out-dir runs

Outputs:

  • runs/<timestamp>/generated_prompts.jsonl – all generated prompts with their source high-level prompt.
  • runs/<timestamp>/inference.jsonl – every model run with raw JSON response.
  • runs/<timestamp>/analysis.json and analysis.md – refusal rate and 95% CI.

Configuration via CLI flags or environment variables

  • DEEPSEEK_API_KEY – required for prompt generation.
  • DEEPSEEK_BASE_URL – optional, defaults to https://api.deepseek.com.
  • OLLAMA_BASE_URL – optional, defaults to http://localhost:11434/v1.

Fake tools manifest (simple)

We pass a static set of tool/function definitions so the model thinks it can call tools without consuming context with actual implementations. Every tool takes a single string arg named input with the description "put all information here". No tool execution occurs.

Safety note

This project logs raw model outputs for offline analysis. The provided analyzer only checks for a very simple refusal phrase; deeper evaluation is out of scope for this minimal baseline.

Paper outline (in docs/)

  • Brief literature review
  • Package pipeline and creation
  • Quantified results
  • Qualitative analysis of results
  • Example problem prompts
  • Next steps

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

gpt_oss_redteam-0.1.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpt_oss_redteam-0.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gpt_oss_redteam-0.1.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for gpt_oss_redteam-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9c8d3f7685d1e823fdade6c9de2d2b2c76523340c823c0c7fd09579c64a49cfb
MD5 17286f6bde46ad00e61ee5554d3983a4
BLAKE2b-256 9514f84d60ecf810262b90582d355bff650955c0835f8117c4884922207fff05

See more details on using hashes here.

File details

Details for the file gpt_oss_redteam-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gpt_oss_redteam-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f93b74ff8ae808e02573820c280853c4e17af4eca70304a2fa38e8c8279f776
MD5 960c0f0f7985b07b1f5cb8e98e4f45e6
BLAKE2b-256 5a9fc4fd3adbced35c33be2a41cc969ad94a9571086b0be75c3bb1d96a1631a6

See more details on using hashes here.

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