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.4.dev16.tar.gz (40.0 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.dev16-cp310-abi3-win_amd64.whl (5.4 MB view details)

Uploaded CPython 3.10+Windows x86-64

dogwood_py-0.0.4.dev16-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.dev16-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.dev16-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.dev16-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.dev16.tar.gz.

File metadata

  • Download URL: dogwood_py-0.0.4.dev16.tar.gz
  • Upload date:
  • Size: 40.0 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.dev16.tar.gz
Algorithm Hash digest
SHA256 7c2164d59b6af622359b17068912d9bce43e5bdbca4e58a702ac41c73e0bf717
MD5 0bb20f82fb36f6a55e30dc8505f879a7
BLAKE2b-256 7e81f58816bba13de3c313cfabbe0cfec984d01e898583ea60e8068dd0b47aa4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dogwood_py-0.0.4.dev16-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 97422506d8ed4faea87667091fdaa9a8bf4d456d6ff3b8d0bf21c656b739d4a1
MD5 d5ba95bffa4f09185b7c163c598f3e04
BLAKE2b-256 2e0fabac19d1c4ad035cf7ff5c6c2445dab418b2f9e8f500c44ce1fb33b6bb99

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dogwood_py-0.0.4.dev16-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e719e255cd6105cfdc04bb56cc3c133001b9cc2ec3c541b86dde4e4d92a5aa65
MD5 0241cee11b5b07270c48a86b878dfb3f
BLAKE2b-256 d0b8f4cc64f9e610e677c5271e29c02c36e9308f663932240b1dc188b2befe57

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dogwood_py-0.0.4.dev16-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c1782e4de21273aeadbe1ccab7c7d58b7a39fae3303aca1fc76c64e6b2d38407
MD5 7ade44e05ec38336ae363b26dec5d437
BLAKE2b-256 51a69013eaadb6e7c3ea0cb09606520dcb40c07b010294aa8eb3f70981804353

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dogwood_py-0.0.4.dev16-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d5651744995643dccd1e3c89e5067b14c930f1e3567f7b8582f360a2d17309b4
MD5 9901140131aea98610abfb98f1a5b684
BLAKE2b-256 7a1321539e3a0c1a9ec22dc0d3c45c3a51312f11ec9e63f2a83e789605ffc8e8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dogwood_py-0.0.4.dev16-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a9522965af1c1fd2b8758c947f8915ba50ef446c852bb9ff1e7738ac2b38dd5e
MD5 785dd744af7872d663c0e0ac5af2169b
BLAKE2b-256 9ce6d2970ce8760b864e9e1fc59d3e1eaf6d954c91befbd1137b5c6b106777e4

See more details on using hashes here.

Provenance

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