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