Skip to main content

AI-powered HTTP security middleware for FastAPI — 100% OWASP detection, quantum-ready

Project description

# Neurawall 🛡

**AI-powered HTTP security middleware for FastAPI.**

100% OWASP detection · 0% false positives · runs locally · quantum-ready.

[![Python](https://img.shields.io/badge/python-3.10+-blue.svg)](https://python.org)

[![PyPI](https://img.shields.io/badge/pypi-neurawall-green.svg)](https://pypi.org/project/neurawall/)

[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)

## Install

pip install neurawall

## Quickstart

from fastapi import FastAPI

from neurawall import NeurawallMiddleware, NeurawallConfig

from neurawall.dashboard import add_dashboard

app = FastAPI()

config = NeurawallConfig(security_enabled=True)

app.add_middleware(NeurawallMiddleware, config=config)

add_dashboard(app)

## Dashboard

http://localhost:8000/dashboard

## Enable Local AI (free, no API key)

ollama pull phi3

config = NeurawallConfig(

security_enabled=True,

ai_enabled=True,

ai_backend="ollama",

ollama_model="phi3",

)

## Benchmark Results

OWASP Top 10: 100% detection, 0% false positives, under 5ms

CSIC 2010 (1000 real requests): 100% detection, 0% false positives

vs ModSecurity: +17.6% better detection, catches prompt injection (ModSecurity: 0%)

CRYSTALS-Kyber-512: 1652x faster than RSA-2048, quantum safe

## What gets blocked

SQL Injection - blocked in under 5ms

XSS - blocked in under 5ms

Path Traversal - blocked in under 5ms

Command Injection - blocked in under 5ms

Prompt Injection - blocked in under 5ms

Rate Abuse - blocked instantly

## Phases

Phase 1 - HTTP interceptor, logging, latency tracking - Ready

Phase 2 - AI anomaly scoring (local Ollama, no cloud) - Ready

Phase 3 - Rules, rate limiter, HMAC signing, JWT - Ready

Phase 4 - Redis smart cache, AI-weighted TTL - Ready

Phase 5 - Post-quantum crypto (Kyber), QML scoring - Scaffold ready

## Phase 5 Quantum

pip install open-quantum-safe pennylane

config = NeurawallConfig(

quantum_enabled=True,

post_quantum_crypto=True,

qml_anomaly_model=True,

)

## Roadmap

- Fine-tune Phi-3 on HTTP attack data

- CRYSTALS-Kyber-512 in real TLS connections

- Neurawall Cloud — hosted dashboard SaaS

- OpenTelemetry metrics export

- CRYSTALS-Dilithium response signing

## License

MIT

Built in Hyderabad, India

GitHub: https://github.com/Rishiprasad17/neurawall

PyPI: https://pypi.org/project/neurawall/

Project details


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.2.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neurawall-0.2.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file neurawall-0.2.0.tar.gz.

File metadata

  • Download URL: neurawall-0.2.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for neurawall-0.2.0.tar.gz
Algorithm Hash digest
SHA256 956ee3bda330eaaaf8bf083fdfd47089ae627f08f2bff08398ee8ebdb2b57f45
MD5 21316ae2f0becdd571381f20cfcbcf66
BLAKE2b-256 e53413b80d4fd2221b7576f1e51c96687f5af75a6609fa228b51a0b1b06f1ff0

See more details on using hashes here.

File details

Details for the file neurawall-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: neurawall-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for neurawall-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00f8184363f32e5e1adb06be8faaa3a652c646a8f3c552dfadb163ca23afc3e3
MD5 f55bf952904b7e445e67c8589b9f5e98
BLAKE2b-256 bfc66ebc47240960e7c3aa9e9609bef7ac91268a5599bcc11c5a05a479e56419

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page