A full-stack application designed to simulate, detect, and analyze prompt injection attacks hidden within webpage code. This tool uses Python (FastAPI), React (Vite), and a local LLM (Ollama) to scan websites and compare how vulnerable an AI is to hidden instructions.
Before running this project on a new computer, ensure you have installed:
- Node.js (v20+ recommended) - For the frontend
- Python (v3.9+) - For the backend
- Ollama - Download from ollama.com to run local AI models
- Tesseract-OCR (Optional) - For extracting text from images
Open a terminal and download the default model:
ollama pull mistral(Make sure the Ollama app is running in the background).
Open a terminal inside the backend folder and run:
# Install required python packages
pip install -r requirements.txt
# (Optional) Download Playwright browser binaries for advanced scraping
python -m playwright install chromiumOpen a terminal inside the frontend folder and run:
# Install Node dependencies
npm installYou will need to open three separate terminal windows to run the full environment.
Terminal 1: Start the Backend API
cd backend
python -m uvicorn main:app --reload(Runs on http://localhost:8000)
Terminal 2: Start the React Dashboard
cd frontend
npm run dev(Runs on http://localhost:5173)
Terminal 3: Start the Fake "Honeypot" Demo Site (For testing!)
cd demo-site
python -m http.server 8080(Runs on http://localhost:8080)
- Open your browser to the Frontend Dashboard (
http://localhost:5173/). - Paste the URL of the demo site (
http://localhost:8080/) into the search bar. - Click Scan URL.
- The tool will scrape the page, detect the invisible prompt injections, query your local Ollama model in Safe/Unsafe modes, and display the final Threat Analysis.