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.
Experience how NPA evaluates a Rego authorization policy in microseconds. Toggle the request input attributes below and watch the decision update in real time.
package authz
default allow := false
# Rule 1: Admins have full access over verified TLS
allow if {
input.tls_verified == true
input.role == "admin"
}
# Rule 2: Developers may read or deploy in dev/staging
allow if {
input.tls_verified == true
input.role == "developer"
input.action == "read"
}
Rule 1 matched: Role "admin" over a verified TLS connection is granted full access to all actions.
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.
Run NPA embedded inside your Python stack, as a standalone container sidecar, or backed by commercial enterprise support.
Direct embedding into FastAPI, Django, Flask, or ML pipelines under GPL-3.0.
Standalone policy server via Docker, Kubernetes sidecar, or NethServer 8.
/v1/data/...)Commercial backing, custom policy engineering, and guaranteed SLAs by BLS-ISP.
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.
Install via pip and launch with the built-in 7-page web dashboard:
pip install npa
npa run --addr 0.0.0.0:8443
# Dashboard: https://localhost:8443
Run as a container with HTTPS enabled by default:
docker run -d -p 8443:8443 npa:latest
curl -sk https://localhost:8443/health
Decisions in ~5 µs directly inside your Python process:
from npa.sdk.sdk import NPA
engine = NPA()
engine.load_policy("authz.rego", policy)
ok = engine.decide("data.authz.allow", {"role": "admin"})
Technical answers on OPA compatibility, performance, memory footprint, and licensing.
/v1/data, /v1/policies, bundles). You can swap out existing OPA instances without changing client code.
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