Metadata-Version: 2.4
Name: rednblue
Version: 3.0.0
Summary: Zero-Knowledge Adversarial Security Testing for AI Models
Author-email: RednBlue <support@rednblue.io>
License: Proprietary
Project-URL: Homepage, https://rednblue.io
Project-URL: Dashboard, https://dashboard.rednblue.io
Project-URL: Repository, https://github.com/mahdidrm/RednBlue_CLI
Keywords: adversarial,ml,security,ai-testing,machine-learning
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Security
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.1.0
Requires-Dist: requests>=2.28.0
Requires-Dist: cryptography>=41.0.0
Requires-Dist: pillow>=10.0.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: torch>=2.0.0
Requires-Dist: torchvision>=0.15.0
Requires-Dist: tqdm>=4.65.0
Requires-Dist: colorama>=0.4.6
Requires-Dist: psutil>=5.9.0
Requires-Dist: huggingface_hub>=0.20.0
Requires-Dist: safetensors>=0.4.0
Requires-Dist: timm>=0.9.0
Requires-Dist: ultralytics>=8.0.0
Requires-Dist: eel>=0.16.0
Provides-Extra: onnx
Requires-Dist: onnx>=1.14.0; extra == "onnx"
Requires-Dist: onnx2torch>=1.5.0; extra == "onnx"
Provides-Extra: gpu
Requires-Dist: GPUtil>=1.4.0; extra == "gpu"
Dynamic: license-file

# RednBlue CLI v3.0.0

**Zero-Knowledge Adversarial Security Testing for AI Models**

RednBlue CLI is a command-line tool for testing the adversarial robustness of machine learning models. Run security assessments locally — your model never leaves your infrastructure.

```
███████████               ███████████
▒▒███▒▒▒▒▒███             ▒▒███▒▒▒▒▒███
 ▒███    ▒███  ████████    ▒███    ▒███
 ▒██████████  ▒▒███ ▒▒███  ▒██████████
 ▒███▒▒▒▒▒███  ▒███  ▒███  ▒███▒▒▒▒▒███
 ▒███    ▒███  ▒███  ▒███  ▒███    ▒███
 █████   █████ ████  █████ ███████████
▒▒▒▒▒   ▒▒▒▒▒ ▒▒▒▒  ▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒

Zero-Knowledge Adversarial Security Testing
```


---

## [3.0.0] - 2026-0412

### 🚀 New Features

#### Desktop UI
- **New `rnb ui` command** - Launch a graphical interface for non-CLI users
- Built with Eel framework (Python-JavaScript bridge)
- Light theme matching the RednBlue Dashboard design
- Real-time progress tracking with per-dimension status
- Interactive radar chart visualization (Chart.js)
- Token validation with credit balance display
- Multi-language support (English, French)

#### Auto GPU Detection
- Automatically selects the best available compute device
- Priority: CUDA → MPS (Apple Silicon) → CPU
- No manual `--device` flag needed

#### Multi-Architecture Classifier Support
Expanded model architecture detection to support:

| Architecture | Variants |
|--------------|----------|
| ResNet | 18, 34, 50, 101, 152 |
| VGG | 11, 13, 16, 19 |
| DenseNet | 121, 161, 169, 201 |
| EfficientNet | b0, b1, b2, b3, b4, b5, b6, b7 |
| MobileNet | v2, v3_small, v3_large |
| Inception | v3 |
| SqueezeNet | 1_0, 1_1 |
| ShuffleNet | v2 |
| GoogLeNet | - |
| AlexNet | - |

### 🐛 Bug Fixes

- **Fixed tier parameter not passed to classifier attacks** - Enterprise tokens now correctly run all 8 attacks instead of defaulting to Freelancer's 5
- **Fixed `input_path` undefined error** - Added missing `Path(input_dir)` conversion in `run_preview()`
- **Fixed `Fore` not defined error** - Added missing colorama import in `run_preview()`
- **Fixed token validation** - Now correctly uses `APIClient.validate_subscription()` to fetch credit info

### ✨ Improvements

- **Better error messages** - Clear explanations when attempting to test unsupported model types (segmentation/detection models)
- **CEO-friendly dimension labels** - Display human-readable names instead of attack codes (e.g., "Noise Resilience" instead of "GNI")
- **Cleaner console output** - Tier and device info displayed at test start

### 📁 New Files

```
rnb/
├── ui.py              # Desktop UI launcher
└── web/
    ├── index.html     # UI layout (Tailwind CSS)
    ├── app.js         # UI logic & Chart.js radar
    ├── i18n.js        # Internationalization (EN/FR)
    └── logo.png       # RednBlue logo
```

### ⚠️ Known Limitations

Models **not supported** for testing (different output types):

| Model Type | Examples | Reason |
|------------|----------|--------|
| Segmentation | DeepLabV3, FCN | Output is mask, not class |
| Detection | Faster-RCNN, RetinaNet, SSD | Output is boxes, not class |
| Keras | .h5 files | TensorFlow format, not PyTorch |

