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.

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.3.dev14.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.3.dev14-cp310-abi3-win_amd64.whl (5.4 MB view details)

Uploaded CPython 3.10+Windows x86-64

dogwood_py-0.0.3.dev14-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.3.dev14-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.3.dev14-cp310-abi3-macosx_11_0_arm64.whl (5.3 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

dogwood_py-0.0.3.dev14-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.3.dev14.tar.gz.

File metadata

  • Download URL: dogwood_py-0.0.3.dev14.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.3.dev14.tar.gz
Algorithm Hash digest
SHA256 a495f9c2dbc49cfcf6ff9aef73cab01571af8912cba8b8c0ff24739f5ccf1ea3
MD5 ebc5ae475135de172dfe33494d31fd7f
BLAKE2b-256 f658257c71b45eba86d200b5e91683e97dff715f20f997bda87249655f8c0fbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for dogwood_py-0.0.3.dev14.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.3.dev14-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for dogwood_py-0.0.3.dev14-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ee3702ea15680d19951553f23419c1595872b5b3445503e8f8faf08fb889df2f
MD5 679b2f356d4cd4b34ac4b3c5f63cca1e
BLAKE2b-256 3a64fbbac46fe0ab786938c7390d84619069687dff0f398a5c20d9b318804ef3

See more details on using hashes here.

Provenance

The following attestation bundles were made for dogwood_py-0.0.3.dev14-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.3.dev14-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dogwood_py-0.0.3.dev14-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 911ebdcc7ab3b52a2d67917bcea5ea8dbf736aa6847196dc66656a80f62bc0ff
MD5 2d91eb916ad826756b40b57b3e0492d7
BLAKE2b-256 d42e5790b5db77b1f946947f311a895a384a1d223995783c2a5f338015726df2

See more details on using hashes here.

Provenance

The following attestation bundles were made for dogwood_py-0.0.3.dev14-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.3.dev14-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dogwood_py-0.0.3.dev14-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 452c19d86f38dc057f4e42516cb66f82dd59156ea864e08b44cfd16cd708e420
MD5 8dacafa667e816f89b84df721aa2bed7
BLAKE2b-256 09d9e4cb8e0f0d1e8af3ff9cdfe334a7a37db47b9548128b23af4c2749207bfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for dogwood_py-0.0.3.dev14-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.3.dev14-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dogwood_py-0.0.3.dev14-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7570ddd16176cc43b226468c53041b06e616f85e82f4363e1a223e8c4d0a3e55
MD5 b533f498281cce1a32537d485cad9952
BLAKE2b-256 0b5f585912f2e9dde2512c683d4f4e85fbe9eabf59f56ebd1e5974628cf3a21d

See more details on using hashes here.

Provenance

The following attestation bundles were made for dogwood_py-0.0.3.dev14-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.3.dev14-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for dogwood_py-0.0.3.dev14-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6ec9a940d402fc64d730910ae210a6f4a52f110d8b9ba5777d457af3de320517
MD5 f7aaf4f1ac20c9d4d4c7d2e9875c9497
BLAKE2b-256 d588b3d1c2dde6814deea8b3198f85350b769a87084b52bd3fa3e2997d474fdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for dogwood_py-0.0.3.dev14-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