ResearchResearch paperLarge Language Models · Retrieval, RAG & Search · Efficiency & Inference1 source · Oct 20, 2026

Context-Aware Prompt Injection Detection via Small Language Models in RAG Pipelines: nokast-secureRAG

We present nokast-secureRAG, a roughly 0.5B-parameter small language model that acts as a semantic firewall between retrieval and generation.

Key points

  • Local Retrieval-Augmented Generation (RAG) systems are vulnerable to indirect prompt injection and retrieval poisoning, where malicious instructions in retrieved content are mistaken for trusted input.
  • It jointly evaluates the user query and retrieved context, classifying the pair as safe, suspicious, or malicious.
  • On a held-out in-distribution test set, the model achieves 0.994 detection recall at a 0.026 false-positive rate and a 0.006 attack-success-rate proxy, outperforming a regex baseline, a public prompt-injection classifier, Llama Guard 3 1B, and its untuned version.
  • Ablations indicate that retrieved context carries the main attack signal, while query-context consistency reduces false positives.

Sources (1)

  • [1]Context-Aware Prompt Injection Detection via Small Language Models in RAG Pipelines: nokast-secureRAG
    arXiv (AI, ML, NLP, CV, robotics, multi-agent) · Oct 20, 03:26 PM
    We present nokast-secureRAG, a roughly 0.5B-parameter small language model that acts as a semantic firewall between retrieval and generation.
    Local Retrieval-Augmented Generation (RAG) systems are vulnerable to indirect prompt injection and retrieval poisoning, where malicious instructions in retrieved content are mistaken for trusted input.

Extractive summary: sentences quoted from the sources.

Before this

  1. Oct 20, 2026Voxtral 3
  2. Oct 20, 2026CovNav: Conformal Prediction-Guided Adaptive Inference for Object Goal Navigation
  3. Oct 20, 2026Do Diffusion LLMs Scale? Testing Mercury 3 + Decide
  4. Oct 19, 2026From Black Box to Controller: Inference-Time Steering of LLM via Feature Amplification
  5. Oct 19, 2026TorchNeuron: running HF models on AWS Trainium is easier than ever
  6. Oct 19, 2026SWIFT: Self-guided Weak-to-strong dIFfusion models via Target extrapolation

Related