Transformer classifierمصنِّف Transformer

Catch prompt injections
before they reach your LLM.
اكشف حقن الأوامر
قبل أن يصل إلى نموذجك اللغوي.

A tiny model that reads a message, whether a user typed it or it came from an email, a document or a web page, and flags text written to hijack your AI. It is small enough to run right here in your browser.نموذج صغير يقرأ الرسالة، سواء كتبها المستخدم أو جاءت من بريد أو مستند أو صفحة ويب، وينبّه إلى النص المكتوب ليسيطر على ذكائك الاصطناعي. وهو صغير بما يكفي ليعمل هنا في متصفحك. دُرّب النموذج على نصوص إنجليزية، فاكتب رسائل الاختبار بالإنجليزية.

13.5Mparametersمعامل
14 MBmodel download (int8)حجم تنزيل النموذج (int8)
…per message, measured in your browserلكل رسالة، مقيسًا في متصفحك
0 / 8000
Not downloadedلم يُنزَّل بعد

The model is 14 MB. It downloads once, then stays in your browser.حجم النموذج 14 ميغابايت. يُنزَّل مرة واحدة، ثم يبقى في متصفحك.

flag ≥ 0.945
0injection scoreدرجة الحقن1
Scoreالدرجة
–
Latencyزمن الاستجابة
–
Tokens
–

Model cardبطاقة النموذج

How the guard compares with the two leading open-source prompt-injection guards.كيف يُقارَن الحارس بأبرز نموذجين مفتوحي المصدر لكشف حقن الأوامر.

Modelالنموذج Parametersالمعاملات Downloadحجم التنزيل Time per messageالزمن لكل رسالة* Runs in your browserيعمل في متصفحك Needs a serverيحتاج خادمًا

* Measured one message at a time on the same 2-thread Colab CPU, with the full-precision version of our model. The int8 version on this page is smaller still; its speed on your own device is shown at the top of the page.قيس رسالةً رسالة على معالج Colab نفسه بخيطين، باستخدام نسخة نموذجنا كاملة الدقة. ونسخة int8 في هذه الصفحة أصغر من ذلك، وسرعتها على جهازك معروضة أعلى الصفحة.

Harmless prompts wrongly blockedأوامر آمنة حُجبت خطأً

lower is betterالأقل أفضل

339 harmless prompts full of words like "ignore", "bypass" or "override" (the NotInject benchmark).339 أمرًا آمنًا مليئة بكلمات مثل "ignore" و"bypass" و"override" (معيار NotInject).

Small and privateصغير ويحفظ الخصوصية

14× fewer parameters and a 52× smaller download than the leading open guards. It runs on your own device: no server, no hosting bill, and your text never leaves your browser.معاملات أقل 14 مرة وحجم تنزيل أصغر 52 مرة من أبرز نماذج الحماية المفتوحة. يعمل على جهازك: بلا خادم، وبلا تكاليف استضافة، ونصّك لا يغادر متصفحك أبدًا.

Rarely in your wayنادرًا ما يعترض طريقك

It wrongly blocks about 2% of tricky harmless prompts, where the big guards block 12% and 43%. A guard that cries wolf gets switched off.يحجب خطأً نحو 2% فقط من الأوامر الآمنة المُربكة، بينما يحجب الحارسان الكبيران 12% و43%. والحارس الذي يُكثر الإنذارات الكاذبة يُطفأ في النهاية.

A first line of defenceخط الدفاع الأول

It's tuned to be cautious. It rarely blocks harmless text, but it can miss attacks written in unfamiliar styles, which is why it's meant as a first layer, not the only one.ضُبط ليكون حذرًا: نادرًا ما يحجب نصًا آمنًا، لكنه قد يفوّت هجمات مكتوبة بأساليب غير مألوفة، ولهذا صُمّم ليكون طبقة أولى لا الطبقة الوحيدة.

Full evaluationالتقييم الكاملevery model on every test setكل نموذج على كل مجموعة اختبار
Modelالنموذج Attacks caught (recall) ↑الهجمات المكتشفة (Recall) ↑ Harmless texts flagged (false-positive rate) ↓نصوص آمنة نُبّه إليها (معدل الإيجابيات الكاذبة) ↓
same sourcesالمصادر نفسها deepset emailsرسائل البريد hand-madeيدوية same sourcesالمصادر نفسها NotInject trickyمُربكة

Recall: the share of real attacks the model flags. False-positive rate: the share of harmless texts it flags. "Same sources" means held-out texts from the six datasets used for training; the other sets come from elsewhere. Thresholds: ours 0.945 (tuned for at most 1% false alarms on validation data), the open guards 0.5 (their default). PIGuard was trained on deepset, and ProtectAI on two of our training sources, so those scores are not fully held out for them. We chose our model after seeing two training runs' test results, so its numbers are slightly optimistic. Its ONNX int8 version gives the same verdict as the full model onRecall: نسبة الهجمات الحقيقية التي ينبّه إليها النموذج. معدل الإيجابيات الكاذبة: نسبة النصوص الآمنة التي ينبّه إليها. و«المصادر نفسها» تعني نصوصًا محجوزة من مجموعات البيانات الست المستخدمة في التدريب، أما المجموعات الأخرى فمن مصادر مختلفة. العتبات: 0.945 لنموذجنا (مضبوطة على ألا تتجاوز الإنذارات الكاذبة 1% في بيانات التحقق)، و0.5 لنموذجي الحماية المفتوحين (قيمتهما الافتراضية). دُرّب PIGuard على deepset، ودُرّب ProtectAI على مصدرين من مصادر تدريبنا، فدرجاتهما هناك ليست محجوزة تمامًا. واخترنا نموذجنا بعد الاطلاع على نتائج اختبار جولتي تدريب، لذا أرقامه متفائلة قليلًا. وتعطي نسخة ONNX int8 الحكمَ نفسه الذي يعطيه النموذج الكامل في 99.6% of the test texts. من نصوص الاختبار.

How it worksكيف يعمل

Three steps, each designed to avoid rewarding a model for memorising dataset style.ثلاث خطوات، صُممت كلٌّ منها كي لا يُكافأ النموذج على حفظ أسلوب مجموعة البيانات.

Explore the architecture, layer by layerاستكشف البنية طبقةً طبقة
  1. 1

    Dataالبيانات

    About 20k texts from six public datasets. Exact and near-duplicates removed, related texts kept on the same side of the split, and whole sources held out for testing.نحو 20 ألف نص من ست مجموعات بيانات عامة. حُذفت النصوص المكررة والمتقاربة جدًا، وبقيت النصوص المترابطة في الجانب نفسه من التقسيم، وحُجزت مصادر كاملة للاختبار.

  2. 2

    Fine-tuneالضبط الدقيق (Fine-tuning)

    ELECTRA-small (14M parameters) trained as benign vs injection with early stopping. The decision threshold is tuned so at most 1% of harmless validation texts are flagged.دُرّب ELECTRA-small (‏14 مليون معامل) على التمييز بين آمن وحقن مع الإيقاف المبكر. وضُبطت عتبة القرار بحيث لا يُنبَّه إلى أكثر من 1% من نصوص التحقق الآمنة.

  3. 3

    Shipالإطلاق

    Exported to ONNX and quantized to int8 (54 → 14 MB). It runs in your browser with transformers.js: no server, and no LLM is called. The demo only runs the guard.صُدّر إلى ONNX وكُمِّم إلى int8 (من 54 إلى 14 ميغابايت). يعمل في متصفحك عبر transformers.js: بلا خادم، ولا يُستدعى أي نموذج لغوي. العرض يشغّل الحارس فقط.