Skip to content

Latest commit

 

History

History
282 lines (201 loc) · 8.45 KB

README.md

File metadata and controls

282 lines (201 loc) · 8.45 KB

🛡️ ShadowAI

AI Prompt Security & Governance Platform

Stops sensitive data leaking into ChatGPT, Claude, Gemini, Copilot, and Perplexity — scanned in the browser, before it ever sends.


Status FastAPI Python



Why this exists

People paste things into AI chatbots without thinking twice as an AWS key while debugging, a customer's email while drafting a support reply, a chunk of proprietary code while asking for a refactor. None of it is malicious. All of it is a problem.

ShadowAI sits between the employee and the AI tool, reads the prompt in real time, and decides whether it's safe to send entirely inside the browser, before a single character reaches an external server.

No blind trust. No silent blocking either every decision comes with a reason attached.


How it flows

flowchart TD
    A["Employee"] --> B["Browser Extension"]
    B -->|intercepts before send| C["FastAPI Backend"]
    C --> D["Detection Engine"]
    D --> E["Risk Scoring Engine"]
    E --> F{"Decision Engine"}
    F -->|0-30| G["Allow"]
    F -->|31-70| H["Warn"]
    F -->|71-100| I["Block"]
    F -->|when possible| J["Auto-Redact"]
    G --> K["Audit Logs"]
    H --> K
    I --> K
    J --> K
    K --> L["Admin Dashboard"]

    style A fill:#1E293B,stroke:#64748B,color:#fff
    style B fill:#0F172A,stroke:#3B82F6,color:#fff
    style C fill:#0F172A,stroke:#3B82F6,color:#fff
    style D fill:#0F172A,stroke:#8B5CF6,color:#fff
    style E fill:#0F172A,stroke:#8B5CF6,color:#fff
    style F fill:#1E293B,stroke:#F59E0B,color:#fff
    style G fill:#0F172A,stroke:#22C55E,color:#fff
    style H fill:#0F172A,stroke:#F59E0B,color:#fff
    style I fill:#0F172A,stroke:#EF4444,color:#fff
    style J fill:#0F172A,stroke:#06B6D4,color:#fff
    style K fill:#1E293B,stroke:#64748B,color:#fff
    style L fill:#1E293B,stroke:#64748B,color:#fff
Loading

The whole round trip intercept, scan, score, decide happens before the prompt is ever allowed to leave the machine.


What's actually checking the prompt

ShadowAI doesn't rely on one model doing all the work. Three detection modules run in parallel, each tuned for a different kind of leak.

flowchart LR
    P["Incoming Prompt"] --> S["Secret Detection"]
    P --> PII["PII Detection"]
    P --> SC["Source Code Detection"]

    S --> R["Explainable Risk Score"]
    PII --> R
    SC --> R

    style P fill:#1E293B,stroke:#64748B,color:#fff
    style S fill:#0F172A,stroke:#EF4444,color:#fff
    style PII fill:#0F172A,stroke:#3B82F6,color:#fff
    style SC fill:#0F172A,stroke:#22C55E,color:#fff
    style R fill:#1E293B,stroke:#F59E0B,color:#fff
Loading
Module Catches Powered by
Secrets AWS keys, GitHub tokens, JWTs, passwords, API keys, OAuth tokens, SSH keys Regex + pattern matching
PII Emails, phone numbers, credit cards, Aadhaar, PAN, passport numbers, customer names Microsoft Presidio, spaCy NER, regex
Code Python, Java, JavaScript, C++, Go, SQL Keyword, import, class/function, and file-structure heuristics

Running these in parallel instead of stacking them keeps accuracy high without drowning users in false positives.


Risk scoring, with receipts

Most tools in this space hand you a number and call it a day. ShadowAI shows its work.

Risk Score: 87

  AWS Access Key       +40
  Customer Email       +20
  Source Code          +15
  Public AI Platform   +12

Every risk score is fully explainable, with each point directly linked to the specific sensitive content or behavior detected by the engine—ensuring complete transparency, not blind trust.

Score Action Behavior
0–30 Allow Prompt goes through, no friction
31–70 Warn User sees the risk and chooses: cancel, send anyway, or auto-redact — either way, it's logged
71–100 Block Prompt is stopped per policy, with a clear explanation shown on screen

Auto-redaction, not just blocking

Blocking someone outright kills their momentum. Where it's safe to do so, ShadowAI just strips the sensitive part and lets the person keep working.

Before

AWS_KEY=AKIA123456789
Customer: john@example.com

After

AWS_KEY=[REDACTED]
Customer: [EMAIL]

Full data flow

flowchart TD
    A["Employee"] --> B["Browser Extension"]
    B --> C["FastAPI Backend"]
    C --> D["Detection Engine"]

    subgraph DET[" "]
        D1["Secret Detection"]
        D2["PII Detection"]
        D3["Source Code Detection"]
    end

    D --> D1
    D --> D2
    D --> D3

    D1 --> E["Explainable Risk Scoring"]
    D2 --> E
    D3 --> E

    E --> F["Decision Engine"]

    subgraph DEC[" "]
        F1["Allow"]
        F2["Warn"]
        F3["Block"]
        F4["Auto-Redact"]
    end

    F --> F1
    F --> F2
    F --> F3
    F --> F4

    F1 --> G["Audit Logs"]
    F2 --> G
    F3 --> G
    F4 --> G

    G --> H["Admin Dashboard"]

    style A fill:#1E293B,stroke:#64748B,color:#fff
    style B fill:#0F172A,stroke:#3B82F6,color:#fff
    style C fill:#0F172A,stroke:#3B82F6,color:#fff
    style D fill:#0F172A,stroke:#8B5CF6,color:#fff
    style D1 fill:#0F172A,stroke:#EF4444,color:#fff
    style D2 fill:#0F172A,stroke:#3B82F6,color:#fff
    style D3 fill:#0F172A,stroke:#22C55E,color:#fff
    style E fill:#1E293B,stroke:#F59E0B,color:#fff
    style F fill:#1E293B,stroke:#F59E0B,color:#fff
    style F1 fill:#0F172A,stroke:#22C55E,color:#fff
    style F2 fill:#0F172A,stroke:#F59E0B,color:#fff
    style F3 fill:#0F172A,stroke:#EF4444,color:#fff
    style F4 fill:#0F172A,stroke:#06B6D4,color:#fff
    style G fill:#1E293B,stroke:#64748B,color:#fff
    style H fill:#1E293B,stroke:#64748B,color:#fff
Loading

System components

Browser Extension

Chrome

The first checkpoint. Before "send" actually does anything, the extension grabs the prompt, holds it, and waits for a verdict.

Captured per request:

  • User ID and timestamp
  • Browser and destination platform
  • The prompt text itself

Backend API

FastAPI

Built on FastAPI and Python. Handles auth, runs the full detection pipeline, applies org-level policy, computes the risk score, logs the event, and returns a decision.

Audit & Dashboard

Dashboard

Every scan is logged user, timestamp, destination, score, trigger, decision, override, and policy applied.

Turns raw logs into prompt history, risk analytics, and department-level trends.


Tech stack

Python FastAPI spaCy Regex Chrome Extension



Built to keep people productive with AI — without handing over the keys.