Prompt Injection
Protection

This project delivers an educational web platform for understanding, exploring, and testing prompt injection attacks against large language models, with a particular focus on tool-using and MCP-style systems.

Screenshot of the Prompt Injection Protection platform home view, showing the hero and vulnerability catalogue

Project abstract

Problem and motivation

More and more clients are asking for applications that use large language models. Avanade needed clearer, practical information on how to keep those systems secure so delivery teams can meet client expectations and build trust. A core risk is prompt injection: hidden instructions in user input or other context can make a model ignore its task, leak data, or misuse tools.

That risk is especially serious when the model calls APIs or -style servers, because failures can propagate into real systems and client environments. There is still a gap between theory and clear, repeatable attack examples.

Teams need practical ways to learn how attacks work, what mitigations exist, how to run tests, compare mitigations, and harden system prompts without breaking intended behaviour. Abstract guidance alone is not enough: teams also need readable material on vulnerabilities and mitigations and a way to run prompts against real models and review what comes back.

Platform and technical approach

We built an educational web application with a React single-page front end and a FastAPI back end backed by SQLite. Users can work through a vulnerability catalogue with detail pages and interactive demos, take quizzes to check what they have learned, and open a mitigation catalogue when they need practical fixes—mitigation pages give structured explanations and optional code-style snippets.

A answers questions about prompt injection in plain language, with keyword search across the catalogue. The testing area lets you run your own prompts against whichever models you configure (including custom endpoints). You can also run scans against those same models, with chat-style output and a short risk read-out. The walks through three steps on your system prompt—tidy it up, add mitigation rules, check the result—before you rely on that prompt in production.

On the server side, traffic goes through one routing layer to the right provider APIs; SQLite stores the catalogue, saved tests, and past runs; optional mitigation layers can sit around each test run; and simple scoring flags outputs that look risky. A small runner calls the external Garak tool and drops those scan results into the same history and analysis views as manual tests. The assistant streams answers live, like a chat, so replies appear as they are generated.

Outcomes and intended impact

Developed in collaboration with Avanade, the platform is for anyone at the company—whether they are new to prompt injection or already pushing deeper tests with custom models. It supports people at any stage of familiarity, in a digestible format, as both an interactive learning space and a hands-on testing environment.

The aim is for teams to align on risk and rehearse mitigations before problems surface in client systems, and so people have tried mitigations, not just read about them. In turn, that can strengthen client trust, raise capability across technical and non-technical roles, and give Avanade a lasting internal resource that stays useful as models and tools change.

Platform features

Vulnerabilities
Vulnerability catalogue listing and detail view in the Prompt Injection Protection platform

This is the prompt-injection vulnerability catalogue. The home view lists every vulnerability with search and impact filters. Opening one shows the full article: explanation, tags, impact, example attack, demo (attack vs mitigated chat), links to mitigations, optional quiz, previous/next navigation, and export to PDF.

  • Search and filter by impact (High / Medium / Low).
  • Open a card for the full page; run the step-by-step demo and optional quiz.
  • Jump to related mitigations and export a PDF for the current vulnerability.
Testing page
Test Prompt Injection workbench with model configuration and test run results

The “Test Prompt Injection” area is where you build tests, save setups, and run them against external models. You pick or create a test, set the model, system prompt, mitigations, and how to call the API (including OpenAI-style, Anthropic, or a custom endpoint). You can check the connection, run a normal test, or run a Garak Garak NVIDIA’s open-source Generative AI Red-teaming & Assessment Kit: a probe-based scanner for LLMs that checks for prompt injection, jailbreaks, leaks, and other failure modes, similar in spirit to security tools like nmap but for language models. NVIDIA Garak on GitHub scan. Results show in chat, analysis, and framework history; tests and saved configs are stored on the backend.

  • Create, edit, duplicate, and delete tests; load and save named configurations.
  • Validate the API connection, then run a test or a Garak Garak NVIDIA’s open-source Generative AI Red-teaming & Assessment Kit: a probe-based scanner for LLMs that checks for prompt injection, jailbreaks, leaks, and other failure modes, similar in spirit to security tools like nmap but for language models. NVIDIA Garak on GitHub scan.
  • Review analysis and scan history; export a test report PDF where supported.
Mitigations
Mitigations list and detail panel with strategy and code snippets

The mitigations section explains defence techniques for prompt injection. A list on the left shows every mitigation with a short line and a code vs non-code badge. The main panel gives strategy, typical flow, and implementation—either a code snippet (with language choice and copy) or a note that it is not a single code module. You can export a PDF and choose which languages to include.

  • Browse the list and pick a mitigation to read the full detail.
  • Switch snippet language, copy code, and export PDF with optional language choices.
Security Knowledge Assistant (chatbot)
Security Knowledge Assistant chat with suggested questions and streamed reply

The “Security Knowledge Assistant” is a floating chat button on every page, plus a full-screen route for longer conversations. It answers questions about prompt injection, mitigations, and testing, shows a welcome message with suggested questions, streams replies as Markdown, and lets you stop or clear the conversation. The thread is saved in the browser so you can come back later.

  • Open or close the panel from the corner, or use the dedicated full-page view.
  • Send messages, use suggested questions, stop generation, or clear the chat.
Prompt enhancer
Prompt enhancer with mitigations selected, system prompt input, and improved output

The Prompt Enhancer helps you harden a system prompt. You choose prompt-layer mitigations from a list, paste your system prompt, pick a model, and run Generate. The app restructures the prompt, integrates your chosen mitigations into it, and runs checks. The result panel shows original, improved, and enhanced text plus verification (pass/fail style notes and which mitigations were applied). You can copy or reset.

  • Toggle mitigations, select a model, paste your prompt, then Generate or Reset.
  • Copy any of the outputs when you are happy with the result.

8-minute demo

Full walkthrough of the platform: catalogue, interactive demos, testing, prompt enhancer, and knowledge assistant (~8 minutes).

Team and contacts

Our Team

Meet the students behind this project.

Teo Montero

Teo Montero

Client liaison, programmer, and tester.

David Thomas

David Thomas

Report editor, programmer, and UI design.

Nathaniel Gibbon

Nathaniel Gibbon

Programmer and researcher.

Mario Mojarro

Mario Mojarro

UI design, programmer, and researcher.

Industry partner

Client liaison and project context (Avanade).

Josh McDonald — AI Security Lead, Avanade

Supervision

This project is submitted in March 2026 for UCL Computer Science COMP0016 (Systems Engineering). We thank Dr Yun Fu and Prof. Dean Mohamedally for module teaching and guidance during the project. We also thank our TA, Ziyang Chen, for his support throughout the year.

Project timeline

October
November
December
January
February
March
Week
W1W2W3W4 W5W6W7W8 W9W10W11W12 W13W14W15W16 W17W18W19W20 W21W22W23
Stage 1: Project initialisation & research
Stakeholder research
Project research
Requirements analysis
Developing prototypes
HCI & UX exploration
MoSCoW list & client sign-off
Stage 2: Foundation & content
Repository & frontend scaffold
UX & navigation model
Vulnerability & mitigation content
Stage 3: Platform & testing core
Backend persistence & API
Testing service (UI, scoring, pass/fail)
Models, mitigations & external APIs
Automated framework scanning
Stage 4: Integration & delivery
Security assistant & prompt enhancer
README & architecture
Report & handover

Bar colours — Across each row, darker orange means more of that task’s work was completed.

Lighter Mid Darker

Click a row label for details.

Time frame: 20 October 2025 to 27 March 2026.