Privacy-first AI scam, phishing, fake job offer, and suspicious document analyzer.
TruthShield Lite is a database-free full-stack project. Each scan is stored as a local artifact folder under storage/scans, making the system easy to inspect, demo, export, and extend.
- Accepts pasted suspicious text, job offers, emails, or messages.
- Optionally accepts an uploaded image, screenshot, or document-like file.
- Provides investigation modes for scam text, fake jobs, suspicious URLs, and AI media.
- Samples video frames and runs a pretrained AI-image classifier when optional AI dependencies are installed.
- Combines average frame likelihood, top suspicious frames, strong-frame ratio, and consistent mild-suspicion signals.
- Adds multimodal context agents for OCR text, speech transcript, public-figure misuse, health claims, money scams, and identity/link risk.
- Displays the six most suspicious frames with timestamps and per-frame likelihoods.
- Shows risk category meters, highlighted evidence, local scan history, and a threat watchlist.
- Extracts text/security features.
- Produces an ML-style risk score.
- Produces a DL-style visual risk estimate for uploaded files.
- Retrieves relevant safety knowledge from a local RAG-style knowledge base.
- Generates a Markdown risk report and a dashboard result.
- Frontend: HTML, CSS, vanilla JavaScript
- Backend: Python standard library HTTP server
- Storage: local JSON and Markdown files
- AI tiers:
- Classical ML tier: feature extraction + risk model in
backend/engine/ml_model.py - Deep Learning tier: visual risk analyzer stub in
backend/engine/dl_model.py - Multimodal media tier: OCR/audio/persona context agents in
backend/engine/media_context_detector.py - Generative AI tier: local RAG-style report generation in
backend/engine/rag_engine.pyandreport_generator.py
- Classical ML tier: feature extraction + risk model in
This starter intentionally avoids external dependencies so it runs anywhere. Later, replace the heuristic modules with Scikit-learn, PyTorch, OCR, and a real LLM.
From the project root:
cd truthshield-lite
python backend/app.pyOpen:
http://localhost:8000The basic app remains dependency-free. To enable video frame analysis, run once:
./scripts/install-ai.ps1Or install manually:
python -m pip install -r requirements-ai.txtOCR is supported as an optional extra when your Torch/TorchVision environment is compatible:
python -m pip install -r requirements-ocr.txtThen restart TruthShield:
python -B backend/app.pyThe first image/video or audio scan downloads the configured Hugging Face model and can take longer. Later scans reuse the local model cache.
The default model is umm-maybe/AI-image-detector. Override it with:
$env:TRUTHSHIELD_AI_MODEL="your-compatible-image-classification-model"
python -B backend/app.pyThis produces an AI-generation likelihood, not proof that media is fake. Animation, CGI, heavy compression, and unseen generators can still cause incorrect results.
OCR and audio transcription are optional. If easyocr or audio extraction dependencies are unavailable, TruthShield still runs and marks that agent as unavailable instead of crashing. On Windows/Anaconda, install OCR only in a clean environment if TorchVision version conflicts appear.
For users who want the whole demo in one file:
python -B truthshield_compiled.pyThis launches the same app at:
http://localhost:8000The single-file edition bundles the frontend, backend routes, scanner logic, local knowledge base, and report generator into truthshield_compiled.py.
truthshield-lite/
truthshield_compiled.py
backend/
app.py
engine/
dl_model.py
feature_extractor.py
ml_model.py
rag_engine.py
report_generator.py
storage.py
frontend/
index.html
styles.css
app.js
docs/
01-project-overview.md
02-architecture.md
03-runbook.md
04-upgrade-roadmap.md
knowledge_base/
scam_patterns.json
storage/
scans/
scripts/
run.ps1- Replace
ml_model.pywith a Scikit-learn pipeline trained on SMS spam, phishing, and fake job datasets. - Replace
dl_model.pywith a PyTorch CNN for fake screenshot / AI-image / manipulated document detection. - Replace
rag_engine.pywith ChromaDB embeddings over cybersecurity PDFs. - Replace
report_generator.pywith an LLM call that generates richer explanations from retrieved context.
Read these files in order:
docs/01-project-overview.mddocs/02-architecture.mddocs/03-runbook.mddocs/04-upgrade-roadmap.md