A security system designed to protect AI models from prompt injection attacks and ensure safe data handling.
Python
0
39 commits
updated Oct 17, 2026
A comprehensive security framework for LLM applications, providing content filtering, compliance checking, and prompt safety analysis. MAF acts as a protective layer between your application and LLM services, ensuring safe and compliant interactions.
Content Security
Compliance Checking
LLM Safety
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
.env file with the following variables:HUGGINGFACE_TOKEN=your_token_here
SECRET_KEY=your_secret_key_here
uvicorn app.main:app --reload
maf/
├── app/
│ ├── main.py # FastAPI application entry point
│ ├── core/
│ │ ├── config.py # Configuration settings
│ │ ├── security.py # Security utilities
│ │ └── logging.py # Logging configuration
│ ├── models/
│ │ └── schemas.py # Pydantic models
│ ├── services/
│ │ ├── prompt_checker.py # Prompt injection detection
│ │ ├── sanitizer.py # Input sanitization
│ │ └── validator.py # Return value validation
│ └── api/
│ └── endpoints.py # API endpoints
├── tests/ # Test files
├── logs/ # Application logs
└── requirements.txt # Project dependencies
Once the application is running, visit:
Prompt Injection Detection
Input Sanitization
Return Value Validation
Logging
docker compose up --build -d
The React frontend and FastAPI backend are packaged into one image. FastAPI serves the
built frontend from /app/static with SPA fallback, and the API under /api/v1.
.env needs HUGGINGFACE_TOKEN with read access to the private model repo
yutang718/evyd-defender (EVYD Defender; version-less repo, current weights tagged v4); the other guard models are public. Model
weights are cached in the model_cache volume after the first start. To run a locally
trained checkpoint instead, set MAF_GUARD_MODEL_PATH=/app/trained_models/<dir>
(the ./models directory is mounted there).
./server.sh
# or
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
cd frontend
streamlit run main.py
Prompt Safety Checking
PII Detection Interface
Islamic Compliance System
A security system designed to protect AI models from prompt injection attacks and ensure safe data handling.
Python
0
39 commits
updated Oct 17, 2026
A comprehensive security framework for LLM applications, providing content filtering, compliance checking, and prompt safety analysis. MAF acts as a protective layer between your application and LLM services, ensuring safe and compliant interactions.
Content Security
Compliance Checking
LLM Safety
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
.env file with the following variables:HUGGINGFACE_TOKEN=your_token_here
SECRET_KEY=your_secret_key_here
uvicorn app.main:app --reload
maf/
├── app/
│ ├── main.py # FastAPI application entry point
│ ├── core/
│ │ ├── config.py # Configuration settings
│ │ ├── security.py # Security utilities
│ │ └── logging.py # Logging configuration
│ ├── models/
│ │ └── schemas.py # Pydantic models
│ ├── services/
│ │ ├── prompt_checker.py # Prompt injection detection
│ │ ├── sanitizer.py # Input sanitization
│ │ └── validator.py # Return value validation
│ └── api/
│ └── endpoints.py # API endpoints
├── tests/ # Test files
├── logs/ # Application logs
└── requirements.txt # Project dependencies
Once the application is running, visit:
Prompt Injection Detection
Input Sanitization
Return Value Validation
Logging
docker compose up --build -d
The React frontend and FastAPI backend are packaged into one image. FastAPI serves the
built frontend from /app/static with SPA fallback, and the API under /api/v1.
.env needs HUGGINGFACE_TOKEN with read access to the private model repo
yutang718/evyd-defender (EVYD Defender; version-less repo, current weights tagged v4); the other guard models are public. Model
weights are cached in the model_cache volume after the first start. To run a locally
trained checkpoint instead, set MAF_GUARD_MODEL_PATH=/app/trained_models/<dir>
(the ./models directory is mounted there).
./server.sh
# or
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
cd frontend
streamlit run main.py
Prompt Safety Checking
PII Detection Interface
Islamic Compliance System