CoolFace
Apppublic

Spandan-Satapute/ai-email-security-system

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

๐Ÿš€ AI Email Security System

An intelligent AI-powered system that detects spam emails and evaluates their risk levels using machine learning. Built as a real-world OpenEnv environment, where an agent learns step-by-step through tasks.


๐Ÿ”ฅ Live Demo

๐Ÿ‘‰ https://huggingface.co/spaces/Spandan-Satapute/ai-email-security-system-v2


๐Ÿง  Problem Statement

Spam emails and phishing attacks are growing rapidly. Traditional systems only classify spam but do not provide:

  • โ€”Risk level assessment
  • โ€”Confidence scoring
  • โ€”Explanation

This project solves that by building a complete AI environment.


๐Ÿ’ก Solution

This system:

  • โ€”Detects spam emails
  • โ€”Classifies risk (Low / Medium / High)
  • โ€”Gives confidence score
  • โ€”Provides explanation
  • โ€”Simulates agent learning with multi-step tasks

โš™๏ธ Features

  • โ€”โœ… Spam Detection (ML based)
  • โ€”โœ… Risk Level Classification
  • โ€”โœ… Confidence Scoring
  • โ€”โœ… Explanation Generation
  • โ€”โœ… Multi-Step OpenEnv Environment
  • โ€”โœ… FastAPI Backend
  • โ€”โœ… Docker Deployment
  • โ€”โœ… Live Hosted on Hugging Face

๐Ÿ—๏ธ System Architecture

  • โ€”Model โ†’ TF-IDF + Naive Bayes
  • โ€”Backend โ†’ FastAPI
  • โ€”Environment โ†’ Custom OpenEnv
  • โ€”Deployment โ†’ Docker + Hugging Face

๐Ÿค– OpenEnv Tasks

๐ŸŸข Easy

  • โ€”Detect spam or not

๐ŸŸก Medium

  • โ€”Classification + confidence

๐Ÿ”ด Hard

  • โ€”Risk level + explanation

๐Ÿ‘‰ Reward is calculated based on:

  • โ€”Accuracy
  • โ€”Confidence
  • โ€”Risk detection

๐Ÿ”Œ API Endpoints

MethodEndpointDescription
POST/classifyClassify email
POST/resetReset environment
GET/stateGet environment state
POST/stepPerform step
GET/healthCheck server

๐Ÿงช Example Input

json
{
  "text": "Win a free lottery now!!!"
}

๐Ÿ“Š Example Output
JSON
{
  "intent": "spam",
  "confidence": 0.92,
  "risk_level": "high",
  "explanation": "Suspicious or harmful content detected",
  "score": 1.0
}

๐Ÿณ Deployment
This project is fully containerized using Docker and deployed on Hugging Face Spaces.

๐Ÿ“ฆ Tech Stack
Python
FastAPI
Scikit-learn
Docker
Hugging Face Spaces

๐Ÿ‘จโ€๐Ÿ’ป Author
Spandan Satapute
CSE Student | AI Developer