How anshikayad16/promptshield-ai-analyzer works
ShieldAI Analyzer combines a browser extension and Flask service to scan prompts before submission, classify risk, and allow or block the interaction. Its dashboard also supports account access and review of recent logs and aggregate safe/blocked counts. The main workflow is shown in detail from the extension’s content script through the service, detection pipeline, and SQLite log store. The README documents broader platform coverage and local processing; unsampled templates and extension assets are represented by their existing directories, with uncertain implementation links omitted.
Main entry points: app.py Flask routes · model.py Detection pipeline · content.js Prompt interception · database.py Database access
Components 18
Browser extension
- Prompt interception
extension/content.js - Request dispatch
extension/background.js - Popup scanning
extension/popup.js
Web service
- Dashboard scanning
static/app.js - Flask routes
app.py - Account access
app.py - Logs dashboard
app.py - Web views
templates
Threat detection
- Detection pipeline
model.py - Signature checks
model.py - Heuristic checks
model.py - ML classifier
model.py - Training datasets
data.csv - Injection dataset
prompt_injection_dataset.csv
Persistence and analytics
- SQLite store
database.db - Database access
database.py
Other components
- Browser user
- AI platform
Connections 22
- Browser user → Prompt interception: enters prompt
extension/content.js - Prompt interception → Request dispatch: requests scan
extension/content.js - Request dispatch → Flask routes: posts prompt
extension/background.js - Flask routes → Detection pipeline: analyzes prompt
app.py - Detection pipeline → Signature checks: checks first
model.py - Detection pipeline → Heuristic checks: checks next
model.py - Detection pipeline → ML classifier: checks last
model.py - ML classifier → Training datasets: trains from
model.py - ML classifier → Injection dataset: trains from
model.py - Flask routes → Database access: stores decision
app.py - Database access → SQLite store: reads and writes
database.py - Flask routes → Prompt interception: returns decision
README.md - Prompt interception → AI platform: replays if safe
extension/content.js - Browser user → Popup scanning: submits prompt
extension/popup.js - Popup scanning → Flask routes: posts prompt
extension/popup.js - Browser user → Dashboard scanning: submits prompt
static/app.js - Dashboard scanning → Flask routes: posts prompt
static/app.js - Browser user → Account access: registers or logs in
app.py - Account access → Database access: queries users
app.py - Browser user → Logs dashboard: views analytics
app.py - Logs dashboard → Database access: queries logs
app.py - Flask routes → Web views: renders pages
app.py