Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.

Note: This is an unofficial Python SDK and port for Dogwood Policy. Support is provided on a best effort basis with community help.

GitHub Release GitHub Actions Test Workflow Status PyPI - Version Python Wheels Python Versions GitHub last commit PyPI - Status Conda Version License GitHub Downloads (all assets, all releases) PyPI Downloads

Install

pip install dogwood-py

Optional extras:

pip install "dogwood-py[examples]"        # FastAPI and general examples
pip install "dogwood-py[strands]"         # Strands integration and shopping-agent example
pip install "dogwood-py[examples,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:

  1. Build a ServiceSchema and PolicySchema.
  2. Parse and lower policy source into a LoweredPolicySet.
  3. Validate it.
  4. Feed Event values to a stateful Authorizer.

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. After installing the package and optional dependencies, run examples directly:

python -m examples.api_usage

python -m examples.cli

python -m uvicorn examples.fastapi_simple.app:app --host 127.0.0.1 --port 8000

python -m examples.strands_shopping_agent.agent --user alice

Development

make setup
make develop
make test
make docs
make build

Useful targets:

  • make docs-ci installs docs-only dependencies and builds Sphinx HTML docs.
  • make docs-watch serves live-reloading docs at http://127.0.0.1:8001.
  • make perf-test runs 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.dev19

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dogwood-py 0.0.5.dev19
File Size Uploaded
dogwood_py-0.0.5.dev19.tar.gz 40.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for dogwood-py 0.0.5.dev19
File
dogwood_py-0.0.5.dev19-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
dogwood_py-0.0.5.dev19-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.dev19-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
dogwood_py-0.0.5.dev19-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
dogwood_py-0.0.5.dev19-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 28.6 MB

Release files / dogwood_py-0.0.5.dev19.tar.gz

Download URL dogwood_py-0.0.5.dev19.tar.gz
Size 40.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4ad97e335eb110ca18c3bfea43c29426670679848ae4508859cba4026a586a2b
BLAKE2b-256 checksum
How to use checksums
f3b18fa687d52f08a65fd9b1c76e85afaece7b12a8ed852f5211c0506184b197
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 12, 2026.

Transparency log

Release files / dogwood_py-0.0.5.dev19-cp310-abi3-win_amd64.whl

Download URL dogwood_py-0.0.5.dev19-cp310-abi3-win_amd64.whl
Size 5.4 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
10fc10d3cd28cfef4edaa57897b7624b1435ec6ff6c343083b0019da62e09451
BLAKE2b-256 checksum
How to use checksums
cde177cb7146e635359f5f405373008187eabad818cd7e4258d73a0c8951ad82
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 12, 2026.

Transparency log

Release files / dogwood_py-0.0.5.dev19-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL dogwood_py-0.0.5.dev19-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.2 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
502064bc9ab40f548f122b5e6168328a6fc7cb19df4ec21a3fa74636d96bbb29
BLAKE2b-256 checksum
How to use checksums
dfd7d0cbd36fce1a1444610f2e5c796473d8bd9808a060c7b32072f1bd5e27e6
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 12, 2026.

Transparency log

Release files / dogwood_py-0.0.5.dev19-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL dogwood_py-0.0.5.dev19-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 6.0 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
3f7ac9e7e5c0c3970e2825abc06c4450813d377a4d1b093b320480a0f9693882
BLAKE2b-256 checksum
How to use checksums
137c3e881f7bf85a2e183239889142db25f217198d60965db2ba2f430997b1a5
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 12, 2026.

Transparency log

Release files / dogwood_py-0.0.5.dev19-cp310-abi3-macosx_11_0_arm64.whl

Download URL dogwood_py-0.0.5.dev19-cp310-abi3-macosx_11_0_arm64.whl
Size 5.4 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3136a4ff9a895f66c9782a450d335a07c877070aaee92359d7ffe238bbcdd1cb
BLAKE2b-256 checksum
How to use checksums
715f587cfef0613b53f4ed5096822c2dd60194ddf5ae82c2d514a966f1286ec7
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 12, 2026.

Transparency log

Release files / dogwood_py-0.0.5.dev19-cp310-abi3-macosx_10_12_x86_64.whl

Download URL dogwood_py-0.0.5.dev19-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
e5aa72f9136ce5f37ff7bd505a2abb97341e7e79508bbdd01820bc10263d2be6
BLAKE2b-256 checksum
How to use checksums
4fd47bd33e96f11372f668819462b85f950d4c0377fbab47e44e3508cec76e9a
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 12, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page