The problem
Many prompt-injection defenses are English-centric. Bengali and Banglish inputs can therefore be missed by defenses that do not adequately cover them.
A lightweight prompt-injection detection and defense framework for LLM-integrated web applications, designed to recognize malicious instructions across Bengali, Banglish and English.
Large language models can interpret malicious text as instructions instead of treating it as untrusted data. This creates a prompt-injection risk for applications that connect user content to an LLM.
Many prompt-injection defenses are English-centric. Bengali and Banglish inputs can therefore be missed by defenses that do not adequately cover them.
The project addresses the lack of a Bengali and Banglish-focused labelled resource for training and evaluating a per-input prompt-injection detector.
A compact detector combines high-precision rules with a fine-tuned transformer and a sentence-level sanitisation step.
“An attacker can express an instruction override in Bengali or Banglish while the model still understands it.”
The defense layer needs to understand the language of the input, not just the language most represented in existing datasets.
The framework sits between an application and its language model. It inspects incoming untrusted text before the application forwards it to the model.
Backbone: csebuetnlp/banglishbert. Multi-task classification with a binary injection head and a seven-way category head. Maximum sequence length: 128.
The input is split into sentences. Each sentence is scored, the offending sentence is removed, and the remaining text is forwarded.
Attempts to replace prior instructions.
Attempts to redirect the model's task.
Attempts to reveal protected information.
Attempts to bypass intended constraints.
Hides instructions inside other content.
Instructions embedded in external or supplied content.
The dataset combines Bengali and Banglish generated examples with licence-screened public English sources. Hard negatives are included to test whether benign inputs are mistakenly flagged.
| Language slice | Injection | Benign | Hard negatives |
|---|---|---|---|
| Bengali script | 596 | 587 | 25.3% |
| Banglish | 596 | 578 | 25.7% |
| English | 3,654 | 2,837 | Approx. 2% |
Category-balanced templates expanded across formal Bengali, Dhaka colloquial and heavy code-mix registers.
Dataset splits are grouped by template ID to reduce template overlap between splits.
Bengali and Banglish rows are marked verified: false; independent native-speaker validation remains necessary.
Selected figures from the project evaluation. Each metric should be read with its evaluation setting and limitations.
Embeddings · leave-one-dataset-out (the honest English baseline)
Same-source scores are shown for contrast, not as the headline generalisation result.
Overall script-router accuracy: 98.9%.
| Evaluation | Result | Interpretation |
|---|---|---|
| Leave-one-dataset-out · embeddings | 0.8035 | Honest English baseline |
| Leave-one-dataset-out · TF-IDF | 0.5468 | Cross-dataset result |
| Source-origin probe | 96.5% | Evidence of learnable source artifacts |
| Bengali macro-F1 | 1.000 | Caveat 111 template-derived rows; no measurement headroom |
| Character-perturbation evasion | ~0% bn / banglish | English: 1.7% or less |
These findings are kept visible rather than hidden. They explain why evaluation design matters as much as a headline score.
A source-origin probe reached 96.5% accuracy. Under leave-one-dataset-out evaluation, the embeddings baseline scored 0.8035. The lower cross-dataset result is the figure reported as the honest baseline.
A doubled-verb ending correlated with injection labels in generated data. The artifact was identified and fixed to 0.0% before model training.
A benign Banglish Wi-Fi password request is incorrectly blocked at 0.99. The issue is linked to an imbalance in English hard negatives and is reported as not yet fixed.
All Bengali and Banglish generated rows are unverified. A native-speaker holdout is the highest-priority remaining evaluation work.
Per-source scores of 0.967 and 0.956 are not leave-one-dataset-out results. They must not be presented as LODO metrics.
This is a UI prototype interaction to demonstrate the three possible outcomes. It is not connected to the trained model or live API.
Enter a sample prompt, or try one of the preset examples.
The project is positioned as a labelled detection resource and a per-input detector, rather than a general jailbreak robustness benchmark.
IndicJR evaluates model behaviour under adversarial wrapping across South Asian languages. This project focuses on labelled prompt-injection detection data and a classifier that predicts each input's risk.
Input-side middleware only. Output filtering is explicitly out of scope. The novelty claim is carefully scoped: to the best of the team's knowledge, as of August 2026, no public dataset covers Bengali or Banglish prompt-injection detection.
Daffodil International University · Department of Computer Science and Engineering
Research team · Student ID: 232-15-296
Research team · Student ID: 232-15-336
Sharmin Akter
Assistant Professor
Dr. Sheak Rashed Haider Noori
Professor and Head