SafeSurf AI is a backend-driven Chrome extension that analyzes webpages in real time and provides explainable security risk scores to help users identify potentially unsafe or suspicious websites.
The system follows a privacy-first client–server architecture, where only minimal, non-sensitive webpage signals are collected in the browser and evaluated by a FastAPI backend.
- 🔍 Real-time webpage risk analysis
- 🧠 Explainable risk scoring (rule-based, no black box)
- 🌐 Backend-driven architecture using FastAPI
- 🧩 Chrome Extension (Manifest V3)
- 🎯 Visual risk badge injected directly into webpages
- 🟢🟡🔴 Color-coded risk levels (LOW / MEDIUM / HIGH)
- 🔐 Privacy-first design (no cookies, no user tracking)
- ⚡ Asynchronous client–server communication
User opens webpage ↓ Chrome Extension collects minimal signals ↓ FastAPI backend computes risk score ↓ Explainable result returned ↓ Visual risk badge displayed on webpage
- HTTPS vs HTTP
- Number of iframes
- Presence of phishing-related keywords (login, bank, password, verify)
- Current page URL (not stored persistently)
- Chrome Extension (Manifest V3)
- JavaScript
- Content Scripts + Background Service Worker
- FastAPI
- Python 3.12
- REST APIs
- Rule-based risk engine
- In-memory caching (development-safe)
- PostgreSQL (persistent storage)
- Redis (distributed caching)
- Docker (containerized deployment)
- ML-based phishing detection
SafeSurf-AI/ ├── backend/ │ ├── app/ │ │ ├── api/ │ │ ├── services/ │ │ ├── models/ │ │ └── main.py │ └── Dockerfile │ ├── extension/ │ ├── manifest.json │ ├── content.js │ ├── background.js │ ├── popup.html │ └── popup.js │ └── README.md
cd backend
python -m venv venv
venv\Scripts\activatepython -m pip install fastapi uvicorn pydanticpython -m uvicorn app.main:app --reloadhttp://127.0.0.1:8000http://127.0.0.1:8000/docsEndpoint
POST /analyzeRequest
{
"url": "http://example.com",
"hasHTTPS": false,
"iframeCount": 3,
"suspiciousKeywords": ["login", "bank"]
}Response
{
"risk_score": 55,
"risk_level": "MEDIUM",
"reasons": [
"Website is not using HTTPS",
"Phishing-related keywords found"
]
}- Open Chrome and navigate to
chrome://extensions - Enable Developer mode
- Click Load unpacked
- Select the
extension/directory - Open any website to see the SafeSurf AI risk badge
- 🟢 LOW – No significant risk signals detected
- 🟡 MEDIUM – Potential security concerns identified
- 🔴 HIGH – Multiple high-risk indicators detected
- Non-intrusive
- Informational only
- Fully explainable
SafeSurf AI is designed with privacy by default:
- ❌ No cookies
- ❌ No credentials
- ❌ No page content storage
- ❌ No user tracking
- ✅ Only transient, minimal signals are analyzed
- Machine-learning-based phishing detection
- Persistent risk history using PostgreSQL
- Redis-based caching and rate limiting
- Dockerized backend and database
- Cloud deployment
- Optional proactive warnings for high-risk pages
SafeSurf AI demonstrates:
- Real-world client–server architecture
- Browser security concepts
- API-driven backend design
- Explainable decision systems
- Practical engineering trade-offs
This project reflects how modern security tooling is architected in production systems.
MIT License
Free to use, modify, and distribute.