For YOLO detection models, select "YOLO" as model type.

---

## Features

- **Zero-Knowledge Protocol** — Model weights and data never leave your infrastructure
- **Image Classifiers** — Test ResNet, VGG, EfficientNet, and custom architectures
- **YOLO Detection** — Full support for YOLOv5, YOLOv8, YOLOv10, YOLOv11
- **Tier-Based Testing** — Freelancer (quick scan) and Enterprise (comprehensive)
- **Encrypted Submission** — AES-256 encrypted results with HMAC-SHA256 signing
- **Multi-Jurisdiction Compliance** — EU AI Act, NIST AI RMF, ISO/IEC 42001, UK DSIT, Canada AIDA, Singapore MAIGF

---

## Installation

```bash
# Install from PyPI
pip install rednblue

# Verify installation
rnb
```

---
### Requirements

- Python 3.8+
- PyTorch 2.0+
- CUDA (optional, for GPU acceleration)

---

## Quick Start

### 1. Set your token

```bash
# Windows
set RNB_TOKEN=RB-XXXXXX-YYYYYY

# Linux/Mac
export RNB_TOKEN=RB-XXXXXX-YYYYYY
```

### 2. Run a security assessment

**Image Classifier:**
```bash
rnb preview --model resnet50.pth --input ./test_images --model-type classifier
```

**YOLO Detection Model:**
```bash
rnb preview --model yolov10n.pt --input ./test_images --model-type yolo
```

### 3. Submit for certification

```bash
rnb preview --model yolov10n.pt --input ./images --model-type yolo --submit
```

---

## Commands

| Command | Description |
|---------|-------------|
| `rnb` | Show welcome banner and quick start |
| `rnb preview --help` | Run adversarial attacks |
| `rnb status` | Check token validity and tier |
| `rnb optimize-epsilon` | Optimize epsilon values (Enterprise) |
| `rnb test-llm` | Test LLM models (Enterprise) |

---

## Assessment Dimensions

### Classifier Models

| Dimension | Description |
|-----------|-------------|
| Noise Resilience | Stability under sensor noise and interference |
| Spatial Consistency | Robustness to spatial feature shifts |
| Universal Pattern Defense | Resistance to universal perturbation patterns |
| Feature Stability | Internal representation integrity |
| Confidence Calibration | Prediction reliability accuracy |
| Iterative Stress Tolerance | Defense against sustained pressure |
| Optimization Attack Defense | Resistance to optimized adversarial inputs |
| Deep Perturbation Resistance | Resilience against deep layer perturbations |

### YOLO Detection Models

| Dimension | Description |
|-----------|-------------|
| Noise Resilience | Stability under sensor noise |
| Input Perturbation Defense | Resistance to subtle input modifications |
| Iterative Stress Tolerance | Defense against multi-step attacks |
| Detection Consistency | Reliable detection under varying conditions |
| Targeted Evasion Defense | Resistance to deliberate misclassification |
| Object Persistence | Maintains detections under perturbations |
| Multi-Object Stability | Accuracy in crowded scenes |
| Black-Box Resilience | Defense without model access |
| Query-Limited Defense | Resistance to low-query probing |

---

## Tier Comparison

| Feature | Freelancer | Enterprise |
|---------|------------|------------|
| Classifier Attacks | 5 | 8 |
| YOLO Attacks | 4 | 9 |
| Epsilon Values | 2 | 4 |
| Total Scenarios | ~10-20 | ~30-70 |
| LLM Testing | ❌ | ✅ |
| Epsilon Optimization | ❌ | ✅ |

---

## Output Example

```
============================================================
  RednBlue Security Preview — YOLO Detection
============================================================
  Attacks run    : 21
  Successful hits: 0/21 (0%)
  Robustness rate: 100%
  Estimated Grade: GOLD

  ⚠️  This is a preview only
  → Visit: https://rednblue.io/checkout
  → Re-run with: rnb preview --model-type yolo --submit
```

---

## Certification Grades

| Grade | Score | Meaning |
|-------|-------|---------|
| 🥇 GOLD | ≥90% | Excellent robustness, deployment ready |
| 🥈 SILVER | ≥75% | Good robustness, minor improvements recommended |
| 🥉 BRONZE | ≥50% | Moderate robustness, improvements needed |

---

## Architecture

![Architecture](docs/RnB-Diagram.png)

---

## Links

- **Platform:** https://dashboard.rednblue.io
- **Documentation:** https://docs.rednblue.ai
- **Website:** https://rednblue.io

---

## Authors

- **Dr. Mahdi Deramgozin** — Chief AI Officer
- **Dr. Saeid Samizade** — Chief Technology Officer

---

## License

Proprietary — RednBlue SAS © 2026

Made in France 🇫🇷
