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.jsonandanalysis.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 tohttps://api.deepseek.com.OLLAMA_BASE_URL– optional, defaults tohttp://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
Metadata
Release files for gpt-oss-redteam 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gpt_oss_redteam-0.1.3.tar.gz | 12.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gpt_oss_redteam-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.3 kB
Release files / gpt_oss_redteam-0.1.3.tar.gz
| Download URL | gpt_oss_redteam-0.1.3.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
76bf1a86fcf22ae268f02c095a37eeba8166cdc66e73c6a6af700e02489443bf
|
|
BLAKE2b-256 checksum How to use checksums |
62cbb00b54b7f1a154ad935833c0731bce33110cb84f5b4ca206672318514dda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|
Release files / gpt_oss_redteam-0.1.3-py3-none-any.whl
| Download URL | gpt_oss_redteam-0.1.3-py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b28c627266baa7627a85851f5c30d2535fc851a88a9a73c3adcddffd1a7f9aeb
|
|
BLAKE2b-256 checksum How to use checksums |
5b942e82cedb7a8122c7c89a165ad70e1ffe8b583fcf95f9541f9d867d9f0482
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|