AI-powered HTTP security middleware for FastAPI — 100% OWASP detection, quantum-ready
Project description
Guardrail
AI-powered HTTP security middleware for FastAPI.
Fast. Precise. Quantum-ready.
Install
pip install -r requirements.txt
Quickstart
from fastapi import FastAPI
from guardrail import GuardrailMiddleware, GuardrailConfig
app = FastAPI()
config = GuardrailConfig(
ai_enabled=True,
anthropic_api_key="your-key-here",
security_enabled=True,
rate_limit_rpm=60,
)
app.add_middleware(GuardrailMiddleware, config=config)
Phases
| Phase | Feature | Status |
|---|---|---|
| 1 | Core HTTP interceptor, logging, latency tracking | ✅ Ready |
| 2 | AI anomaly detection (Anthropic API) | ✅ Ready |
| 3 | Rate limiting, prompt injection guard, HMAC signing | ✅ Ready |
| 4 | Redis smart cache, AI-weighted TTL | ✅ Ready |
| 5 | Post-quantum crypto (Kyber), QML scoring | 🔬 Stub (install deps) |
Run the demo
export ANTHROPIC_API_KEY=your-key-here
uvicorn guardrail.example_app:app --reload
Test
pytest guardrail/tests/ -v
Phase 5 — Quantum (when ready)
pip install open-quantum-safe pennylane
Then enable in config:
config = GuardrailConfig(
quantum_enabled=True,
post_quantum_crypto=True,
qml_anomaly_model=True,
)
Roadmap
- OpenTelemetry metrics export
- Dashboard UI (FastAPI + HTMX)
- Publish to PyPI as
guardrail-ai - CRYSTALS-Dilithium response signing
- Full QML threat model (PennyLane)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
neurawall-0.1.0.tar.gz
(3.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neurawall-0.1.0.tar.gz.
File metadata
- Download URL: neurawall-0.1.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3441ae208e404f7395028af955270906848fe54b07883b80ee903f056f91ea9f
|
|
| MD5 |
ede54a56d27b7f0a18bf1f66bb9f9071
|
|
| BLAKE2b-256 |
4e04eaed1dfcb8a89312b04c1a747b455d82db50594c7ad08b2dae40768328ee
|
File details
Details for the file neurawall-0.1.0-py3-none-any.whl.
File metadata
- Download URL: neurawall-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ae7880093dff38d325842e05316190e6bd2e95d3a435b8b5fa6c61b7a2c9819
|
|
| MD5 |
16613849baf57bdb1181c58784c4c951
|
|
| BLAKE2b-256 |
2121e785366f8b8f45dd3e35fa2037ec896c57d7200bc152e42cca918d3a08e9
|