Dogwood Policy Python SDK
Python SDK and PyO3 binding for the Dogwood policy language. Dogwood supports fine-grained authorization decisions that depend on history or patterns of events over time, then lowers policies back to Cedar for evaluation.
For full documentation, see dogwood-py.abhishek-tiwari.com.
⚠️⚠️⚠️ Current Dogwood reference interpreter is not intended for production use; therefore, this Python SDK and PyO3 binding is experimental in nature.
Install
pip install dogwood-py
Optional extras:
pip install "dogwood-py[examples]"
pip install "dogwood-py[strands]"
The package installs as dogwood:
from dogwood import native
assert native.available()
What It Provides
The public API follows the Rust dogwood-language lifecycle:
- Build a
ServiceSchemaandPolicySchema. - Parse and lower policy source into a
LoweredPolicySet. - Validate it.
- Feed
Eventvalues to a statefulAuthorizer.
The native path uses PyO3/maturin to call the Rust Dogwood reference implementation for schema-backed lowering, validation, trace replay, augmented Cedar schema export, and authorization. A temporary pure-Python fallback remains only for limited schema-less examples.
dogwood-py also provides optional Strands Agents support. Dogwood policies can be attached as Strands interventions so tool calls are checked before execution, with typed outcomes such as proceed, deny, guide, confirm, and transform.
Documentation
Dogwood language documentation is available at dogwood-policy.github.io/dogwood.
Examples
Checked-in examples are documented at Examples.
make example
make cli-example
make fastapi-example
make strands-shopping-agent
Development
make setup
make develop
make test
make docs
make build
Useful targets:
make docs-ciinstalls docs-only dependencies and builds Sphinx HTML docs.make docs-watchserves live-reloading docs athttp://127.0.0.1:8001.make perf-testruns the opt-in native-vs-Python replay regression check.
The docs-only Cloudflare Pages build command is:
make docs-ci PYTHON=python
Build output directory:
docs/build/html
Current Scope
Rust-backed operations cover schema-backed lowering, validation, authorization, and trace replay. The Python fallback is temporary and schema-less only. The intended end state is to remove it once the Rust-backed SDK objects cover the same ergonomic surface.
Metadata
Release files for dogwood-py 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dogwood_py-0.0.5.tar.gz | 40.0 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| dogwood_py-0.0.5-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| dogwood_py-0.0.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| dogwood_py-0.0.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| dogwood_py-0.0.5-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
| dogwood_py-0.0.5-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 28.4 MB
Release files / dogwood_py-0.0.5.tar.gz
| Download URL | dogwood_py-0.0.5.tar.gz |
|---|---|
| Size | 40.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
798b31bf0334af94f77222bc5d64ace53cd5ee4ca9b335dca79a85f890982eec
|
|
BLAKE2b-256 checksum How to use checksums |
77b20bb547e2e39b4cca2a08205c15f80294359d7fc098b8b402ee70ece0511b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency logRelease files / dogwood_py-0.0.5-cp310-abi3-win_amd64.whl
| Download URL | dogwood_py-0.0.5-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 5.4 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
a5158b80c45498570d243b4c9eec94f1c21c7d40c03c88b7ab1f2545d810a7df
|
|
BLAKE2b-256 checksum How to use checksums |
d99d34031b32e2a6825065e687e89596b53c5da21b1fa389550712cf9dffe891
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency logRelease files / dogwood_py-0.0.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | dogwood_py-0.0.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 6.1 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
f5221b0c355a0f01095dc7405ba89e45771682044343e19ce5583f935b9070ac
|
|
BLAKE2b-256 checksum How to use checksums |
3acbe60ed34d53ec7e610a2952ab520147cb3fb49d6b5fd1fdc679033eb8b952
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency logRelease files / dogwood_py-0.0.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | dogwood_py-0.0.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 5.9 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
23309eab2292933e09e418131183ed8b0ac56b0152b4ae9c8d067dd4c34be2fc
|
|
BLAKE2b-256 checksum How to use checksums |
e7e8d3bab938281f43afb4ec2a453e2aac3cc98d411f004fded6407ba1dabd6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency logRelease files / dogwood_py-0.0.5-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | dogwood_py-0.0.5-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
478cc06c39a9eec4d11b0b50cf098c03bccad8d1bfcfa6d463df24b7509a0426
|
|
BLAKE2b-256 checksum How to use checksums |
daa3652b222a79e3af021eefd3beb499634ddef950c03dc74939da7c30cc3feb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency logRelease files / dogwood_py-0.0.5-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | dogwood_py-0.0.5-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 5.6 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
3358bd08d7f1f8446e0219070449cd70af9bad4f1d1de04b57f584351b4f3c5e
|
|
BLAKE2b-256 checksum How to use checksums |
e452ad0abe33a1ea7383f30aef5d33ec5da5eae648fe496720c299c939bc575b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency log