Skip to main content

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.

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]"
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:

  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.

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dogwood_py-0.0.4.tar.gz (36.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dogwood_py-0.0.4-cp310-abi3-win_amd64.whl (5.4 MB view details)

Uploaded CPython 3.10+Windows x86-64

dogwood_py-0.0.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

dogwood_py-0.0.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.9 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

dogwood_py-0.0.4-cp310-abi3-macosx_11_0_arm64.whl (5.3 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

dogwood_py-0.0.4-cp310-abi3-macosx_10_12_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file dogwood_py-0.0.4.tar.gz.

File metadata

  • Download URL: dogwood_py-0.0.4.tar.gz
  • Upload date:
  • Size: 36.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dogwood_py-0.0.4.tar.gz
Algorithm Hash digest
SHA256 13a4a4778d0856b019fb29aa1c127bb3a46cf494ce7e812d9a63c6834ac33c86
MD5 72cdd6a0749df820f4adbaf7d7fcb9eb
BLAKE2b-256 ef698d9064ff7d34554505664b174ca063fc6dfa920faa977fee944ad139f4d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for dogwood_py-0.0.4.tar.gz:

Publisher: release.yml on abhishektiwari/dogwood-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dogwood_py-0.0.4-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: dogwood_py-0.0.4-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.4 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dogwood_py-0.0.4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9b04ce9a9d6d317b072fd5be735cfa1905509417b935b877978dbca0d224d6cb
MD5 26173d8dbe32a5404f73c87cb431f22e
BLAKE2b-256 67d50540bbba015e6bdac9c5c1033bb09423f1c2f53eff7ecd9cfddd2166e666

See more details on using hashes here.

Provenance

The following attestation bundles were made for dogwood_py-0.0.4-cp310-abi3-win_amd64.whl:

Publisher: release.yml on abhishektiwari/dogwood-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dogwood_py-0.0.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dogwood_py-0.0.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f7c1ed5c3f90b54a326ca45c0e5fb0ec1c92a3b44edea2f89441aa9570136d45
MD5 f78956a701b7a67fedfc7e5506bed18e
BLAKE2b-256 e8ce84e037e13842b6d9debf838b3cba29963fa3f8c6da1ef06206daba244315

See more details on using hashes here.

Provenance

The following attestation bundles were made for dogwood_py-0.0.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on abhishektiwari/dogwood-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dogwood_py-0.0.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dogwood_py-0.0.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8e99833d3574e5bdf0a14faf3fb155adaa2a332570afc4d743a5e3b0615781e4
MD5 5227dbef93cfb6c9971ebb021de109be
BLAKE2b-256 fd38c8fdafa0622b6000f3ad9f71c4f63a490c8276b2c45245e2c5c63834032f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dogwood_py-0.0.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on abhishektiwari/dogwood-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dogwood_py-0.0.4-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dogwood_py-0.0.4-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7e53e20301acdad2d1f4ab88671667924572108717cb01d79fd297ff1e67c6e2
MD5 4da4b971013229272eca3debe8c983b6
BLAKE2b-256 b6e8d8eab0bd8ab65384bcc931397f1ddbc80e5533e61194aafe145457570bce

See more details on using hashes here.

Provenance

The following attestation bundles were made for dogwood_py-0.0.4-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on abhishektiwari/dogwood-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dogwood_py-0.0.4-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for dogwood_py-0.0.4-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4af10420952d6d7d20ccb41fc959454f8f5d640dfc8a1f38f3eea1228a400ac9
MD5 20e8cb335df2d78ddeb612e8f2cb96a9
BLAKE2b-256 e6d247558e6d0cb6a37e387c50830adc7de5aaa4b3c2ca05c08d615aba92ed16

See more details on using hashes here.

Provenance

The following attestation bundles were made for dogwood_py-0.0.4-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on abhishektiwari/dogwood-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page