The researcher developed a three-tier filter designed to detect prompt injection attacks in large language models (LLMs). The system operates by analyzing user requests before they reach the main model, returning a decision to either allow or block the input.
The filter utilizes a cascade architecture to optimize performance. The first tier employs TF-IDF features and logistic regression, while the second tier uses multilingual-E5-small embeddings and logistic regression. A third tier provides additional analysis for complex cases.
The training dataset comprised 6,000 requests, including 3,000 potential attacks and 3,000 benign queries. After ten test runs, 1,964 attacks were classified as successful, resulting in a final modeling set of 4,964 entries. The system was evaluated using FNR and FPR metrics.
To ensure statistical reliability, the author applied the Learn then Test (LTT) methodology. This approach allows for setting a target risk level (alpha) and a maximum probability of calibration failure (delta), providing a formal certificate for the filter's configuration.
Tests on fresh data showed that while the third tier reduced the number of missed attacks, it did not guarantee meeting the target FNR. For instance, in one configuration, the full cascade reduced missed attacks from 102 to 30, though the resulting FNR remained at 8.8%.





