Skip to content

About

Privacy-Preserving Federated AI Platform for Phishing & Business Email Compromise Detection

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

PrivaShield — Privacy-Preserving Phishing & BEC Detection Platform

Enterprise-grade AI platform for detecting phishing and Business Email Compromise using federated learning and differential privacy.

Deploy on Railway

Architecture

  • Model: TinyLlama-1.1B + PEFT LoRA (r=16, α=32), 5 multi-task classification heads
  • Privacy: Opacus DP-SGD, ε < 5, Rényi accounting
  • Federation: Flower FedProx + SecAgg+ (no raw email transmission)
  • Defense: Homoglyph normalization, Unicode stripping, prompt injection guard, URL chain resolution
  • Intelligence: MITRE ATT&CK, MISP, OpenPhish, PhishTank, AbuseIPDB via FAISS HNSW

Performance Targets

Metric Target
Macro F1 > 0.92
p99 Latency < 100 ms
False Positive Rate < 2%
Privacy leakage < 0.1%
Privacy budget ε < 5
Memory footprint < 2 GB

Quick Start

Local (demo mode — no GPU or model weights needed)

git clone https://github.com/YOUR_ORG/privashield.git
cd privashield
pip install -r requirements.txt
uvicorn src.api.main:app --reload

Open http://localhost:8000/docs for the interactive API.

Railway deployment

  1. Fork this repo
  2. Create a new Railway project → "Deploy from GitHub repo"
  3. Add env vars (see .env.example)
  4. Deploy — Railway auto-detects Dockerfile or uses railway.json

Production Kubernetes

kubectl apply -k k8s/overlays/production

Environment Variables

Variable Default Description
PORT 8000 HTTP port (Railway injects automatically)
DEMO_MODE true Skip heavy ML deps; use mock classifier
LOG_LEVEL info structlog level
OPENPHISH_API_KEY — OpenPhish premium feed key
ABUSEIPDB_API_KEY — AbuseIPDB v2 key
MISP_URL — MISP instance URL
MISP_KEY — MISP auth key
SECRET_KEY change-me API auth secret
MAX_CONCURRENT_REQUESTS 100 Semaphore limit

Project Structure

src/
  api/          FastAPI app, routes, middleware
  core/         EmailThreatClassifier, embeddings, task heads
  defense/      AdversarialDefenseLayer
  federation/   FederatedLearningServer (Flower)
  intelligence/ RASIEngine (FAISS + threat feeds)
  training/     DP-SGD training loop
  evaluation/   Metrics, privacy audit, adversarial eval
k8s/            Kubernetes manifests (Kustomize)
tests/          Unit + integration test suite
scripts/        Data prep, index build, smoke test

License

Apache 2.0 — see LICENSE.

About

Privacy-Preserving Federated AI Platform for Phishing & Business Email Compromise Detection

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages