The request hits your API. The gateway checks the token, but the rule is in a policy file, not the code. No hard‑coded logic, no rebuild. The decision comes from Open Policy Agent running as an access proxy in front of every microservice.
A microservices access proxy with OPA enforces authorization at the edge. Each request is evaluated against your policies before it reaches the service. Policies are written in Rego, deployed centrally, and pushed or pulled to the proxies at runtime. This separates business logic from security logic. It reduces errors, speeds changes, and improves auditability.
OPA works as a sidecar or standalone proxy. Integrated with Envoy, NGINX, or custom gateways, it can validate JWTs, check RBAC, ABAC, or custom rules. The proxy intercepts requests, sends input data to OPA, and enforces allow/deny based on the response. Microservices stay simple, focused on their core logic. Sensitive policy changes roll out without service downtime.
Using OPA in a microservices access proxy architecture allows you to: