redteam-cli
Local-first security scanner for ML models. Runs five adversarial / extraction / prompt-injection attacks against your model on the machine that already has it and uploads only the per-attack scores. The model itself never leaves your environment.
Install
pip install "redteam-cli[torch]" # image classifiers (.pt / .pth / state-dict)
pip install "redteam-cli[onnx]" # ONNX models (boundary + extraction)
pip install "redteam-cli[hf]" # HuggingFace LLMs via hf:org/model
pip install redteam-cli # CLI only (use --dry-run, no attacks)
Usage
export REDTEAM_API_KEY=rtai_…
export REDTEAM_API_URL=https://your-redteam-platform.example.com
# Image classifier (full nn.Module saved with torch.save)
redteam scan --model ./mymodel.pt --type image-classifier \
--input-shape 3,224,224 --num-samples 32
# State-dict only — supply the architecture file
redteam scan --model ./weights.pt --type image-classifier \
--arch ./model.py:MyResNet --input-shape 3,224,224
# ONNX — boundary + extraction (FGSM N/A, no gradients)
redteam scan --model ./mymodel.onnx --type image-classifier --input-shape 3,224,224
# LLM via HuggingFace
redteam scan --model hf:Qwen/Qwen2-7B-Instruct --type llm
# LLM via custom .py adapter
redteam scan --model ./llm_adapter.py --type llm
# Dry-run anything (run locally, print JSON, skip upload)
redteam scan --model ./mymodel.pt --type image-classifier --dry-run
Attacks
| Attack | Model types | What it tests |
|---|---|---|
| FGSM | image-classifier | White-box adversarial robustness (single ε-step gradient sign) |
| Boundary | image-classifier | Black-box decision-boundary fragility (median L2 to flip) |
| Model extraction | image-classifier, tabular | Whether a surrogate trained from queries can clone the model |
| Prompt injection | llm | Canary-leak detection across role-hijack / jailbreak payloads |
| Output manipulation | llm | Refusal-marker matching on disallowed prompts (markers customisable for non-English models) |
Where the results go
This CLI sends results to the redteam-ai platform (FastAPI backend + Next.js dashboard) running either locally via Docker Compose or deployed to your own host. To run the platform yourself:
git clone https://github.com/Anbar26/redteam-ai
cd redteam-ai && docker compose up -d --build
# Visit http://localhost:3000 — sign up to get an API key
Or use --dry-run to skip the upload entirely and just read the JSON.
License
Metadata
Release files for redteam-cli 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 | Actions |
|---|---|---|---|---|
| redteam_cli-0.1.0.tar.gz | 25.0 kB | With provenance | Details for redteam_cli-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| redteam_cli-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for redteam_cli-0.1.0-py3-none-any.whl |
Total release size: 49.1 kB
Release files / redteam_cli-0.1.0.tar.gz
| Download URL | redteam_cli-0.1.0.tar.gz |
|---|---|
| Size | 25.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53099fe60ae55b73898af118d7c33d79b3f159f299a11be921efaee681be2094
|
|
BLAKE2b-256 checksum How to use checksums |
0dee15deffdf2b82236d5b3271fa65e9bc1e8a675abe1ba4874bb02d43040730
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 4, 2026.
Transparency logRelease files / redteam_cli-0.1.0-py3-none-any.whl
| Download URL | redteam_cli-0.1.0-py3-none-any.whl |
|---|---|
| Size | 24.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d1325d997ef7967882e4c7990bda538de5e48bfe16fc68ccab49df89b5b4ff80
|
|
BLAKE2b-256 checksum How to use checksums |
664d132bf0258411caea64007124c67b5b18519eaecc6f7e261f65c08e2b48f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 4, 2026.
Transparency logSecurity for redteam-cli 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
Both files in this release have been uploaded with provenance metadata.
Attestation for redteam_cli-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 Jun 4, 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.