Cybersecurity · intermediate

Adversarial Prompt Injection Detector for LLM Applications

A real-time security gateway between users and an LLM that blocks prompt injections and jailbreak attempts.

Project overview

As companies rapidly integrate GenAI into their products, AI security has become one of the most critical niches in tech right now. This project demonstrates your ability to protect corporate assets from the next generation of AI-driven attacks, making you a high-value candidate for Security Engineer and AI Safety roles.

Real-world use case

A fintech company deploying an AI customer service agent uses this system to prevent malicious users from tricking the bot into revealing internal database schemas or unauthorized customer information.

Tools and technologies

Skills you can demonstrate

Adversarial ML, LLM Security, API Security

Build roadmap

  1. Study the attack landscape
    Read OWASP's LLM Top 10. Collect real jailbreak examples from DAN, prompt injection databases, and academic papers.
  2. Generate a training dataset
    Use the AI prompt below to generate 500+ adversarial prompts across categories: direct injection, indirect, obfuscated, roleplay.
  3. Train a baseline classifier
    Use scikit-learn with TF-IDF + Logistic Regression first. Get a baseline accuracy score before reaching for deep learning.
  4. Build the FastAPI gateway
    Create an API that sits in front of the LLM. Incoming prompts get scored; malicious ones get blocked with a 403.
  5. Add the LLM-as-judge layer
    For edge cases, send ambiguous prompts to a second LLM with a security-focused system prompt. Combine scores.
  6. Build a security dashboard
    Log all blocked attacks with timestamps, attack type, and source. Use this in your demo video.

Ways to extend the project

Implement an LLM-based "Judge" model that works alongside your classifier to evaluate the semantic intent of incoming prompts in real-time for higher accuracy.

How to showcase your work

Open this project in BuildersBenchBrowse Cybersecurity projects