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.
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:
- Build a
ServiceSchemaandPolicySchema. - Parse and lower policy source into a
LoweredPolicySet. - Validate it.
- Feed
Eventvalues to a statefulAuthorizer.
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-ciinstalls docs-only dependencies and builds Sphinx HTML docs.make docs-watchserves live-reloading docs athttp://127.0.0.1:8001.make perf-testruns 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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a495f9c2dbc49cfcf6ff9aef73cab01571af8912cba8b8c0ff24739f5ccf1ea3
|
|
| MD5 |
ebc5ae475135de172dfe33494d31fd7f
|
|
| BLAKE2b-256 |
f658257c71b45eba86d200b5e91683e97dff715f20f997bda87249655f8c0fbd
|
Provenance
The following attestation bundles were made for dogwood_py-0.0.3.dev14.tar.gz:
Publisher:
release.yml on abhishektiwari/dogwood-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dogwood_py-0.0.3.dev14.tar.gz -
Subject digest:
a495f9c2dbc49cfcf6ff9aef73cab01571af8912cba8b8c0ff24739f5ccf1ea3 - Sigstore transparency entry: 2398045327
- Sigstore integration time:
-
Permalink:
abhishektiwari/dogwood-py@0c3f56acb4ce44256723a5460823c2ded28476c1 -
Branch / Tag:
refs/pull/5/merge - Owner: https://github.com/abhishektiwari
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0c3f56acb4ce44256723a5460823c2ded28476c1 -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file dogwood_py-0.0.3.dev14-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: dogwood_py-0.0.3.dev14-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee3702ea15680d19951553f23419c1595872b5b3445503e8f8faf08fb889df2f
|
|
| MD5 |
679b2f356d4cd4b34ac4b3c5f63cca1e
|
|
| BLAKE2b-256 |
3a64fbbac46fe0ab786938c7390d84619069687dff0f398a5c20d9b318804ef3
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dogwood_py-0.0.3.dev14-cp310-abi3-win_amd64.whl -
Subject digest:
ee3702ea15680d19951553f23419c1595872b5b3445503e8f8faf08fb889df2f - Sigstore transparency entry: 2398045840
- Sigstore integration time:
-
Permalink:
abhishektiwari/dogwood-py@0c3f56acb4ce44256723a5460823c2ded28476c1 -
Branch / Tag:
refs/pull/5/merge - Owner: https://github.com/abhishektiwari
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0c3f56acb4ce44256723a5460823c2ded28476c1 -
Trigger Event:
pull_request
-
Statement type:
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
- Download URL: dogwood_py-0.0.3.dev14-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 6.1 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
911ebdcc7ab3b52a2d67917bcea5ea8dbf736aa6847196dc66656a80f62bc0ff
|
|
| MD5 |
2d91eb916ad826756b40b57b3e0492d7
|
|
| BLAKE2b-256 |
d42e5790b5db77b1f946947f311a895a384a1d223995783c2a5f338015726df2
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dogwood_py-0.0.3.dev14-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
911ebdcc7ab3b52a2d67917bcea5ea8dbf736aa6847196dc66656a80f62bc0ff - Sigstore transparency entry: 2398046902
- Sigstore integration time:
-
Permalink:
abhishektiwari/dogwood-py@0c3f56acb4ce44256723a5460823c2ded28476c1 -
Branch / Tag:
refs/pull/5/merge - Owner: https://github.com/abhishektiwari
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0c3f56acb4ce44256723a5460823c2ded28476c1 -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file dogwood_py-0.0.3.dev14-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: dogwood_py-0.0.3.dev14-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 5.9 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
452c19d86f38dc057f4e42516cb66f82dd59156ea864e08b44cfd16cd708e420
|
|
| MD5 |
8dacafa667e816f89b84df721aa2bed7
|
|
| BLAKE2b-256 |
09d9e4cb8e0f0d1e8af3ff9cdfe334a7a37db47b9548128b23af4c2749207bfe
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dogwood_py-0.0.3.dev14-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
452c19d86f38dc057f4e42516cb66f82dd59156ea864e08b44cfd16cd708e420 - Sigstore transparency entry: 2398046085
- Sigstore integration time:
-
Permalink:
abhishektiwari/dogwood-py@0c3f56acb4ce44256723a5460823c2ded28476c1 -
Branch / Tag:
refs/pull/5/merge - Owner: https://github.com/abhishektiwari
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0c3f56acb4ce44256723a5460823c2ded28476c1 -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file dogwood_py-0.0.3.dev14-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: dogwood_py-0.0.3.dev14-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7570ddd16176cc43b226468c53041b06e616f85e82f4363e1a223e8c4d0a3e55
|
|
| MD5 |
b533f498281cce1a32537d485cad9952
|
|
| BLAKE2b-256 |
0b5f585912f2e9dde2512c683d4f4e85fbe9eabf59f56ebd1e5974628cf3a21d
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dogwood_py-0.0.3.dev14-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
7570ddd16176cc43b226468c53041b06e616f85e82f4363e1a223e8c4d0a3e55 - Sigstore transparency entry: 2398046350
- Sigstore integration time:
-
Permalink:
abhishektiwari/dogwood-py@0c3f56acb4ce44256723a5460823c2ded28476c1 -
Branch / Tag:
refs/pull/5/merge - Owner: https://github.com/abhishektiwari
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0c3f56acb4ce44256723a5460823c2ded28476c1 -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file dogwood_py-0.0.3.dev14-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: dogwood_py-0.0.3.dev14-cp310-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 5.6 MB
- Tags: CPython 3.10+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ec9a940d402fc64d730910ae210a6f4a52f110d8b9ba5777d457af3de320517
|
|
| MD5 |
f7aaf4f1ac20c9d4d4c7d2e9875c9497
|
|
| BLAKE2b-256 |
d588b3d1c2dde6814deea8b3198f85350b769a87084b52bd3fa3e2997d474fdf
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dogwood_py-0.0.3.dev14-cp310-abi3-macosx_10_12_x86_64.whl -
Subject digest:
6ec9a940d402fc64d730910ae210a6f4a52f110d8b9ba5777d457af3de320517 - Sigstore transparency entry: 2398045483
- Sigstore integration time:
-
Permalink:
abhishektiwari/dogwood-py@0c3f56acb4ce44256723a5460823c2ded28476c1 -
Branch / Tag:
refs/pull/5/merge - Owner: https://github.com/abhishektiwari
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0c3f56acb4ce44256723a5460823c2ded28476c1 -
Trigger Event:
pull_request
-
Statement type: