NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #505 most downloaded on PyPI
Latest stable
4.12.2
Last release 1 months ago
14 Oct 2026
Ships unpredictably
gaps range from 9 days to 11 months
Some releases are documented
notes for 11 of 19 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
19 releases · first in 2023
Drag across the ruler to compare, or tap a release to open it.
With the new keyword-only release_gil=True, other Python threads run while Cedar validates policies or builds a handle, so asyncio.to_thread keeps an
With the new keyword-only release_gil=True, other Python threads run while Cedar validates policies or builds a handle, so asyncio.to_thread keeps an event loop responsive during those calls (#120). The default, False, holds the GIL for the whole call, as before. These entry points take it:
validate_policiesPolicySet.from_str, PolicySet.from_json_str and PolicySet.from_pstSchema.from_str and Schema.from_json_strEntities.from_json_strWhen another thread is busy, a released call typically waits about sys.getswitchinterval() (5 ms by default) to resume, so releasing pays off for calls that take milliseconds or more. Reading the arguments and building the result still hold the GIL. See the Threads and asyncio Guide (#121). Thanks @kousun12!
is_authorized and is_authorized_batch now say why a request could not be built. A context that Cedar rejects (a JSON null, a float, a record that does
Your coding agent can read these notes before it upgrades. Set up the MCP server →
is_authorized and is_authorized_batch now say why a request could not be built. A context that Cedar rejects (a JSON null, a float, a record that does not match the action's schema) produced the single diagnostic failed to parse schema from request, which hid the cause and named a schema even when none was passed. The diagnostic is now failed to build request: <cause>, for example failed to build request: while parsing context, found a `null`; JSON `null`s are not allowed in Cedar. Diagnostics for a principal, action, or resource that fails to parse, and for entities that fail to parse, carry their cause the same way (#118). Thanks @david-long1!Dropped support for Python 3.9, which reached end-of-life on 2025-10-31 and no longer receives security fixes. requires-python is now >=3.10, so cp39…
policies_to_pst(policies) parses Cedar policy text into typed cedarpy.pst nodes, one frozen dataclass per cedar_policy::pst node kind, so a consumer can pattern-match on real types instead of an untyped tree keyed by string operators (#107). Each closed set Cedar defines is closed in the Python type, so a match over one can be checked for exhaustiveness. Nodes are frozen, slotted, hashable values, and their mapping fields reject mutation. Static policies and unlinked templates only: a residual from is_authorized_partial cannot be represented this way, because PST validates each clause as it is built and rejects any containing an unresolved unknown(...) node. The node set tracks the engine: syntax not yet modelled by cedarpy.pst raises ValueError rather than building an incomplete tree. See the Policy Syntax Tree Guide for the node types and the guarantees. (#108). Thanks @h0rv!
PolicySet.from_pst(nodes) and PolicySet.to_pst() are the round trip, so a policy set can be read as nodes, rewritten, and turned back into a handle the engine authorizes against. policies_to_pst(text) is now PolicySet.from_str(text).to_pst(). from_pst raises TypeError for anything that is not a cedarpy.pst node, and ValueError for nodes that do not form a valid set. Expression nesting is limited to 100 levels in both conversion directions; deeper input raises ValueError. Raising this limit later is backwards compatible; lowering it would be breaking.
pst.entity_uids(node) collects every entity uid named anywhere under a node, for deciding what to load before evaluating. It takes a node, or a mapping or tuple of nodes such as a PolicySet's templates. Anything it cannot walk raises TypeError rather than returning an empty result, so passing a PolicySet handle by mistake cannot look like "this policy names no entities".
Documented that is_authorized_partial exposes an experimental upstream feature: it is built on the cedar-policy crate's partial-eval feature, which Cedar ships outside its semver guarantee and may change or break in any release. The partial authorization guide, README section, docstring, and Rust binding now all carry the marker. No behavior change.
Updated the remaining declared Rust dependencies to their latest patch releases: pyo3 0.27.1 → 0.27.2 (crash fix for Rust 1.92+ builds with debug assertions; no API changes), serde 1.0.228 → 1.0.229, and serde_json 1.0.145 → 1.0.151 (float formatting switched from Ryū to Żmij upstream — output can differ textually while remaining valid; the 60,800-case Cedar corpus passes unchanged). No behavior changes observed across unit, integration, corpus, or benchmark suites.
Removed the unused cedar-policy-cli crate dependency, present since the project's initial scaffold but never referenced from code. Drops 34 transitive crates (clap, miette's terminal-support stack, rustix, …) from Cargo.lock, shrinking build time, audit surface, and the version-resolution coupling its exact =X.Y.Z pin on cedar-policy imposed. No functional change — cedar-policy-formatter (which backs format_policies) remains.
Cedar Policy engine upgraded from v4.8.2 to v4.12.0 (Cedar language version 4.4 → 4.5, adding the extended has operator in JSON policies). No cedarpy API changes: the engine's breaking changes between 4.9 and 4.12 are confined to experimental features cedarpy does not enable (tpe, protobuf, tolerant-ast) and to the then-unused pst module; the partial-eval surface is unchanged. Verified against the upstream v4.12.0 integration corpus (60,800 request cases), including the new JSON-policy-format and JSON-schema-format suites (#106). Thanks @h0rv!
requires-python is now >=3.10, so cp39 wheels are no longer built and pip will not install new cedarpy releases on 3.9; existing releases remain available. Python 3.10 (security-supported until October 2026) through 3.14 remain supported.pyo3 0.27.2 → 0.29.2, fixing GHSA-36hh-v3qg-5jq4 (out-of-bounds read in nth/nth_back on PyList/PyTuple iterators) and GHSA-chgr-c6px-7xpp (missing Sync bound on PyCFunction::new_closure closures). Neither vulnerable path is reachable from cedarpy's API — both alerts had been triaged and dismissed as unreachable — so this is defense-in-depth. No source changes were required; unit, integration, 60,800-case corpus, and benchmark suites pass unchanged (#115). Thanks @swenger!anyhow 1.0.95 → 1.0.104, clearing the RUSTSEC-2026-0190 unsoundness warning in Error::downcast_mut (fixed upstream in 1.0.103).A reusable, pre-parsed Schema handle, completing the handle trio alongside PolicySet and Entities. Parse a schema once with Schema.from_str(cedar_text
Schema handle, completing the handle trio alongside PolicySet and Entities. Parse a schema once with Schema.from_str(cedar_text) or Schema.from_json_str(json_text) and pass the handle to is_authorized, is_authorized_batch, is_authorized_partial, or validate_policies anywhere a schema string is accepted — skipping the per-call parse. The schema parameter widens from str | dict | None to str | dict | Schema | None; existing string/dict callers are unchanged, so this is a pure, opt-in addition. The handle is immutable, releases its memory when the last Python reference is dropped, supports str() (the schema rendered to Cedar schema syntax, whichever format it was constructed from), and raises ValueError at construction on unparseable schemas. On a successful evaluation the result metrics gain a schema_pre_parsed flag (1 for the handle path, 0 otherwise). Mirrors the PolicySet / Entities handle APIs (#103). Thanks @swenger!Cedar policy template linking on the PolicySet handle. PolicySet.from_str already parses templates (policies with ?principal / ?resource slots); they
PolicySet handle. PolicySet.from_str already parses templates (policies with ?principal / ?resource slots); they authorize nothing until linked. policy_set.with_linked_batch(links) links one or more templates and returns a new PolicySet handle (the base is cloned once and left unchanged, mirroring with_added_str), so a batch of links pays a single clone rather than one per link; it is all-or-nothing (any failure raises and no handle is returned). with_linked(template_id, new_id, values) is the single-link convenience over it. Each slot value is a Cedar string ('User::"jane"') or a {"type": ..., "id": ...} dict — the two forms a request principal/resource already accept. A template_id resolves to a template's literal Cedar id first, then to the value of its @id annotation — but prefer the @id, since it is the stable key: the positional id (policy0, …) is reassigned per parse and renumbered by with_added_str, while the @id is invariant (the @id match must be unambiguous; @id is otherwise inert and is not the template's id — matching the Cedar CLI's linking convention). A linked PolicySet is still just a PolicySet, evaluating through is_authorized, is_authorized_batch, and is_authorized_partial; existing callers are untouched, so this is a pure, opt-in addition. The lifecycle is rounded out by templates() (a list of dicts, one per template, with its id, id_annotation, slots, and the links derived from it — each link's id and the values its slots were bound to) and without_linked(link_id) (a new handle with one linked policy removed). Regular template linking works on the pinned engine — no new Cargo feature (#29). Thanks @Iamrodos!Entities handle, mirroring the PolicySet handle. Parse a stable entity graph once with Entities.from_json_str(entities_json, schema=None) and pass the handle to is_authorized, is_authorized_batch, or is_authorized_partial anywhere an entities string/list is accepted — skipping the per-call JSON deserialization and transitive-closure computation. For the common "stable base plus a small per-request delta" pattern, entities.with_added_json_str(delta_json, schema=None) clones the base and parses only the delta, returning a new handle (the base is immutable and reused). The merge is a disjoint union: a delta uid that duplicates a non-identical base uid raises ValueError, as does malformed JSON or a schema violation. The entities parameter widens from str | list to str | list | Entities; existing string/list callers are unchanged, so this is a pure, opt-in addition. The handle supports len() (entity count) and str() (rendered entities JSON), and on a successful evaluation the result metrics gain an entities_pre_parsed flag (1 for the handle path, 0 otherwise). Mirrors the cedar-java / cedar-policy-rb handle APIs (#83). Thanks @Iamrodos!PolicySet.with_added_str(fragment) returns a new PolicySet handle: the compiled base plus the policies parsed from fragment. The base is cloned, not re-parsed — only the (typically small) fragment is parsed — so a caller with a static base and small dynamic per-request fragments avoids re-parsing the base each call. The result is equivalent to authorizing against the concatenated base-plus-fragment text: because Cedar derives a positional PolicyId (policy0, policy1, …) per parse, the fragment's colliding ids are renumbered to follow the base (as concatenation would), and @id annotations are preserved. Raises ValueError on an unparseable fragment (#83).actions/checkout runs with persist-credentials: false. A zizmor workflow-lint job and a repository action-allowlist that requires SHA-pinned actions enforce this on every change. Build provenance now produces a single combined attestation referencing all wheels (actions/attest-build-provenance@v4) instead of one attestation per wheel — relevant to anyone verifying SLSA provenance on the distributions. No change to the published package's code or behavior (#62).is_authorized / is_authorized_batch now accept a structured {"type": ..., "id": ...} dict for principal, action, and resource, in addition to the exis
is_authorized / is_authorized_batch now accept a structured {"type": ..., "id": ...} dict for principal, action, and resource, in addition to the existing Cedar surface-syntax string ('User::"alice"'). The dict form routes through EntityUid::from_json (mirroring cedar-java's JsonEUID) and accepts entity ids containing characters the surface parser rejects as "needs to be normalized" (e.g. embedded newlines). Pure addition — string-form callers are unchanged. Also adds a make corpus-tests target that runs the upstream fuzzer-generated corpus (7,462 files / 59,696 request cases); kept separate from make integration-tests because it takes several minutes (#87. Thanks @geekphilosophy)!PolicySet handle. Parse policies once with PolicySet.from_str(...) (or PolicySet.from_json_str(...) for the Cedar JSON/EST format) and pass the handle to is_authorized, is_authorized_batch, or is_authorized_partial anywhere a policies string is accepted — skipping the re-parse on every call, which is the dominant per-call cost for static policy sets. The policies parameter widens from str to str | PolicySet; passing policies as a string is unchanged, so this is a pure, opt-in addition. The handle is immutable, releases its memory when the last Python reference is dropped, supports len() (policy count) and str() (rendered Cedar text), and raises ValueError at construction on unparseable policies. On a successful evaluation the result metrics gain a policies_pre_parsed flag (1 for the handle path, 0 for the string path). Mirrors the cedar-java / cedar-policy-rb handle APIs. Scoped to policies; reusable Entities / Schema handles are a possible follow-up (#83). Thanks @Iamrodos!is_authorized / is_authorized_batch now raise a KeyError when a request is missing principal, action, or resource, instead of triggering a Rust panic. The missing field name is named in the exception (#87)is_authorized / is_authorized_batch (policy-parse, per-request, and result-serialization errors) are no longer written to stdout unless verbose=True, matching the rest of the authorization path. The errors are still returned in the result's diagnostics (#83)Adds is_authorized_partial(request, policies, entities, schema=None) for Cedar's partial-evaluation authorizer. Request fields that are None or absent
is_authorized_partial(request, policies, entities, schema=None) for Cedar's partial-evaluation authorizer. Request fields that are None or absent are treated as unknowns. The authorizer returns Decision.Allow or Decision.Deny when the unknowns can't change the outcome, and Decision.NoDecision plus residual policies (as Cedar JSON) otherwise; callers re-evaluate the residuals once the unknowns are bound. PartialAuthzResult uses the same decision / correlation_id / diagnostics / metrics structure as AuthzResult, with may_be_determining, must_be_determining, nontrivial_residuals, and unknown_entities added to diagnostics. Unlike is_authorized, an absent or None context is treated as unknown rather than empty. Pass context={} for an explicitly empty context. Note: A partial-eval result is not a final authorization decision. Re-run is_authorized once unknowns are bound; schema type-checking (including action-typed context shapes) is skipped while fields remain unknown. Enables the partial-eval Cargo feature on cedar-policy (#28) — Thanks @swenger!make benchmark-compare now runs N=5 release-mode benchmarks at HEAD and gates on median Δ vs tests/benchmark/results/baseline.json, replacing the prior single pytest-benchmark run with --benchmark-compare-fail=median:5%,mean:15%. The mean threshold has been dropped — a single tail outlier could trip a passing run, and the N=5 median is the stable signal. Per-run JSONs land in tests/benchmark/results/current/ (gitignored). Override the run count via BENCHMARK_RUNS=N (#69)Behavior change (partial revert of 4.8.2). AuthzResult.diagnostics.reasons and ValidationError.policy_id once again surface the parser-generated Polic
AuthzResult.diagnostics.reasons and ValidationError.policy_id once again surface the parser-generated PolicyId (e.g., policy0), restoring the 4.8.1 contract that was relied on for multi-tenant disambiguation. The @id("...") annotation value is now exposed in a parallel map keyed by the parser id: Diagnostics.id_annotations_by_reason and ValidationResult.id_annotations_by_policy_id. Entries are present whenever the policy declares an @id annotation, with the literal annotation value as the map value — so @id("foo") contributes "foo", and @id("") / bare @id (which the Cedar docs define as equivalent to @id("")) contributes "". Policies with no @id annotation are omitted from the map. This keeps the 4.8.2 ergonomics gain (recover the @id label without rebuilding the policy set) while preventing identity collapse when two policies share the same @id (#77)Behavior change. @id("...") annotations on a policy now surface as the human-readable id in AuthzResult.diagnostics.reasons and ValidationError.policy
@id("...") annotations on a policy now surface as the human-readable id in AuthzResult.diagnostics.reasons and ValidationError.policy_id, instead of the auto-generated policy0/policy1/... id. Annotations are inert in Cedar evaluation per the Cedar docs; this is a labeling step on the response surface, not a rename of the underlying PolicyId. An @id with an empty value — either @id("") or value-less @id (which per the Cedar docs is equivalent to @id("")) — falls back to the parser-generated id, since an empty display id is unhelpful for logs and lookups (#29, #74, #75)is_authorized / is_authorized_batch now return Decision.NoDecision with a diagnostic when given an invalid schema, instead of silently discarding the schema and returning a real Allow / Deny. The same path applies in validate_policies (#65)make release now builds and tests a release-mode wheel. The target previously ran maturin build (which defaults to the dev/debug profile) and then ran pytest against whatever cedarpy was currently installed in the venv — neither half tested the wheel that would ship. PyPI artifacts were unaffected (CI already passed --release); this fixes locally-built wheels.Bump pytest 7.4.0 → 9.0.3 — CVE-2025-71176
Dependency update release. No functional or API changes — Cedar Policy engine version is unchanged (still v4.8.2).
pytest 7.4.0 → 9.0.3 — CVE-2025-71176 (#41)wheel 0.40.0 → 0.47.0 — CVE-2026-24049 (#41)time 0.3.37 → 0.3.47 — CVE-2026-25727 (#42)keccak 0.1.5 → 0.1.6 — GHSA-3288-p39f-rqpv (#42)rustix = "~0.37.25" pin; rustix is now governed by the transitive dep graph (#43)pypi-release deployment environment requiring maintainer approval. All wheels and the sdist for this release ship with SLSA build-provenance attestations (#59)Potentially breaking. Updated the Cedar Policy engine to v4.8.2. format_policies() output has changed: the Cedar 4.8 formatter emits dot notation inst
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.