Text Classification
Keras
English
Azerbaijani
prompt-injection
security
llm-security
document-security
retvec
cnn
tensorflow
fastapi
Eval Results (legacy)
Instructions to use MegrurNiftiyev/MyGuard-Prompt-Injection-Detector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use MegrurNiftiyev/MyGuard-Prompt-Injection-Detector with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://MegrurNiftiyev/MyGuard-Prompt-Injection-Detector") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -58,6 +58,10 @@ model-index:
|
|
| 58 |
|
| 59 |
**MyGuard AI Document Security Gateway ML Service** is a stateless, high-throughput Machine Learning microservice built with **Python 3.10+**, **FastAPI**, **TensorFlow**, and **Google RETVec**. It serves as the dedicated **Layer 2 ML Classifier** within the broader MyGuard AI Document Security infrastructure.
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
As enterprise organizations ingest unstructured documents (PDF, DOCX, PPTX, XLSX, TXT) into Large Language Model (LLM) agents and RAG (Retrieval-Augmented Generation) Knowledge Graphs, adversaries attempt to inject malicious payloads (*Indirect Prompt Injections*, *Jailbreaks*, *System Override Attacks*, and *Data Exfiltration Commands*).
|
| 62 |
|
| 63 |
This microservice analyzes extracted document text, optical OCR text streams, and steganographically hidden text layers, evaluating them through a character-level **RETVec + Conv1D Deep Neural Network**. It operates completely free of external LLM API calls, delivering zero-latency, deterministic threat classification before forwarding suspicious items for downstream LLM evaluation.
|
|
@@ -145,7 +149,9 @@ This microservice uses a specialized **Dual-Output Deep Learning Model** that co
|
|
| 145 |
|
| 146 |
### 🖼️ Deep Learning Model Computational Graph & Architecture Diagram
|
| 147 |
|
| 148 |
-
|
|
|
|
|
|
|
| 149 |
|
| 150 |
#### 🔬 Detailed Layer-by-Layer Architectural Specification
|
| 151 |
|
|
@@ -360,8 +366,6 @@ To make API testing seamless via Swagger UI without requiring complex header set
|
|
| 360 |
> **Interactive Swagger UI Documentation:**
|
| 361 |
> - Live Render Deployment: [`https://myguard-ai-backend.onrender.com/api-docs`](https://myguard-ai-backend.onrender.com/api-docs)
|
| 362 |
|
| 363 |
-

|
| 364 |
-
|
| 365 |
### 1. Liveness & Health Probe (`/health`)
|
| 366 |
|
| 367 |
#### `GET /health`
|
|
|
|
| 58 |
|
| 59 |
**MyGuard AI Document Security Gateway ML Service** is a stateless, high-throughput Machine Learning microservice built with **Python 3.10+**, **FastAPI**, **TensorFlow**, and **Google RETVec**. It serves as the dedicated **Layer 2 ML Classifier** within the broader MyGuard AI Document Security infrastructure.
|
| 60 |
|
| 61 |
+
<p align="center">
|
| 62 |
+
<img src="docs/images/swagger_api_docs.png" alt="MyGuard FastAPI ML Service Swagger API Documentation" width="100%" />
|
| 63 |
+
</p>
|
| 64 |
+
|
| 65 |
As enterprise organizations ingest unstructured documents (PDF, DOCX, PPTX, XLSX, TXT) into Large Language Model (LLM) agents and RAG (Retrieval-Augmented Generation) Knowledge Graphs, adversaries attempt to inject malicious payloads (*Indirect Prompt Injections*, *Jailbreaks*, *System Override Attacks*, and *Data Exfiltration Commands*).
|
| 66 |
|
| 67 |
This microservice analyzes extracted document text, optical OCR text streams, and steganographically hidden text layers, evaluating them through a character-level **RETVec + Conv1D Deep Neural Network**. It operates completely free of external LLM API calls, delivering zero-latency, deterministic threat classification before forwarding suspicious items for downstream LLM evaluation.
|
|
|
|
| 149 |
|
| 150 |
### 🖼️ Deep Learning Model Computational Graph & Architecture Diagram
|
| 151 |
|
| 152 |
+
<p align="center">
|
| 153 |
+
<img src="docs/images/model_architecture.png" alt="MyGuard RETVec + 1D CNN Model Architecture" width="360" />
|
| 154 |
+
</p>
|
| 155 |
|
| 156 |
#### 🔬 Detailed Layer-by-Layer Architectural Specification
|
| 157 |
|
|
|
|
| 366 |
> **Interactive Swagger UI Documentation:**
|
| 367 |
> - Live Render Deployment: [`https://myguard-ai-backend.onrender.com/api-docs`](https://myguard-ai-backend.onrender.com/api-docs)
|
| 368 |
|
|
|
|
|
|
|
| 369 |
### 1. Liveness & Health Probe (`/health`)
|
| 370 |
|
| 371 |
#### `GET /health`
|