Rego and OPA
Generated policy you can read, custom policy you can write
The policy repository is plain Rego, not a proprietary format. Permit writes its generated policy into one folder, you write yours into another, and a root policy decides how they combine.
- Generated RBAC, ABAC, and ReBAC policy lives under permit/, and your custom Rego lives under custom/, in as many files and packages as you need.
- By default root.rego allows when either the generated or the custom policy allows. Require both, and custom rules become deny rules.
- Unit test policy with opa test, and debug custom rules with print(), which writes to the PDP logs.
root.rego
package permit.root
import data.permit.custom
import data.permit.policies
default allow := false
# Both must allow: custom rules can now deny
allow {
policies.allow
custom.allow
}



