rednblue 2.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rednblue-2.2.0/CHANGELOG.md +64 -0
- rednblue-2.2.0/LICENSE +35 -0
- rednblue-2.2.0/MANIFEST.in +5 -0
- rednblue-2.2.0/PKG-INFO +413 -0
- rednblue-2.2.0/README.md +383 -0
- rednblue-2.2.0/pyproject.toml +10 -0
- rednblue-2.2.0/rednblue.egg-info/PKG-INFO +413 -0
- rednblue-2.2.0/rednblue.egg-info/SOURCES.txt +35 -0
- rednblue-2.2.0/rednblue.egg-info/dependency_links.txt +1 -0
- rednblue-2.2.0/rednblue.egg-info/entry_points.txt +3 -0
- rednblue-2.2.0/rednblue.egg-info/requires.txt +12 -0
- rednblue-2.2.0/rednblue.egg-info/top_level.txt +1 -0
- rednblue-2.2.0/requirements.txt +9 -0
- rednblue-2.2.0/rnb/__init__.py +3 -0
- rednblue-2.2.0/rnb/attacks/__init__.py +0 -0
- rednblue-2.2.0/rnb/attacks/llm/__init__.py +1 -0
- rednblue-2.2.0/rnb/attacks/llm/jailbreak.py +21 -0
- rednblue-2.2.0/rnb/attacks/llm/prompt_injection.py +1 -0
- rednblue-2.2.0/rnb/attacks/llm/token_manipulation.py +1 -0
- rednblue-2.2.0/rnb/attacks/vision/__init__.py +0 -0
- rednblue-2.2.0/rnb/attacks/vision/yolo_attacker.py +1106 -0
- rednblue-2.2.0/rnb/cli.py +284 -0
- rednblue-2.2.0/rnb/config/__init__.py +0 -0
- rednblue-2.2.0/rnb/config/tiers.py +13 -0
- rednblue-2.2.0/rnb/core/__init__.py +0 -0
- rednblue-2.2.0/rnb/core/attacker.py +734 -0
- rednblue-2.2.0/rnb/core/hasher.py +144 -0
- rednblue-2.2.0/rnb/core/optimizer.py +46 -0
- rednblue-2.2.0/rnb/utils/__init__.py +0 -0
- rednblue-2.2.0/rnb/utils/api.py +72 -0
- rednblue-2.2.0/rnb/utils/audit_log.py +3 -0
- rednblue-2.2.0/rnb/utils/code_integrity.py +1 -0
- rednblue-2.2.0/rnb/utils/encryption.py +11 -0
- rednblue-2.2.0/rnb/utils/privacy.py +2 -0
- rednblue-2.2.0/rnb/utils/validator.py +1 -0
- rednblue-2.2.0/setup.cfg +4 -0
- rednblue-2.2.0/setup.py +54 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the RednBlue CLI are documented here.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## [2.2.0] — 2026-03-27
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Tier-aware attack execution** — CLI now validates the token tier before running attacks. Enterprise tokens run 8 classifier attacks × 4 epsilon levels (32 tests) or 9 YOLO attacks × 4 epsilon levels (~36 tests). Freelancer tokens run the reduced suite.
|
|
11
|
+
- **`--model-type` flag** — explicit selection between `classifier` (default) and `yolo` modes.
|
|
12
|
+
- **Token info display** — on `--submit`, the CLI shows tier and number of allowed attacks before running.
|
|
13
|
+
- **`tier` field in submission payload** — `model_identity.tier` is now included in the encrypted results for backend cross-validation.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- `validate_token()` in `rnb/utils/api.py` now accepts `model_type` parameter and returns `allowed_attacks`, `cli_runs_used`, `cli_runs_max`.
|
|
17
|
+
- `APIClient.validate_subscription()` now accepts and passes `model_type` to the backend.
|
|
18
|
+
- Import path fixed: `ImageAttacker` imported from `rnb.core.attacker` (not `rnb.attacks.vision.attacker`).
|
|
19
|
+
- Preview output now shows tier in header: `RednBlue Security Preview — ENTERPRISE tier`.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- Enterprise tokens were incorrectly running only freelancer-tier attacks (5 attacks × 2ε) due to hardcoded `tier='freelancer'` in the preview command.
|
|
23
|
+
- `validate_token()` raised `TypeError: got unexpected keyword argument 'model_type'` when called from the updated CLI.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## [2.1.0] — 2026-02-15
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- YOLO object detection support (`YOLOAttacker` with 9 attack implementations).
|
|
31
|
+
- Gradient Masking Diagnostic module (YGMD) — proprietary diagnostic based on Deramgozin et al. (2025).
|
|
32
|
+
- Black-box attacks: Natural Evolution Strategy (YNES) and Square Attack (YSQA).
|
|
33
|
+
- Dense Adversary Generation (YDAG) and Targeted Object Disappearance (YTOG).
|
|
34
|
+
- NMS Bypass / False Detection Injection (YNMS).
|
|
35
|
+
- AES-256-CBC result encryption with HMAC-SHA256 signature.
|
|
36
|
+
- One-time nonce binding per session (replay protection).
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
- Encryption scheme upgraded from Fernet to AES-256-CBC to match backend.
|
|
40
|
+
- Submit flow refactored: nonce fetched before attack execution.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## [2.0.0] — 2026-01-10
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
- Enterprise classifier attacks: PGD (Projected Gradient Descent), CW (Carlini-Wagner L2), DEEP (DeepFool).
|
|
48
|
+
- 4 epsilon levels for Enterprise tier (0.005, 0.01, 0.03, 0.10).
|
|
49
|
+
- `--submit` flag for certified test submission.
|
|
50
|
+
- Session-based certification flow (nonce → encrypt → sign → submit).
|
|
51
|
+
|
|
52
|
+
### Changed
|
|
53
|
+
- Tier system introduced: `freelancer` (5 attacks × 2ε) vs `enterprise` (8 attacks × 4ε).
|
|
54
|
+
- `run_preview()` separated from `run_certified_test()`.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## [1.0.0] — 2025-11-01
|
|
59
|
+
|
|
60
|
+
### Initial release
|
|
61
|
+
- 5 classifier attacks: GNI, SHFP, UAP, FSP, CCM.
|
|
62
|
+
- Freelancer tier only.
|
|
63
|
+
- Basic preview mode with local result display.
|
|
64
|
+
- Model hash computation and installation salt.
|
rednblue-2.2.0/LICENSE
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Proprietary License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 RednBlue Security (Dr. Mahdi Deramgozin, Dr. Saeid Samizade)
|
|
4
|
+
All Rights Reserved.
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS
|
|
7
|
+
|
|
8
|
+
1. GRANT OF LICENSE
|
|
9
|
+
This software ("RednBlue CLI") is licensed, not sold. Subject to the terms below,
|
|
10
|
+
you are granted a limited, non-exclusive, non-transferable license to use this
|
|
11
|
+
software for evaluation and non-commercial research purposes only.
|
|
12
|
+
|
|
13
|
+
2. RESTRICTIONS
|
|
14
|
+
You may NOT:
|
|
15
|
+
- Use this software for commercial purposes without written permission
|
|
16
|
+
- Modify, adapt, or create derivative works
|
|
17
|
+
- Redistribute, sublicense, or transfer this software
|
|
18
|
+
- Reverse engineer, decompile, or disassemble the software
|
|
19
|
+
- Remove or alter any copyright notices
|
|
20
|
+
|
|
21
|
+
3. COMMERCIAL USE
|
|
22
|
+
Commercial use requires a separate license agreement. Contact: contact@rednblue.io
|
|
23
|
+
|
|
24
|
+
4. TERMINATION
|
|
25
|
+
This license terminates automatically if you breach any terms. Upon termination,
|
|
26
|
+
you must destroy all copies of the software.
|
|
27
|
+
|
|
28
|
+
5. NO WARRANTY
|
|
29
|
+
This software is provided "AS IS" without warranty of any kind, express or implied.
|
|
30
|
+
In no event shall the authors be liable for any damages arising from use of this software.
|
|
31
|
+
|
|
32
|
+
6. GOVERNING LAW
|
|
33
|
+
This license is governed by Norwegian law.
|
|
34
|
+
|
|
35
|
+
For commercial licensing inquiries: contact@rednblue.io
|
rednblue-2.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: rednblue
|
|
3
|
+
Version: 2.2.0
|
|
4
|
+
Summary: Adversarial security testing CLI for AI models
|
|
5
|
+
Home-page: https://github.com/mahdidrm/RednBlue_CLI
|
|
6
|
+
Author: Dr. Mahdi Deramgozin, Dr. Saeid Samizade
|
|
7
|
+
Author-email: contact@rednblue.io
|
|
8
|
+
License: UNKNOWN
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/mahdidrm/RednBlue_CLI/issues
|
|
10
|
+
Project-URL: Documentation, https://github.com/mahdidrm/RednBlue_CLI#readme
|
|
11
|
+
Keywords: adversarial-ml security ai-testing machine-learning deep-learning
|
|
12
|
+
Platform: UNKNOWN
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Topic :: Security
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
18
|
+
Classifier: License :: Other/Proprietary License
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Requires-Python: >=3.8
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
Provides-Extra: yolo
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
|
|
29
|
+
# RednBlue CLI v2.2.0
|
|
30
|
+
|
|
31
|
+
**Adversarial Security Testing for AI Models**
|
|
32
|
+
|
|
33
|
+
RednBlue CLI is a command-line tool for testing the adversarial robustness of machine learning models. It supports both **image classifiers** (ResNet, VGG, etc.) and **YOLO object detection** models (YOLOv5/v8/v10/v11).
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## What's New in v2.2.0
|
|
38
|
+
|
|
39
|
+
- **YOLO Detection Support** — Full adversarial attack suite for object detection models
|
|
40
|
+
- **Gradient Masking Diagnostic (YGMD)** — Detects false robustness in YOLO models
|
|
41
|
+
- **Black-box Attacks** — NES and Square Attack for gradient-free testing
|
|
42
|
+
- **Improved Model Loading** — Better architecture detection for `.pt`/`.pth` files
|
|
43
|
+
- **Unified CLI** — Single `--model-type` flag to switch between classifier and YOLO modes
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Clone or download the CLI
|
|
51
|
+
pip install rednblue
|
|
52
|
+
|
|
53
|
+
# Verify installation
|
|
54
|
+
rnb status
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Requirements
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
torch>=2.0.0
|
|
61
|
+
torchvision
|
|
62
|
+
numpy
|
|
63
|
+
Pillow
|
|
64
|
+
click
|
|
65
|
+
tqdm
|
|
66
|
+
colorama
|
|
67
|
+
cryptography
|
|
68
|
+
requests
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
For YOLO models, also install:
|
|
72
|
+
```
|
|
73
|
+
ultralytics
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Quick Start
|
|
79
|
+
|
|
80
|
+
### Test an Image Classifier
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Preview mode (free, no token required)
|
|
84
|
+
rnb preview --model resnet18.pth --input ./images
|
|
85
|
+
|
|
86
|
+
# With submission to RednBlue platform
|
|
87
|
+
export RNB_TOKEN=RB-XXXXXX-YYYYYY
|
|
88
|
+
rnb preview --model resnet18.pth --input ./images --submit
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Test a YOLO Detection Model
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Preview mode (free, no token required)
|
|
95
|
+
rnb preview --model-type yolo --model yolo26n.pt --input ./images
|
|
96
|
+
|
|
97
|
+
# With submission to RednBlue platform
|
|
98
|
+
export RNB_TOKEN=RB-XXXXXX-YYYYYY
|
|
99
|
+
rnb preview --model-type yolo --model yolo26n.pt --input ./images --submit
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Commands
|
|
105
|
+
|
|
106
|
+
### `rnb preview`
|
|
107
|
+
|
|
108
|
+
Run adversarial attacks locally and optionally submit results for certification.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
rnb preview [OPTIONS]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
| Option | Description | Default |
|
|
115
|
+
|--------|-------------|---------|
|
|
116
|
+
| `--model PATH` | Path to model file (`.pt`, `.pth`, `.onnx`) | Required |
|
|
117
|
+
| `--input PATH` | Directory containing test images (`.jpg`, `.png`) | Required |
|
|
118
|
+
| `--model-type TYPE` | Model architecture: `classifier` or `yolo` | `classifier` |
|
|
119
|
+
| `--submit` | Submit results to RednBlue for certification | `False` |
|
|
120
|
+
|
|
121
|
+
**Examples:**
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Classifier model
|
|
125
|
+
rnb preview --model vgg16.pth --input ./test_images
|
|
126
|
+
|
|
127
|
+
# YOLO model
|
|
128
|
+
rnb preview --model-type yolo --model best.pt --input ./coco_samples
|
|
129
|
+
|
|
130
|
+
# Submit for certification
|
|
131
|
+
rnb preview --model-type yolo --model yolov8n.pt --input ./images --submit
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### `rnb status`
|
|
135
|
+
|
|
136
|
+
Check CLI version and token status.
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
rnb status
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Supported Attacks
|
|
145
|
+
|
|
146
|
+
### Image Classifier Attacks
|
|
147
|
+
|
|
148
|
+
| Code | Attack Name | Type | Description |
|
|
149
|
+
|------|-------------|------|-------------|
|
|
150
|
+
| `GNI` | Gaussian Noise Injection | Black-box | Random Gaussian perturbations |
|
|
151
|
+
| `SHFP` | High-Frequency Perturbation | Black-box | Sinusoidal high-frequency patterns |
|
|
152
|
+
| `UAP` | Universal Adversarial Patch | Black-box | Random adversarial patches |
|
|
153
|
+
| `FSP` | FGSM Surrogate Transfer | White-box | Fast Gradient Sign Method |
|
|
154
|
+
| `CCM` | Color Channel Manipulation | Black-box | Per-channel intensity shifts |
|
|
155
|
+
| `PGD` | Projected Gradient Descent | White-box | Iterative gradient attack (40 steps) |
|
|
156
|
+
| `CW` | Carlini-Wagner L2 | White-box | Optimization-based attack |
|
|
157
|
+
| `DEEP` | DeepFool | White-box | Minimal perturbation attack |
|
|
158
|
+
|
|
159
|
+
### YOLO Detection Attacks
|
|
160
|
+
|
|
161
|
+
| Code | Attack Name | Type | Description |
|
|
162
|
+
|------|-------------|------|-------------|
|
|
163
|
+
| `YGNI` | YOLO Gaussian Noise | Black-box | Baseline noise injection |
|
|
164
|
+
| `YFGS` | YOLO FGSM | White-box | Single-step gradient attack on detection loss |
|
|
165
|
+
| `YPGD` | YOLO PGD | White-box | Iterative evasion attack (40 steps) |
|
|
166
|
+
| `YDAG` | Dense Adversary Generation | White-box | Attacks all anchor positions (Xie et al. 2017) |
|
|
167
|
+
| `YTOG` | Targeted Object Disappearance | White-box | Suppresses specific class (Chow et al. 2020) |
|
|
168
|
+
| `YNMS` | NMS Bypass Injection | White-box | Injects ghost detections |
|
|
169
|
+
| `YNES` | Natural Evolution Strategy | Black-box | Gradient-free finite-difference attack |
|
|
170
|
+
| `YSQA` | Square Attack | Black-box | Score-based random search (Andriushchenko 2020) |
|
|
171
|
+
| `YGMD` | Gradient Masking Diagnostic | Diagnostic | Detects false robustness |
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Tier System
|
|
176
|
+
|
|
177
|
+
### Freelancer Tier (Default)
|
|
178
|
+
|
|
179
|
+
- **Classifier:** 5 attacks × 2 epsilon levels = 10 tests
|
|
180
|
+
- **YOLO:** 4 attacks × 2 epsilon levels = 8 tests
|
|
181
|
+
- Attacks: `GNI`, `SHFP`, `UAP`, `FSP`, `CCM` (classifier) / `YGNI`, `YFGS`, `YPGD`, `YGMD` (YOLO)
|
|
182
|
+
- Epsilon values: `0.005`, `0.01`
|
|
183
|
+
|
|
184
|
+
### Enterprise Tier
|
|
185
|
+
|
|
186
|
+
- **Classifier:** 8 attacks × 4 epsilon levels = 32 tests
|
|
187
|
+
- **YOLO:** 9 attacks × 4 epsilon levels = 36 tests
|
|
188
|
+
- All attacks included
|
|
189
|
+
- Epsilon values: `0.005`, `0.01`, `0.03`, `0.10`
|
|
190
|
+
- Additional features: Epsilon optimization, LLM testing
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Gradient Masking Detection (YGMD)
|
|
195
|
+
|
|
196
|
+
RednBlue v2.2 includes the **Gradient Masking Diagnostic** — a novel tool that detects when YOLO models exhibit "false robustness" due to gradient masking.
|
|
197
|
+
|
|
198
|
+
### What is Gradient Masking?
|
|
199
|
+
|
|
200
|
+
Some models appear robust to white-box attacks (FGSM, PGD) but are actually vulnerable to black-box attacks. This happens when gradients are obfuscated, zero, or misleading — giving a false sense of security.
|
|
201
|
+
|
|
202
|
+
### How YGMD Works
|
|
203
|
+
|
|
204
|
+
YGMD runs three probes on each image:
|
|
205
|
+
|
|
206
|
+
1. **White-box probe (YFGS)** — Measures gradient-based attack effectiveness
|
|
207
|
+
2. **Black-box probe (YNES)** — Gradient-free Natural Evolution Strategy
|
|
208
|
+
3. **Black-box probe (YSQA)** — Score-based Square Attack
|
|
209
|
+
|
|
210
|
+
It computes a **masking index**:
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
masking_index = 1 - (white_box_drop / black_box_drop)
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Interpretation
|
|
217
|
+
|
|
218
|
+
| Masking Index | Verdict | Meaning |
|
|
219
|
+
|---------------|---------|---------|
|
|
220
|
+
| 0.0 | `NO_MASKING` | Model is genuinely robust |
|
|
221
|
+
| 0.2 - 0.5 | `GRADIENT_MASKING_WEAK` | Minor gradient issues |
|
|
222
|
+
| 0.5 - 0.8 | `GRADIENT_MASKING_MODERATE` | Significant masking detected |
|
|
223
|
+
| 0.8 - 1.0 | `GRADIENT_MASKING_HARD` | Severe masking — model is vulnerable |
|
|
224
|
+
|
|
225
|
+
### Example Output
|
|
226
|
+
|
|
227
|
+
```
|
|
228
|
+
YGMD Results:
|
|
229
|
+
Masking Index: 0.847
|
|
230
|
+
Verdict: GRADIENT_MASKING_HARD
|
|
231
|
+
White-box confidence drop: 2.3%
|
|
232
|
+
Black-box confidence drop: 15.1%
|
|
233
|
+
⚠️ Model shows false robustness — vulnerable to black-box attacks
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Output & Certification
|
|
239
|
+
|
|
240
|
+
### Preview Mode (Free)
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
============================================================
|
|
244
|
+
RednBlue Security Preview — YOLO Detection
|
|
245
|
+
============================================================
|
|
246
|
+
|
|
247
|
+
Attacks run : 8
|
|
248
|
+
Successful hits: 3/8 (37%)
|
|
249
|
+
Robustness rate: 63%
|
|
250
|
+
Estimated Grade: SILVER
|
|
251
|
+
|
|
252
|
+
⚠️ This is a preview only
|
|
253
|
+
→ Visit: https://rednblue.io/checkout
|
|
254
|
+
→ Re-run with: rnb preview --model-type yolo --submit
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Certified Mode (With Token)
|
|
258
|
+
|
|
259
|
+
When you use `--submit`, results are:
|
|
260
|
+
|
|
261
|
+
1. Encrypted with AES-256-CBC
|
|
262
|
+
2. Signed with HMAC-SHA256
|
|
263
|
+
3. Submitted to RednBlue's zero-knowledge backend
|
|
264
|
+
4. Processed to generate a PDF certificate
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
📤 Submitting results to server...
|
|
268
|
+
✓ Session created (ID: abc123)
|
|
269
|
+
|
|
270
|
+
✅ Results submitted successfully!
|
|
271
|
+
Session ID: abc123
|
|
272
|
+
Status: processing
|
|
273
|
+
|
|
274
|
+
📋 View results at: https://dashboard.rednblue.io/dashboard/tests
|
|
275
|
+
Certificate will be ready in ~1 minute
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## Grading System
|
|
281
|
+
|
|
282
|
+
| Grade | Pass Rate | Meaning |
|
|
283
|
+
|-------|-----------|---------|
|
|
284
|
+
| 🥇 **GOLD** | ≥ 90% | Excellent adversarial robustness |
|
|
285
|
+
| 🥈 **SILVER** | ≥ 75% | Good robustness with minor vulnerabilities |
|
|
286
|
+
| 🥉 **BRONZE** | ≥ 50% | Moderate vulnerabilities detected |
|
|
287
|
+
| ❌ **FAIL** | < 50% | Significant vulnerabilities — model at risk |
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## Environment Variables
|
|
292
|
+
|
|
293
|
+
| Variable | Description |
|
|
294
|
+
|----------|-------------|
|
|
295
|
+
| `RNB_TOKEN` | Your RednBlue session token (required for `--submit`) |
|
|
296
|
+
| `REDNBLUE_API_URL` | Custom API endpoint (default: `https://api.rednblue.io`) |
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Supported Model Formats
|
|
301
|
+
|
|
302
|
+
| Format | Extension | Notes |
|
|
303
|
+
|--------|-----------|-------|
|
|
304
|
+
| PyTorch (full model) | `.pt`, `.pth` | Saved with `torch.save(model, path)` |
|
|
305
|
+
| PyTorch (state_dict) | `.pt`, `.pth` | Auto-detects ResNet/VGG architecture |
|
|
306
|
+
| ONNX | `.onnx` | Requires `onnx` and `onnx2torch` packages |
|
|
307
|
+
| Ultralytics YOLO | `.pt` | YOLOv5, v8, v10, v11 supported |
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## Examples
|
|
312
|
+
|
|
313
|
+
### Full Classifier Workflow
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
# 1. Set your token
|
|
317
|
+
export RNB_TOKEN=RB-ABC123-XYZ789
|
|
318
|
+
|
|
319
|
+
# 2. Prepare test images
|
|
320
|
+
ls ./images/
|
|
321
|
+
# cat.jpg dog.jpg car.jpg ...
|
|
322
|
+
|
|
323
|
+
# 3. Run certified test
|
|
324
|
+
rnb preview --model resnet18.pth --input ./images --submit
|
|
325
|
+
|
|
326
|
+
# 4. Check dashboard for certificate
|
|
327
|
+
# https://dashboard.rednblue.io/dashboard/tests
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Full YOLO Workflow
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
# 1. Set your token
|
|
334
|
+
export RNB_TOKEN=RB-ABC123-XYZ789
|
|
335
|
+
|
|
336
|
+
# 2. Prepare COCO-style images
|
|
337
|
+
ls ./images/
|
|
338
|
+
# coco_000000001.jpg coco_000000002.jpg ...
|
|
339
|
+
|
|
340
|
+
# 3. Run certified test
|
|
341
|
+
rnb preview --model-type yolo --model yolov8n.pt --input ./images --submit
|
|
342
|
+
|
|
343
|
+
# 4. Check dashboard for certificate
|
|
344
|
+
# https://dashboard.rednblue.io/dashboard/tests
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## Troubleshooting
|
|
350
|
+
|
|
351
|
+
### "Model file not found"
|
|
352
|
+
Ensure the path to your model is correct and the file exists.
|
|
353
|
+
|
|
354
|
+
### "Unknown architecture in state_dict"
|
|
355
|
+
Your model's architecture couldn't be auto-detected. Save the full model instead:
|
|
356
|
+
```python
|
|
357
|
+
torch.save(model, 'model.pt') # Instead of torch.save(model.state_dict(), ...)
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### "ONNX support requires..."
|
|
361
|
+
Install ONNX dependencies:
|
|
362
|
+
```bash
|
|
363
|
+
pip install onnx onnx2torch
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### "RNB_TOKEN environment variable not set"
|
|
367
|
+
Set your token before using `--submit`:
|
|
368
|
+
```bash
|
|
369
|
+
# Linux/Mac
|
|
370
|
+
export RNB_TOKEN=RB-XXXXXX-YYYYYY
|
|
371
|
+
|
|
372
|
+
# Windows CMD
|
|
373
|
+
set RNB_TOKEN=RB-XXXXXX-YYYYYY
|
|
374
|
+
|
|
375
|
+
# Windows PowerShell
|
|
376
|
+
$env:RNB_TOKEN="RB-XXXXXX-YYYYYY"
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### Gradient masking detected but attacks still fail
|
|
380
|
+
This is expected! Gradient masking means white-box attacks fail, but black-box attacks (YNES, YSQA) should succeed. Check the YGMD diagnostic for details.
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
## Citation
|
|
385
|
+
|
|
386
|
+
If you use RednBlue in academic research, please cite:
|
|
387
|
+
|
|
388
|
+
```bibtex
|
|
389
|
+
@software{rednblue2026,
|
|
390
|
+
title = {RednBlue: Adversarial Security Testing for AI Models},
|
|
391
|
+
author = {Deramgozin, Mahdi and Samizadeh, Saeid},
|
|
392
|
+
year = {2026},
|
|
393
|
+
version = {2.2.0},
|
|
394
|
+
url = {https://rednblue.io}
|
|
395
|
+
}
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
## License
|
|
401
|
+
|
|
402
|
+
Proprietary — © 2026 R&B AI Security Solutions
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
## Links
|
|
407
|
+
|
|
408
|
+
- **Website:** https://rednblue.io
|
|
409
|
+
- **Dashboard:** https://dashboard.rednblue.io
|
|
410
|
+
- **Documentation:** https://docs.rednblue.io
|
|
411
|
+
- **Support:** support@rednblue.io
|
|
412
|
+
|
|
413
|
+
|