The request hits your desk: enforce strict isolation between resources in a multi-tenant system. No excuses. No leaks. The clock is ticking.
Open Policy Agent (OPA) with domain-based resource separation is the fastest, most reliable way to solve this without tearing apart your stack. Instead of scattering access checks through code, OPA centralizes policies, making them clear, testable, and easy to enforce at scale.
Domain-based resource separation means each tenant, customer, or business unit is treated as its own domain with hard boundaries. Policies must inspect the domain of the request and match it against the domain of the resource. If they differ, access is denied—no matter who’s making the call.
With OPA, these rules are defined in Rego, OPA’s policy language. You load metadata about domains, resources, and relationships into OPA’s data store. Then you craft a policy that enforces separation at the most granular level your architecture supports. The policy runs close to your services—either sidecar, library, or centralized API—so requests are filtered before they touch sensitive data.
Example Rego snippet for domain separation: