
Fine-Tuning Prompt Injection Detector: Five Rounds, Four Failures and Gates Against Regression
AGIMA technical director Andrey Nepryakhin details the challenges of adapting an open-source GLiNER-based prompt injection detector for Russian corporate traffic. The system processes nearly one million requests monthly from eighty employees using agentic tools. Five fine-tuning rounds using LoRA adapters on microsoft/mdeberta-v3-base were conducted, yet only the second round reached production. Failures stemmed from regression on previously fixed attacks, imbalanced negative samples, and reliance on rule-based signals instead of the model. The team introduced cumulative corpora, person-based splits, and ablation checks against the base model to prevent silent rollbacks. A gradient mass rule limits any single phenomenon to 10-20 percent of training data to avoid precision or recall collapse.
HabrSep 1, 2026Translated from Russian