Python-native embedding
Embed NPA directly as a Python library — no HTTP calls, no serialization overhead, no network latency. Pure in-process speed: 200,000+ decisions per second at ~5 µs per evaluation.
Intelligent policy engine. Blazing fast. Python-native. OPA-compatible.
200,000+ decisions per second — 60× less memory than OPA.
Policy engines are the backbone of modern security architectures. Existing solutions like OPA are written in Go, require separate processes, and bring significant overhead. NPA combines the proven Rego language with the flexibility of Python — no language barrier, no foreign binaries, no performance compromises.
Embed NPA directly as a Python library — no HTTP calls, no serialization overhead, no network latency. Pure in-process speed: 200,000+ decisions per second at ~5 µs per evaluation.
While OPA typically uses 20–30 MB RAM, NPA gets by with 0.5 MB peak — even with all policies loaded. More containers on the same cluster, ideal for sidecars and edge scenarios.
NPA implements the complete OPA REST API. Replace existing OPA deployments without changing a single line of client code. All 192+ Rego built-in functions included.
7-page SPA with live metrics, policy editor with syntax highlighting, interactive playground, data browser, bundle management, decision logs and configuration — all out of the box.
TLS 1.2+ enabled by default with automatic certificate generation for development. Session-based auth, security headers (HSTS, X-Content-Type-Options), GZip compression and CORS.
Predictable performance — only ~0.22 µs per additional rule. Even with 100 rules, NPA delivers 32,000+ decisions per second.
Built on FastAPI + uvicorn (ASGI), Typer + Rich CLI, multi-layer caching, plugin system, dual storage (in-memory / SQLite) and full OpenTelemetry + Prometheus observability.
13 CLI commands, Docker-ready, Swagger/ReDoc documentation — everything DevOps teams need. Development, testing, and production workflows fully covered.
Central authorization for all microservices. NPA as sidecar or central policy server — under 1 ms response time.
Pod validation, namespace policies, resource quotas — all defined in Rego and enforced by NPA. Compatible with existing OPA/Gatekeeper policies.
Policy-as-Code in the build process: compliance checks, license validation, security scanning — automated and reproducible.
NPA embedded directly as SDK — 200,000 policy decisions per second without HTTP overhead. Perfect for real-time inference with policy enforcement.
pip install npanpa run
Dashboard: https://localhost:8443
docker run -d -p 8443:8443 npa:latest
Dashboard: https://localhost:8443
Import NPA, load a policy, and call engine.decide() — decisions in ~5 µs, directly in your Python application.
NPA is open source under the GNU General Public License v3.0. Contributions, bug reports and feature requests are welcome.
Git repository: github.com/BLS-ISP/NextPolicyAgent