Explainable, secured AI for bank risk: XAI, LLM chat, GNN fraud, AI Security Lab & AI/ML roadmap.
1.2K
One container, a complete AI/ML + cybersecurity learning path. CAMEL Sentinel scores a bank's financial health from six CAMEL ratios, explains every prediction, and shows how to deploy, attack and defend a real AI system, all from your browser.
π» Source code, docs and notebooks: github.com/raushan1107/ai-ml-cybersecurity-bank-risk-capstoneβ : β star it on GitHub too!
β If this helps you learn or teach, please star this repository (the β button at the top of this page). It helps others find it, and it's the best way to say thanks.
π¨βπ» Developer: Raushan Ranjanβ Β· π Books/Handbook/Notes written by Raushan Ranjan: AI/ML + Cybersecurity Handbookβ Β· GitHubβ (β it too!)
docker run -d --name camel -p 8501:8501 raushanranjan/camel-sentinel:latest
docker ps # wait until STATUS shows (healthy), about 1β2 minutes
Then open http://localhost:8501β π
Everything works without any keys. To enable the AI Chat Assistant (Azure OpenAI) and voice (Azure Speech), pass your own keys at run time; they are never baked into the image:
docker run -d --name camel -p 8501:8501 --env-file .env raushanranjan/camel-sentinel:latest
# .env
AZURE_OPENAI_ENDPOINT=https://<your-resource>.openai.azure.com/
AZURE_OPENAI_KEY=<your-key>
AZURE_OPENAI_DEPLOYMENT=gpt-5-mini
AZURE_OPENAI_API_VERSION=2025-08-07-preview
AZURE_SPEECH_KEY=<your-speech-key>
AZURE_SPEECH_REGION=<your-region>
| Page | What you can do |
|---|---|
| π« Score a Bank | Pick a real FDIC bank or enter ratios β failure-risk score with SHAP, LIME and a counterfactual "what would make it safe?" |
| π¬ Chat Assistant | Ask about a bank in plain English (text or voice). The LLM only explains the ML model's numbers; it never invents ratings |
| π Documentation | Model card, fairness (RAI) audit, glossary |
| πΈοΈ Fraud Detection (GNN) | Heterogeneous GraphSAGE catches fraud rings that tabular models miss (synthetic data) |
| π‘οΈ AI Security Lab | 10 live attack β defence labs: prompt injection, PII leakage, tool hijacking, adversarial evasion, data poisoning, model stealing, deepfake voice, AI SOC, supply chain, with a STRIDE + MITRE ATLAS threat map |
| π Security Posture | How the app protects itself, audit findings, CVE scan, a live self-test you can run, and future work |
| πΊοΈ AI/ML Roadmap | Interactive tree of 12 stages and 56 topics, each with real-world uses, an analogy, the maths, code and a security angle |
| π Build Guide | How the whole project was built, with copy-paste AI prompts |
| π¨ Themes | Six themes in the sidebar: System, Light, Dark, High contrast, Sepia (reading), Ocean |
| π’ Deploy & Containerize | This image explained: Dockerfile line by line, layers, registries, Azure Container Apps, Kubernetes, Trivy |
Stack: Python 3.10 Β· FastAPI Β· Streamlit Β· scikit-learn (HistGradientBoosting) Β· SHAP Β· LIME Β· PyTorch Geometric Β· Azure OpenAI Β· Azure Speech. Data: 265,114 real FDIC bank-quarters (2005β2023); the fraud and security-lab data are clearly-labelled synthetic sets.
| Variable | Default | Purpose |
|---|---|---|
MODE | all | all = UI + API in one container Β· api = FastAPI only Β· ui = Streamlit only |
CAMEL_BACKEND_URL | http://localhost:8000 | Default API address for the UI (use http://api:8000 with compose) |
CAMEL_BACKEND_ALLOWLIST | empty | Extra host patterns the UI may switch to (built in: localhost, api, *.azurecontainerapps.io, *.azurewebsites.net, *.azure-api.net) |
CAMEL_LOCK_BACKEND | 0 | 1 pins the API address and hides the sidebar switch (production) |
CAMEL_API_PUBLIC | 0 | In all mode the API is private to the container. Set 1 (and add -p 8000:8000) to explore http://localhost:8000/docs |
CAMEL_CORS_ORIGINS | http://localhost:8501 | Allowed browser origins for the API |
Ports: 8501 (web UI) Β· 8000 (REST API, private by default).
services:
api:
image: raushanranjan/camel-sentinel:latest
environment: { MODE: api }
ui:
image: raushanranjan/camel-sentinel:latest
environment: { MODE: ui, CAMEL_BACKEND_URL: "http://api:8000" }
ports: ["8501:8501"]
depends_on: { api: { condition: service_healthy } }
Expose port 8501 (the UI). The API runs in the same container and stays private. Give it 2 CPU / 4 GiB.
az containerapp up -n camel-sentinel -g <resource-group> \
--image docker.io/raushanranjan/camel-sentinel:latest --ingress external --target-port 8501
# then: az containerapp update -g <resource-group> -n camel-sentinel --cpu 2 --memory 4Gi
Exposing port 8000 shows only the API; from v2.1 a MODE=all app's API listens only inside the container.
# API-only app in Azure: MODE=api, target port 8000 (Swagger at /docs)
docker run -d -p 8501:8501 -e MODE=ui raushanranjan/camel-sentinel:latest
# open http://localhost:8501/?backend=https://<api-app>.azurecontainerapps.io
Or use the sidebar π Backend API panel. It switches every page, accepts only allow-listed hosts that answer /health like a
CAMEL API, and can be pinned with CAMEL_LOCK_BACKEND=1.
| Tag | Contents |
|---|---|
latest | Newest release (recommended) = v2.3 |
v2.3 | Matches the public GitHub repository; accurate SHAP base-rate display; docs reorganised |
v2.2 | Switchable backend API (sidebar or ?backend= link, allow-listed + verified); one-go Azure Container Apps guide |
v2.1 | Security-hardened release: SSRF fix, guarded chat, input limits, upgraded web stack, credits, grouped navigation, Security Posture page |
v2.0 | Adds Deploy & Containerize, AI Security Lab and AI/ML Roadmap |
v1.0 | Core app: scoring, XAI, RAI, chat, GNN, build guide |
model_loaded=true)curl or pip in the imageA teaching project. Risk scores are a model's relative ranking from public financial-statement proxies. They are not official CAMELS supervisory ratings and not financial advice.
v2.3 Β· open-source release (latest)
docs/ with a reading guide; corrected learning-path detailsv2.2 Β· switchable backend
http://localhost:8501/?backend=https://<api-app>.azurecontainerapps.ioCAMEL_BACKEND_ALLOWLIST), must answer /health like a CAMEL API, no credentials in URLs; CAMEL_LOCK_BACKEND=1 pins itv2.1 Β· security-hardened + new UI
curl and pip removed β 0 Python-package CVEs (was 9)v2.0 Β· deploy, attack, learn
COPY --chown), mode-aware health check, one image with three modes (all / api / ui)v1.0 Β· the core app
β Star this repo here and on GitHubβ if you found it useful Β· π¨βπ» Developer: Raushan Ranjanβ Β· π Books/Handbook/Notes written by Raushan Ranjanβ : AI/ML + Cybersecurity Handbookβ .
Content type
Image
Digest
sha256:b3d020d9bβ¦
Size
601.1 MB
Last updated
26 days ago
docker pull raushanranjan/camel-sentinel