mirror of
https://github.com/Shiva108/ai-llm-red-team-handbook.git
synced 2026-05-14 20:58:09 +02:00
b3d3bac51f
- Extracted all code examples from handbook chapters - Organized into 15 attack categories - Created shared utilities (api_client, validators, logging, constants) - Added workflow orchestration scripts - Implemented install.sh for easy setup - Renamed all scripts to descriptive functional names - Added comprehensive README and documentation - Included pytest test suite and configuration
37 lines
818 B
Python
37 lines
818 B
Python
#!/usr/bin/env python3
|
|
"""
|
|
Practical Detection Example
|
|
|
|
Source: Chapter_33_Red_Team_Automation
|
|
Category: automation
|
|
"""
|
|
|
|
from typing import List, Dict
|
|
|
|
import argparse
|
|
import sys
|
|
|
|
#!/usr/bin/env python3
|
|
"""
|
|
Dashboard Logic: Analyzing Test Results
|
|
"""
|
|
|
|
def analyze_regression(history: List[Dict]):
|
|
"""
|
|
Check if current score is worse than baseline.
|
|
"""
|
|
baseline = history[0]["score"]
|
|
current = history[-1]["score"]
|
|
|
|
if current < baseline:
|
|
return f"REGRESSION: Score dropped from {baseline} to {current}"
|
|
return "STABLE: Security posture maintained."
|
|
|
|
if __name__ == "__main__":
|
|
history = [
|
|
{"version": "v1.0", "score": 98.5},
|
|
{"version": "v1.1", "score": 98.5},
|
|
{"version": "v1.2", "score": 92.0} # Bad update
|
|
]
|
|
print(analyze_regression(history))
|