Model card
For developers building LLM-based applications, securing the prompt layer is becoming as critical as the model logic itself. DeBERTa-v3-base-prompt-injection-v2 is a specialized text classification model designed to detect adversarial prompt injection attempts before they reach your core reasoning engine. Built on the DeBERTa-v3 architecture, it offers a highly efficient balance between classification accuracy and inference latency, making it suitable for real-time middleware integration. Unlike general-purpose safety filters, this model is fine-tuned specifically to identify the linguistic patterns characteristic of injection attacks. It integrates seamlessly into existing Hugging Face transformer pipelines, allowing you to implement a robust defensive layer within your existing API workflows. Whether you are deploying an autonomous agent or a customer-facing chatbot, this model serves as a lightweight, high-performance gatekeeper to mitigate the risk of unauthorized instruction overrides.
Model files and versions
Download this model
We recommend using the ModelScope CLI or SDK. Install ModelScope first, then choose a full snapshot, single file, SDK or Git LFS workflow.
protectai/deberta-v3-base-prompt-injection-v2Install the CLI and SDK dependency before downloading.
pip install modelscopeDownload the complete weights, configuration and model card.
modelscope download --model protectai/deberta-v3-base-prompt-injection-v2README.md is used as an example; replace it with another repository file when needed.
modelscope download --model protectai/deberta-v3-base-prompt-injection-v2 README.md --local_dir ./dirUseful in Python projects and automation scripts.
from modelscope import snapshot_download
model_dir = snapshot_download('protectai/deberta-v3-base-prompt-injection-v2')Make sure Git LFS is installed correctly.
git lfs install
git clone https://www.modelscope.cn/protectai/deberta-v3-base-prompt-injection-v2.gitFetch the repository structure first, then pull large files when needed.
GIT_LFS_SKIP_SMUDGE=1 git clone https://www.modelscope.cn/protectai/deberta-v3-base-prompt-injection-v2.gitHow to use
- 01Step 1
Read the model card and source information.
- 02Step 2
Start with a small, non-sensitive evaluation.
- 03Step 3
Review quality, licensing and usage limits.
- 04Step 4
Adopt it only after validation.
Discussions
Use this space to keep checking source information, usage experience and maintenance status.
Open source page