Open Policy Agent

Open Policy Agent·open-policy-agent.opa

Open Policy Agent (OPA) is an open source, general-purpose policy engine that enables unified, context-aware policy enforcement across the entire stack.

winget install --id open-policy-agent.opa --exact --source winget

Latest 1.23.0·November 26, 2026

Release Notes

This release contains a mix of new features, performance improvements and bug fixes. Notably:

• Enforcement of bundle structure:now rooted at their .manifest file • Lucene (Solr) target for the Compile API • Hardening of the MySQL Compile API target:use of startswith, endswith and contains built-in functions is rejected • Improvements to the rule indexer • A new json.pointer_escape built-in function

[!NOTE] Help us improve OPA, and fill out the 2026 OPA Community Survey!

Bundles are rooted at their .manifest file (#9459)

Breaking change:OPA now treats the directory containing a bundle's .manifest file as the bundle root, as the bundle documentation describes. Previously, the root depended on the path a bundle was loaded from, which made bundle contents, data placement, and signatures depend on how a path was typed.

• Bundle directories (opa build -b, opa run -b, opa eval -b, opa sign --bundle, ...) are rooted at the directory containing .manifest, even when it is nested below the provided path. Files above it are not part of the bundle. opa build and opa sign warn about policy and data files they leave out, but other commands do not, so keep other .manifest files (e.g., test fixtures) out of directories loaded as bundles. • Bundle tarballs loaded from disk must have .manifest at the root of the archive. opa build always writes it there. • Signatures:file names in .signatures.json are relative to the bundle root, with / separators on every platform. Bundles signed by opa sign <dir> or opa build -b <dir> with older OPA versions must be re-signed, and --exclude-files-verify patterns may need updating. • opa build with multiple bundles places each bundle's files under the path it was given with -b, with a new .manifest at the root. Leading .. segments are replaced with the name of the directory they refer to. Merging fails when two bundles would be placed under the same path. opa sign with multiple bundle paths names files under each bundle's path, like opa build does when merging. A merged opa build output has its own new .manifest, so signatures from multiple separate source bundles cannot be used to verify a merged build. • opa build -t plan and -t wasm replace any plan, or wasm resolvers that were carried in from the input bundles. • .manifest, .signatures.json, and patch.json must be at the bundle root, and only files named exactly .manifest are treated as manifests.

For example, consider this tarball, built without opa build:

$ tar tzf bundle.tar.gz
bundle/.manifest
bundle/data.json
bundle/authz.rego

Previously, opa run -b bundle.tar.gz loaded it with bundle/data.json placed under data.bundle. It is now rejected because .manifest is not at the root of the archive. Running opa build -b bundle/ on the extracted directory produces a bundle rooted at bundle/, with data.json placed at the root of data.

To avoid breaking existing deployments, bundles that the bundle plugin downloads over HTTP or from an OCI registry (and their persisted copies) are still loaded as before, and OPA logs a warning each time a bundle with a misplaced .manifest, .signatures.json, or patch.json is loaded. These bundles will fail to load in a future OPA release. Rebuild them with opa build to place the manifest at the root.

Go API:the bundle.Reader expects bundle-relative descriptor paths, so directory loaders configured with the SlashRooted or Passthrough path formats now have their manifests rejected. When Reader.WithBaseDir is used, module paths include the manifest's directory, which directory loaders report through a RootOffset() string method. Custom loaders that wrap a directory loader should forward RootOffset.

Authored by @philipaconrad

Lucene (Solr) target for the Compile API (#9376)

The Compile API can now translate a policy into a Lucene query for Solr's fq or q, with Accept:application/vnd.opa.lucene.solr+json. The one unknown is the document searched:

# METADATA
# scope:package
# compile:
#   unknowns:[input.doc]
package filters

include if {
    input.doc.owner == input.user
    input.doc.level >= 3
    not input.doc.status == "draft"
}

For the user alice, this compiles to (owner:"alice" AND level:[3 TO *] AND NOT status:"draft"). Multi-valued fields are compared by their elements, as in "a" in input.doc.tags; schemas annotations declare which fields are, and solr_schema.rego generates them from Solr's Schema API. The target can't be combined with others in a multitarget request.

See Lucene filters.

Authored by @srenatus

Compile API:no startswith, endswith or contains for MySQL (#9624)

Breaking change:the MySQL target rejects startswith, endswith and contains, as the SQLite target already did. They were translated to LIKE, which is case- and accent-insensitive in MySQL's default collations, so startswith(input.fruits.name, "APP") also matched apple. Policies using them now fail to compile for application/vnd.opa.sql.mysql+json, and for multitarget requests that include mysql.

Reported by @kianwang0610, authored by @srenatus

Generated bundles

A bundle whose policies are generated, for example from a policy database, can say so in its manifest:

{
  "revision":"...",
  "roots":["authz"],
  "generated":true
}

OPA then parses its policies without source locations. In a benchmark of 20000 generated rules, that cut the memory the compiled policies hold by 40%. Annotations are kept. See the manifest documentation.

Authored by @srenatus

Rule indexing covers more ways of saying "any of these"

The rule index now narrows down rules written with:

• a local iterating a literal set, array or object, in any indexable statement: some g in {"devs", "ops"}; data.groups[g].members[input.subject]; • collection lookups in the operands of and and or: {data.groups.devs.members[input.subject]} or {data.groups.ops.members[input.subject]}; • a collection lookup keyed by any element of a collection:data.groups.devs.members[input.subjects[_]].

Looking up a key in a collection in base data also no longer converts the store's data on every query: in benchmarks of 500 rules gated by group membership, that takes 40-55% off evaluation and partial evaluation where every candidate is evaluated.

See Use indexed statements.

• ast:Index a collection lookup keyed by an element of a collection (#9461) authored by @srenatus • ast:Index collection lookups in and/or operands (#9461) authored by @srenatus • ast:Index expressions over a local iterating a literal (#9461) authored by @srenatus • ast:Keep a rule indexed as "anything" for in with a var member (#9506) authored by @srenatus, reported by @kholia • rego:Compare indexed and unindexed evaluation for every index condition (#9525) authored by @srenatus • topdown:Ask the index candidates whether a rule depends on unknowns (#9570) authored by @srenatus • topdown:Report key conflicts in indexed object comprehensions (#9613) authored by @srenatus

New json.pointer_escape built-in function (#9591)

Escapes a string so it can be used as one reference token of a JSON Pointer, as defined in RFC 6901. The characters ~ and / are replaced with ~0 and ~1. For example:json.pointer_escape(\"a/b~c\") results in \"a~1b~0c\".

Authored by @charlieegan3

Runtime, SDK, Tooling

• cmd(fmt):Honor --drop-v0-imports when formatting stdin (#9619) authored by @FayezBast • cmd/inspect:Show labels metadata with -a (#9504) authored by @srenatus, reported by @humbertoc-silva • cmd:Add --v2-compatible flag (#9251) authored by @sspaink, reported by @johanfylling • cmd:Replace --v2-compatible with --compatible= (#9496) authored by @sspaink • compile:Compile without indices where nothing evaluates (#9605) authored by @srenatus • compile:Release the checking compiler after a rego build (#9604) authored by @srenatus • format:Preserve nested comparison grouping (#9407) authored by @rudraa2005, reported by @alecthomas • plugins/bundle:Activate generated bundles incrementally (#9359) authored by @srenatus • plugins/logs:Copy JSON-shaped values natively for console logs ([#9576](https://github.com/open-policy-agent/opa/p

Installer type: portable

x64—CEAC79FC9F9EE73A27429E8F291F8841D6638768DB2E93BE2BAB277F5FDFAF1C

Details

Homepage
https://www.openpolicyagent.org/
License
Apache-2.0
Publisher
Open Policy Agent
Support
https://github.com/open-policy-agent/opa/issues

Older versions (15)

1.22.4
x64—4CD179B95041AA50C44241324DA3BECF35D0B28DCA92BF10A07F32D002724D5E
1.22.2
x64—EF8BD2E56A329F91192053DA7E4ADFB09FBFDAEE07DE588D6C10B939D581BC64
1.22.0
x64—0C5972EF7B7042B595F92DB690FBB8BD8CF0F9A2782AB802C95C4AA58C1F05E5
1.21.4
x64—EFAD1C0EE4E3150D213F7BABDAFF3440B18B93C7368B465FCA42CDA392947F7C
1.21.3
x64—C8F08EE67544BE8CA47B063F6656091C1DCB4ABA6434C2CD4C5B498B0DCFA115
1.21.2
x64—0089FA7AD8CDEA7FF9E56FF86FA9202462AFB63EF74506E2B547A24B4A987CCB
1.21.1
x64—25406F7C6E147D687FD7FD546F835BAFA160A6242C605EE94A23BA6CD7BCCDCD
1.21.0
x64—1E0E9639673615FA3A6D4974B07E335E44827E377CE7C7BFFBB1A6605A26479B
1.20.2
x64—E2F2E2B735AB98F316171CA47A6B352288CDEB5A616E31AA16335B8934748453
1.20.1
x64—E154E5ECD3DE588E9251FFDAB5F0ACC0EFD1E90C05D9A25B33F7C8A45FBE0D8F
1.19.1
x64—FC932E644652D5634BC0D7A5E5F455DD26EBF5B243682A81EDDF6D387A901E2E
1.18.2
x64—B9022224EE660C87CC35CE957C21C352FA57B267D71FB4E1CE779A38E107C9DF
1.7.1
x64—205F87D0FD1E2673C3A6F9CAF9D9655290E478A93EEB3EF9F211ACDAA214A9CA
1.3.0
x64—FE400211EC06F7FA9769FC32A9F9687BB3973AA916466836E3A92FC6956E8C8B
0.58
x64—DA61C5745C545B64047EFE6C5A730F38F63DFA1D07C29E1F1297FE235A28DDD7