Veil Armor is an enterprise-grade security framework for Large Language Models (LLMs) that provides multi-layered protection against prompt injections, jailbreaks, PII leakage, and sophisticated attack vectors.
- 100% Attack Detection Rate - Tested against 42 zero-day attack vectors
- Prompt Injection Detection - Real-time detection using Vigil TransformerScanner
- Jailbreak Prevention - 30+ custom regex patterns for bypasses Vigil misses
- PII Protection - Microsoft Presidio integration for sensitive data detection
- Real-time Security API - FastAPI-powered RESTful endpoints
- Kubernetes Ready - Health checks, metrics, and deployment manifests included
- Docker Support - Multi-stage production builds
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Veil Armor API β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Vigil β β Presidio β β Custom β β
β β Scanner β β PII Engine β β Patterns β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β FastAPI Server β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Python 3.10+
- CUDA (optional, for GPU acceleration)
- Docker (optional, for containerized deployment)
git clone https://github.com/0x-Professor/VeilArmor.git
cd veil-armor
python -m venv venv
venv\Scripts\activate # Windows
source venv/bin/activate # Linux/Mac
pip install -r requirements.txt
python -m spacy download en_core_web_lgCreate a .env file:
VEIL_ARMOR_API_KEY=your_secret_api_key_here
GEMINI_API_KEY=your_gemini_key_here # Optional
HF_TOKEN=your_huggingface_token_here # For chatbot modelscd src/veil_armor/api
python server.pyThe API will be available at http://localhost:8000
curl http://localhost:8000/healthcurl -X POST http://localhost:8000/api/v1/check \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key" \
-d '{
"prompt": "Your user input here",
"user_id": "user123",
"check_pii": true,
"check_injection": true
}'{
"safe": true,
"threats_detected": [],
"risk_score": 0.0,
"pii_detected": null,
"sanitized_prompt": null,
"processing_time_ms": 45.23,
"request_id": "req_1234567890"
}- Vigil TransformerScanner (protectai/deberta-v3-base-prompt-injection)
- Confidence threshold: 0.8
- Developer/Admin mode bypasses
- AIM/Machiavellian persona attacks
- Hypothetical/fictional scenario attacks
- Grandma/emotional manipulation exploits
- Translation bypass attempts
- Context manipulation attacks
- Function/tool call injections
- Authority claim impersonation
- Code execution attempts
- Email addresses
- Phone numbers
- Credit card numbers
- Social Security Numbers (SSN)
- Passport numbers
- IP addresses
- Bank account numbers
- IBAN codes
- Driver's license numbers
- Cryptocurrency addresses
# Build
docker build -t veil-armor:latest .
# Run
docker run -d \
--name veil-armor \
-p 8000:8000 \
-e VEIL_ARMOR_API_KEY=your_key \
veil-armor:latestdocker-compose up -dVeil Armor includes a secure chatbot demo:
cd chatbot
pip install -r requirements.txt
# Run secure version (with Veil Armor protection)
streamlit run app_secure.py
# Run unsecure version (for comparison)
streamlit run app_unsecure.py| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Service info |
/health |
GET | Health check |
/ready |
GET | Readiness probe |
/metrics |
GET | Prometheus metrics |
/api/v1/check |
POST | Security analysis |
/api/v1/generate |
POST | Secure LLM generation |
/api/v1/stats |
GET | Real-time statistics |
| Variable | Description | Default |
|---|---|---|
VEIL_ARMOR_API_KEY |
API authentication key | veil_armor_secret_key_12345 |
VEIL_ARMOR_API_URL |
API base URL | http://localhost:8000 |
GEMINI_API_KEY |
Google Gemini API key | - |
HF_TOKEN |
Hugging Face token | - |
veil-armor/
βββ src/
β βββ veil_armor/
β βββ api/
β β βββ server.py # Main API server
β βββ middleware/ # Security middleware
β βββ scanners/ # Detection modules
β βββ security/ # Enterprise security
β βββ utils/ # Utilities
βββ chatbot/
β βββ app_secure.py # Secured chatbot
β βββ app_unsecure.py # Unsecured chatbot
β βββ security_client.py # API client
βββ tests/
β βββ test_zero_day_attacks.py # Attack test suite
βββ kubernetes/
β βββ deployment.yaml # K8s manifests
βββ Dockerfile
βββ docker-compose.yml
βββ requirements.txt
βββ README.md
Run the security test suite:
cd tests
pytest test_zero_day_attacks.py -vExpected: 42/42 tests passing (100% detection rate)
Access Prometheus-compatible metrics at /metrics:
veil_armor_requests_total
veil_armor_requests_blocked
veil_armor_requests_allowed
veil_armor_uptime_seconds
- Always use HTTPS in production
- Rotate API keys regularly
- Enable rate limiting for public endpoints
- Monitor blocked requests for attack patterns
- Keep dependencies updated
Apache 2.0
For enterprise support and custom implementations, contact the development team.
Veil Armor - Protecting your LLM applications from sophisticated attacks.