Garak red-teaming evaluation adapter for eval-hub
Project description
TrustyAI Garak: LLM Red Teaming for Eval-Hub
Automated vulnerability scanning and red teaming for Large Language Models using Garak. This package provides a FrameworkAdapter for the eval-hub evaluation platform, enabling garak scans to run as Kubernetes Jobs or via Kubeflow Pipelines.
What It Does
- 🔍 Vulnerability Assessment: Red-team LLMs for prompt injection, jailbreaks, toxicity, bias and other vulnerabilities
- 📋 Compliance: OWASP LLM Top 10, AVID taxonomy benchmarks
- 🎯 Intents-based Testing: Policy taxonomy + SDG + TAPIntent for targeted risk assessment (KFP mode)
- ☁️ Cloud-Native: Runs on OpenShift AI / Kubernetes as eval-hub jobs
- 📊 Detailed Reports: JSONL, HTML, and AVID-format reports with MLflow integration
Execution Modes
| Mode | How Garak Runs | Intents Support | Use Case |
|---|---|---|---|
| Simple | Directly in the eval-hub K8s Job pod | No | Standard scans |
| KFP | K8s Job submits to Kubeflow Pipelines, polls status | Yes | Intents/SDG workflows |
Installation
# Core (eval-hub adapter with KFP support)
pip install llama-stack-provider-trustyai-garak
# With SDG support (for intents workflows)
pip install "llama-stack-provider-trustyai-garak[sdg]"
# Development
pip install "llama-stack-provider-trustyai-garak[dev]"
Container Image
# Build the eval-hub adapter image
docker build -f Containerfile -t trustyai-garak:dev .
The container runs as:
# Simple mode (garak in same pod)
CMD ["python", "-m", "llama_stack_provider_trustyai_garak.evalhub"]
# KFP mode (garak in a separate KFP pod)
CMD ["python", "-m", "llama_stack_provider_trustyai_garak.evalhub.kfp_adapter"]
Benchmark Profiles
Predefined scan profiles available via benchmark_id:
| Profile | Description |
|---|---|
quick |
Single DAN probe for fast testing |
owasp_llm_top10 |
OWASP Top 10 for LLM Applications |
avid |
AVID taxonomy — all vulnerabilities |
avid_security |
AVID — security vulnerabilities |
avid_ethics |
AVID — ethical concerns |
avid_performance |
AVID — performance issues |
quality |
Violence, profanity, toxicity, hate speech |
cwe |
Common Weakness Enumeration |
intents |
Intents-based risk assessment (KFP mode only) |
Job Spec Configuration
The adapter reads a JobSpec from a mounted ConfigMap:
{
"id": "scan-001",
"provider_id": "garak",
"benchmark_id": "quick",
"model": {
"url": "https://my-model-endpoint.example.com/v1",
"name": "my-model"
},
"parameters": {
"probes": "dan.Dan_11_0",
"execution_mode": "simple"
}
}
Parameters
Key parameters in the job spec:
| Parameter | Description | Default |
|---|---|---|
probes |
Comma-separated probe names | Profile default |
probe_tags |
Tag-based probe filtering | — |
execution_mode |
simple or kfp |
simple |
timeout_seconds |
Scan timeout | Profile default |
eval_threshold |
Vulnerability threshold (0.0–1.0) | 0.5 |
model_type |
Garak generator type | openai.OpenAICompatible |
garak_config |
Full garak config dict (deep-merged onto profile) | — |
Results
The adapter reports EvaluationResult per probe with:
attack_success_rate: Percentage of successful attacksvulnerable_responses: Count of vulnerable responsestotal_attempts: Total probe attempts
Overall metrics include TBSA (Tier-Based Security Aggregate) when available.
Development
make test # Run all tests
make coverage # With coverage report
make lint # ruff check
make format # ruff format
Support & Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_stack_provider_trustyai_garak-0.5.0.tar.gz.
File metadata
- Download URL: llama_stack_provider_trustyai_garak-0.5.0.tar.gz
- Upload date:
- Size: 111.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28aaad31d25a5e4076a89c0c5e8594f03d8c9b8a6833ceb53982e9c12e57b45f
|
|
| MD5 |
6c84c554350ac03a994be07bda2d76d0
|
|
| BLAKE2b-256 |
24dd128fb73fde203e116941f2c1dc58735217e5a10634fabb547da204d9dc9e
|
Provenance
The following attestation bundles were made for llama_stack_provider_trustyai_garak-0.5.0.tar.gz:
Publisher:
build-and-publish.yaml on trustyai-explainability/llama-stack-provider-trustyai-garak
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_stack_provider_trustyai_garak-0.5.0.tar.gz -
Subject digest:
28aaad31d25a5e4076a89c0c5e8594f03d8c9b8a6833ceb53982e9c12e57b45f - Sigstore transparency entry: 1805316888
- Sigstore integration time:
-
Permalink:
trustyai-explainability/llama-stack-provider-trustyai-garak@7de4f9503918b26521013a66c0c01deb56dfd047 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/trustyai-explainability
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yaml@7de4f9503918b26521013a66c0c01deb56dfd047 -
Trigger Event:
release
-
Statement type:
File details
Details for the file llama_stack_provider_trustyai_garak-0.5.0-py3-none-any.whl.
File metadata
- Download URL: llama_stack_provider_trustyai_garak-0.5.0-py3-none-any.whl
- Upload date:
- Size: 83.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a20924d2dab25350238eedd6592b7bbd057010672d0fe690677a0fb78c0fe3b0
|
|
| MD5 |
33806d31dd10191187f3f8cc3b5289bf
|
|
| BLAKE2b-256 |
11063bb041127455ae73b55b050fcce1a7db8bfd51df5cb0fc2813167b53e41f
|
Provenance
The following attestation bundles were made for llama_stack_provider_trustyai_garak-0.5.0-py3-none-any.whl:
Publisher:
build-and-publish.yaml on trustyai-explainability/llama-stack-provider-trustyai-garak
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_stack_provider_trustyai_garak-0.5.0-py3-none-any.whl -
Subject digest:
a20924d2dab25350238eedd6592b7bbd057010672d0fe690677a0fb78c0fe3b0 - Sigstore transparency entry: 1805316997
- Sigstore integration time:
-
Permalink:
trustyai-explainability/llama-stack-provider-trustyai-garak@7de4f9503918b26521013a66c0c01deb56dfd047 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/trustyai-explainability
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yaml@7de4f9503918b26521013a66c0c01deb56dfd047 -
Trigger Event:
release
-
Statement type: