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.

The Python SDK includes a PolicyEnforcer wrapper with mode="enforce" and mode="log_only" for rollout and audit behavior. Dogwood still evaluates the policy; the SDK mode controls whether a denied decision blocks the operation or is reported as would_have_denied.

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.

Strands integrations use the same SDK-level enforce and log_only modes on top of the Rust Dogwood policy decision.

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.12.dev38

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.12.dev38
File Size Uploaded Provenance Actions
dogwood_py-0.0.12.dev38.tar.gz 42.6 kB With provenance Details for dogwood_py-0.0.12.dev38.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for dogwood-py 0.0.12.dev38
File Actions
dogwood_py-0.0.12.dev38-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for dogwood_py-0.0.12.dev38-cp310-abi3-win_amd64.whl
dogwood_py-0.0.12.dev38-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for dogwood_py-0.0.12.dev38-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
dogwood_py-0.0.12.dev38-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for dogwood_py-0.0.12.dev38-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
dogwood_py-0.0.12.dev38-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for dogwood_py-0.0.12.dev38-cp310-abi3-macosx_11_0_arm64.whl
dogwood_py-0.0.12.dev38-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for dogwood_py-0.0.12.dev38-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 28.6 MB

Release files / dogwood_py-0.0.12.dev38.tar.gz

Download URL dogwood_py-0.0.12.dev38.tar.gz
Size 42.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f5868b063ec3ab2ab6cff02e799302295e719e93873f87a5cdd2d053d08c8377
BLAKE2b-256 checksum
How to use checksums
ba2586d59cae8143939a25a61e7f80287b64204912644460aed52bcba0b7844f
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 Oct 17, 2026.

Transparency log

Release files / dogwood_py-0.0.12.dev38-cp310-abi3-win_amd64.whl

Download URL dogwood_py-0.0.12.dev38-cp310-abi3-win_amd64.whl
Size 5.4 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e1f5fdf26a750f2a1d9173c995e4547aaf3782bab85c82b5581daeb83113e306
BLAKE2b-256 checksum
How to use checksums
9df95cf9a9604b1005da16d664ab18ccb3a83e9ef143cab39ddaa9ab6232d136
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 Oct 17, 2026.

Transparency log

Release files / dogwood_py-0.0.12.dev38-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL dogwood_py-0.0.12.dev38-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
9b6e3e7890d2442ddcc96ead3ca17fb77a47be949223776e7b28f7f3fba08dd8
BLAKE2b-256 checksum
How to use checksums
72f5c24fb6567c68f6248ac5c0bcb3a00b2364987d538b7ef8f074e676f0c9a2
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 Oct 17, 2026.

Transparency log

Release files / dogwood_py-0.0.12.dev38-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL dogwood_py-0.0.12.dev38-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
d9c0d6d043d7319d4a4a1fb764440ef341a9a3e95fe974a21335440681c47292
BLAKE2b-256 checksum
How to use checksums
1cd394a252ef353fda45684e88735148a735c120dfec4691b9fa61d1a107feb4
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 Oct 17, 2026.

Transparency log

Release files / dogwood_py-0.0.12.dev38-cp310-abi3-macosx_11_0_arm64.whl

Download URL dogwood_py-0.0.12.dev38-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
78f61b9cb8ed47a037250d367602d0240e402abd5698dcf44d646ae55f062321
BLAKE2b-256 checksum
How to use checksums
6dcb120e653c12126ccd5361f494f143c210109ecc3dcabacbad529abf9232b1
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 Oct 17, 2026.

Transparency log

Release files / dogwood_py-0.0.12.dev38-cp310-abi3-macosx_10_12_x86_64.whl

Download URL dogwood_py-0.0.12.dev38-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
e48d605fee49e684ca9f608ea243854255350ce930125986aafb95a75e72a42d
BLAKE2b-256 checksum
How to use checksums
fad3e123a438846f7f7f8cbac8c3a5aad54dc635364b2943270b2b9c8df36472
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 Oct 17, 2026.

Transparency log

Security for dogwood-py 0.0.12.dev38

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for dogwood_py-0.0.12.dev38.tar.gz

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 Oct 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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