Immutability in Open Policy Agent (OPA) is not a feature—it’s the spine of trust in systems where decisions must remain fixed once made. OPA is a general-purpose policy engine. It evaluates rules in Rego, its declarative language, to grant or deny actions. But without immutability, policies risk silent drift. Drift means policy logic can change between runs, breaking guarantees and introducing security gaps.
Immutable policies in OPA are locked against modification after deployment. This ensures compliance, stability, and predictable enforcement. In practice, immutability can mean storing policy bundles in versioned artifacts, verifying their signatures, and loading them into OPA with checksum validation. Once loaded, no runtime edits can occur. Every evaluation uses the exact same code, producing the same result for the same input, every time.
This matters in regulated environments. Auditors want proof that the policy used in production is the same as the one that passed review and testing. With immutability, the code is frozen, and every decision OPA makes can be traced to a known, approved commit. It’s not just security—it’s operational discipline.