Off-campus Eastern Washington University users: To download EWU Only theses, please use your EWU SSO (Single Sign-on) credentials. Clicking the blue “Download” button below will prompt you to log in in order to access the thesis document.
Non-EWU users: Please talk to your local librarian about requesting this thesis through Interlibrary loan.
Date of Award
Summer 2026
Rights
Access restricted for 2 years to EWU users with an active EWU NetID
Date Available to Non-EWU Users
2028-10-07
Document Type
Thesis: EWU Only
Degree Name
Master of Science (MS) in Computer Science
Department
Computer Science and Electrical Engineering
First Advisor
Sanmeet Kaur
Second Advisor
Chris Cain
Third Advisor
Lynnae Daniels
Abstract
As Large Language Models (LLMs) become increasingly popular and are integrated into autonomous agent systems, this has led to a rise in new security threats. These security risks exploit natural-language interfaces to override system controls, manipulate tool usage, bypass security policy, or provide unauthorized information. As we become more dependent on LLM-driven applications, these vulnerabilities become greater as models gain access to external tools, Application Programming Interfaces (APIs), and workflow automation. This research investigates these vulnerabilities by examining current defense strategies and developing a modular filtering system that identifies a wider range of prompt-injection patterns that traditional rule-based systems may miss. This was accomplished by designing a multi-layer detection architecture consisting of four components: banned-word matching, regex pattern detection, an LLM-based contextual system, and Prompt Guard - a model specifically tailored for identifying prompt injections. Testing on 700 maliciously crafted prompts achieved 97-100\% detection rates, with performance varying across multiple artificial intelligence models, including Grok, Gemini, DeepSeek, Claude, Llama, and Cogito, via different API providers such as OpenRouter and TogetherAI. Evidence suggests that although rule-based detectors are highly effective at identifying known patterns, machine learning and LLM components provide the ability to analyze a prompt in context, resulting in a higher detection rate. The current implementation focuses on a single conversational agent with the plan to expand the filtering system to different deployment contexts. Future work will focus on creating an agent-specific filter configuration for each agent, taking into consideration the different risk profiles and interaction behaviors.
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-No Derivative Works 4.0 International License.
Recommended Citation
Stewart, Mikayla, "Mitigating Prompt Injections in LLM Applications: A Detection and Filtering Framework" (2026). EWU Masters Thesis Collection. 1035.
https://dc.ewu.edu/theses/1035