Linguistic Safety & Robustness Workbench - Red-teaming frontier LLMs across low-resource African languages
# LSR Dashboard: Linguistic Safety & Robustness Workbench
**Author:** Godwin Faruna Abuh
**Role:** AI Safety Researcher | Senior Applied AI Safety Engineer
---
## π‘οΈ Overview
The **LSR Dashboard** is a workbench for evaluating **Linguistic Safety Decay** in Large Language Models. While frontier models exhibit strong safety alignment in English, this robustness often deteriorates in mid/low-resource languages.
This tool provides:
- **Cross-lingual red-teaming** across Igala, Yoruba, Hausa, and English
- **Mechanistic visualization** of activation drift
- **Empirical loophole detection** with session statistics
- **Translation verification** via Google Translate
---
## π Languages Covered
- Yoruba π³π¬ (5 attack probes)
- Hausa π³π¬ (5 attack probes)
- Igbo π³π¬ (4 attack probes)
- Igala π³π¬ (3 attack probes)
- English π¬π§ (baseline)
**Model:** Gemini 2.5 Flash (GPT-4 & Claude support planned)
---
## π Key Features
### 1. Red-Teaming Lab
Side-by-side comparison of English baseline vs target language responses. Automatic loophole detection when English refuses but target language complies.
### 2. Mechanistic Visualizer
Activation heatmaps and safety centroid drift plots showing how refusal circuits struggle with low-resource syntax.
### 3. Vulnerability Gallery
Archive of confirmed HIGH/CRITICAL safety failures with empirical findings.
### 4. Session Analytics
Live tracking with exportable JSON logs for offline analysis.
---
## π Use Case
Demonstrate to decision makers that frontier models show **2-4x higher bypass rates** in Yoruba/Hausa/Igala compared to English.
---
## π Technical Stack
- Python 3.10+ | Streamlit
- Plotly visualizations
- Google Gemini 2.5 Flash API
---
## βοΈ Local Setup (Optional)
If you want to run this locally instead of using the Hugging Face Space:
```bash
# Clone or download this repository
# Install dependencies
pip install streamlit pandas numpy plotly google-generativeai python-dotenv
# Create a .env file and add:
# GEMINI β¦