Git Open Policy Agent (OPA) is what you use when rules must be enforced at every commit, merge, and deploy. OPA is an open-source policy engine that lets you define and enforce policies as code, written in Rego. It integrates with Git so you can keep policies versioned, reviewed, and tested alongside application code.
With Git integration, OPA becomes more than a static tool. Policies live in repositories. They are subject to pull requests, code reviews, and CI/CD validation. When someone pushes a change, the pipeline triggers OPA to evaluate it against the rules in the repo. Secure configuration, compliance, resource limits—anything you can express in Rego becomes part of your automated gatekeeping.
Git OPA workflows are fast to set up. Clone your repo, add .rego files to a policy/ directory, connect OPA to your CI pipeline, and start enforcing. Policies can be shared as Git submodules or fetched from remote repos so multiple teams use the same source of truth. Changes to the policy repo are tracked, audited, and rolled back like any other code.
OPA for Git solves common pain points: