Eastern Washington University
Mitigating Prompt Injections in LLM Applications: A Detection and Filtering Framework
Abstract
dc:description.abstractAs 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.
Degree
thesis:*- Name thesis:degree_name
- Master of Science (MS) in Computer Science
- Level thesis:degree_level
- Thesis: EWU Only
- Discipline thesis:degree_discipline
- Computer Science and Electrical Engineering
Author and committee
dc:creator, dc:contributor.*- Author dc:creator
-
- Stewart, Mikayla
- Contributors dc:contributor
-
- Sanmeet Kaur
- Chris Cain
- Lynnae Daniels
Subjects
dc:subject × 5Rights
dc:rights- Statement dc:rights
-
- Access restricted for 2 years to EWU users with an active EWU NetID
- Licence dc:rights.license
Identifiers
dc:identifier.*- Repository record dc:identifier
- https://dc.ewu.edu/theses/1035