A comprehensive fairness and security audit of an AI-powered loan approval system using the NIST AI Risk Management Framework
This project demonstrates professional AI auditing capabilities by evaluating a machine learning loan approval system for:
- Algorithmic Bias - Testing for gender and age discrimination
- Security Vulnerabilities - Identifying manipulation attack vectors
- Regulatory Compliance - Applying the 80% Rule fairness standard
Framework: NIST AI Risk Management Framework (RMF) 1.0
| Assessment Area | Result | Details |
|---|---|---|
| Gender Fairness | β PASS | Disparate Impact Ratio: 0.839 (threshold: β₯0.80) |
| Age Fairness | β PASS | Disparate Impact Ratio: 0.857 (threshold: β₯0.80) |
| Security - Age Field | β CRITICAL | 20% manipulation success rate |
| Security - Credit Amount | β HIGH | 10% manipulation success rate |
| Model Accuracy | β GOOD | 73.5% prediction accuracy |
Fairness: Model passes legal compliance thresholds for both gender and age groups
Monitoring Needed: Gender approval gap (14.5pp) operates near legal boundary
Security Risk: Age field highly vulnerable to manipulation attacks
Business Impact: 20% of rejected applicants could game the system
The model demonstrates legal compliance but shows disparities worth monitoring
Age and credit amount fields show significant manipulation vulnerabilities
Approval rates across demographic groups
pandas # Data manipulation and analysis
numpy # Numerical computing
scikit-learn # Machine learning (Random Forest)
matplotlib # Data visualization
seaborn # Statistical plottingpip install pandas numpy matplotlib seaborn scikit-learn jupyter# Clone the repository
git clone https://github.com/yourusername/ai-risk-audit.git
cd ai-risk-audit
# Launch Jupyter Notebook
jupyter notebook
# Open and run AI_Fairness_Audit.ipynbThe notebook will generate:
- 3 visualization PNG files
- Fairness metrics (80% Rule compliance)
- Security vulnerability analysis
- Risk assessment summary
ai-risk-audit/
β
βββ AI_Fairness_Audit.ipynb # Main audit notebook
βββ german_credit_data.csv # Dataset (1,000 applications)
βββ requirements.txt # Python dependencies
βββ README.md # This file
β
βββ overview.png # Generated: Data overview
βββ fairness_results.png # Generated: 80% Rule test results
βββ security_results.png # Generated: Manipulation vulnerability
This audit systematically applies all four functions of the NIST framework:
βββββββββββββββ
β GOVERN β β Established audit scope and objectives
βββββββββββββββ
β
βββββββββββββββ
β MAP β β Identified potential fairness and security risks
βββββββββββββββ
β
βββββββββββββββ
β MEASURE β β Quantified risks using 80% Rule & perturbation testing
βββββββββββββββ
β
βββββββββββββββ
β MANAGE β β Developed prioritized recommendations
βββββββββββββββ
Fairness Testing:
- Metric: Disparate Impact Ratio (80% Rule)
- Formula: (Protected Group Approval Rate) Γ· (Reference Group Approval Rate)
- Threshold: Must be β₯ 0.80 to avoid discrimination claim
- Groups Tested: Gender (Male/Female), Age (4 groups)
Security Testing:
- Method: Feature perturbation analysis
- Test: Modified each feature by 1% on rejected applications
- Measurement: Decision flip rate (rejection β approval)
- Risk Levels: >10% = HIGH, 5-10% = MEDIUM, <5% = LOW
Gender Analysis:
- Female approval rate: 75.8%
- Male approval rate: 90.3%
- Disparate Impact Ratio: 0.839 β (passes 0.80 threshold)
- Gap: 14.5 percentage points (within legal bounds but warrants monitoring)
Age Analysis:
- Under-25: 77.8%
- 25-35: 84.3%
- 35-50: 90.7%
- Over-50: 88.9%
- Disparate Impact Ratio: 0.857 β (passes 0.80 threshold)
Feature Manipulation Test Results:
| Feature | Flip Rate | Risk Level | Explanation |
|---|---|---|---|
| alter (age) | 20.0% | π΄ CRITICAL | Easily falsifiable, no verification |
| hoehe (credit) | 10.0% | π΄ HIGH | Can be strategically adjusted |
| laufzeit (duration) | 0.0% | π’ LOW | Stable feature |
| rate (installment) | 0.0% | π’ LOW | Stable feature |
| Other features | 0.0% | π’ LOW | No vulnerability detected |
Attack Scenario:
- Applicant aged 22 gets rejected
- Reapplies claiming age 24 (minor change)
- 20% chance system now approves
- No validation to detect this manipulation
- Implement age verification via government ID cross-check
- Add input validation to flag suspicious changes between applications
- Deploy rate limiting (max 2 applications per person per 90 days)
- Continuous monitoring dashboard tracking approval rates by demographic
- Automated alerts when fairness ratios drop below 0.85
- Weekly compliance reporting
- Model retraining with adversarial robustness techniques
- Explainability layer (SHAP values) for transparency
- AI governance framework with regular audits
- 73% of organizations cite AI bias as a top concern (Gartner 2024)
- EU AI Act and emerging regulations require systematic AI audits
- Financial services face highest scrutiny for algorithmic discrimination
This methodology applies to:
- Credit scoring and loan approval systems
- Hiring and recruitment AI
- Insurance underwriting algorithms
- Healthcare diagnostic tools
- Any high-stakes AI decision system
Standards & Frameworks:
Dataset: