Skip to main content

dogwood-aws: Python bindings for Dogwood

Python bindings for the Dogwood policy frontend: a PyO3 shell over dogwood-ops, the host-neutral operations the dogwood CLI and @aws/dogwood-wasm share (reports, errors, the live authorizer, input limits, fail-closed rules). This package only converts Python values and maps OpError to dogwood.DogwoodError.

pip install dogwood-aws

Wheels are published for Linux (glibc and musl; x86_64 and aarch64), macOS (x86_64 and arm64) and Windows (x64 and arm64). One abi3 wheel per platform covers CPython >= 3.9. Elsewhere pip builds from the sdist, which needs a Rust toolchain.

import dogwood as dw

schema = dw.mcp_to_cedar_schema(tools)          # str or list of tool dicts
report = dw.validate(policy, schema)             # dict, see the .pyi stubs
auth = dw.DogwoodAuthorizer(policy, schema)
d = auth.is_authorized({"action": "Drupe::Action::SendEmail", "timestamp": 20,
                        "principal": {"type": "Drupe::User", "id": "agent"},
                        "context": {"input": {...}}, "logged": {"input": {...}}})
if not d["allowed"]: ...

Same surface and semantics as @aws/dogwood-wasm, in snake_case. Differences:

  • Errors raise dogwood.DogwoodError; .diagnostic is the same dict as the JS error's .diagnostic.
  • decimal.Decimal maps to a Cedar decimal (exact text); tuple works as a list; bool never becomes a Long; an int outside i64 raises.
  • last_timestamp is an int (no f64 widening needed in Python).
  • Every call releases the GIL; DogwoodAuthorizer is thread-safe (an internal mutex — the engine is Send but not Sync) and the module declares free-threaded support (gil_used = false).
  • One abi3 wheel covers CPython >= 3.9.

Dogwood 1.2 contract

Built against dogwood-language 1.2, which checks events against the schemas at run time:

  • a request's context must match the action's context type (the MCP template now requires context.system.now, a Cedar datetime, given as {"__extn": {"fn": "datetime", "arg": "2026-01-01T00:00:00Z"}});
  • a history event (e.g. a response) whose logged record does not conform to its signature is not recorded: is_authorized raises DogwoodError ("event rejected, not recorded in the history") and leaves the history untouched, and replay lists it in rejected;
  • a .log trace must log callerResource as well as callerPrincipal.

Development

python3 -m venv .venv && .venv/bin/pip install maturin pytest
VIRTUAL_ENV=$PWD/.venv .venv/bin/maturin develop
.venv/bin/python -m pytest crates/dogwood-python/tests
.venv/bin/python crates/dogwood-python/examples/demo.py

pyproject.toml is at the repository root so the package can carry LICENSE, NOTICE and THIRD-PARTY-NOTICES. Generate the last with scripts/third-party-notices.sh (needs cargo-about) before building a distribution; a release fails without it.

CI

.github/workflows/ci.yml runs on every PR and push to main, and daily:

  • build-test: cargo build --locked, generates THIRD-PARTY-NOTICES, builds the abi3 wheel with maturin, runs pytest against the installed wheel on CPython 3.13 and runs examples/demo.py on CPython 3.9 (the oldest supported version) in a digest-pinned python:3.9-slim container;
  • cargo-deny: RustSec advisories, licenses, bans and sources (deny.toml);
  • pip-audit: audits the hash-pinned tools in ci/requirements.txt and ci/test-requirements.txt;
  • secret-scan: scans the full git history for committed credentials with gitleaks (pinned by version and SHA-256 in ci.yml).

To change those tools, edit the .in file next to them and recompile with the command at its top.

Design and releasing

DESIGN.md describes how the bindings work. Releases are published to PyPI by .github/workflows/release.yml when a v* tag is pushed; see RELEASING.md.

Contributing and security

See CONTRIBUTING.md and SECURITY.md.

Metadata

Release files for dogwood-aws 1.2.0

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-aws 1.2.0
File Size Uploaded Provenance Actions
dogwood_aws-1.2.0.tar.gz 70.6 kB With provenance Details for dogwood_aws-1.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for dogwood-aws 1.2.0
File Actions
dogwood_aws-1.2.0-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details for dogwood_aws-1.2.0-cp39-abi3-win_arm64.whl
dogwood_aws-1.2.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for dogwood_aws-1.2.0-cp39-abi3-win_amd64.whl
dogwood_aws-1.2.0-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details for dogwood_aws-1.2.0-cp39-abi3-musllinux_1_2_x86_64.whl
dogwood_aws-1.2.0-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details for dogwood_aws-1.2.0-cp39-abi3-musllinux_1_2_aarch64.whl
dogwood_aws-1.2.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for dogwood_aws-1.2.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
dogwood_aws-1.2.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for dogwood_aws-1.2.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
dogwood_aws-1.2.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for dogwood_aws-1.2.0-cp39-abi3-macosx_11_0_arm64.whl
dogwood_aws-1.2.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for dogwood_aws-1.2.0-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 47.7 MB

Release files / dogwood_aws-1.2.0.tar.gz

Download URL dogwood_aws-1.2.0.tar.gz
Size 70.6 kB
Tags Source
SHA-256 checksum
How to use checksums
53e4c3f6c7833a20dcdf6e4a8045a4ecc11f1e7fa21948a0c065cb2ac3884547
BLAKE2b-256 checksum
How to use checksums
7de6c0560a7a44a166dfe25529e4ffb5e551573aa0e493acc5885903d1681859
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Release files / dogwood_aws-1.2.0-cp39-abi3-win_arm64.whl

Download URL dogwood_aws-1.2.0-cp39-abi3-win_arm64.whl
Size 5.5 MB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
a4e31cd9ed249e744530bc208dfacbb1a5d0249c22791dde579b21c101d2262e
BLAKE2b-256 checksum
How to use checksums
8d41c9169d9fa9899ac78bb86578e4278c52f19fe8ae17de1d76eec0e4d050bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Release files / dogwood_aws-1.2.0-cp39-abi3-win_amd64.whl

Download URL dogwood_aws-1.2.0-cp39-abi3-win_amd64.whl
Size 6.0 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d7dc7da63e345be3d7dbd79e849be625338814a0f6de6a65fda3212adcebe467
BLAKE2b-256 checksum
How to use checksums
a07261a2f47864ccd2fc56850360ce4160ac619975dddaf4ba1925a62d024038
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Release files / dogwood_aws-1.2.0-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL dogwood_aws-1.2.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 6.4 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
b7409763e754ba71b7f0d357ad053e868de5020e2dc417306c5a0544e8972176
BLAKE2b-256 checksum
How to use checksums
f6e08c44bca9bbb953af72965924ff3516876bbdeb04529394f384b9d4bf5c04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Release files / dogwood_aws-1.2.0-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL dogwood_aws-1.2.0-cp39-abi3-musllinux_1_2_aarch64.whl
Size 6.1 MB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
c3912c58bc76250882d46d32bacca311ba6a2bc4a4a2111de3b3baa0ac4ede74
BLAKE2b-256 checksum
How to use checksums
8dd319c7d00b946cc5a26fc9c2dc57a65f10dd289b2ef3c0d458fdde5126ddd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Release files / dogwood_aws-1.2.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL dogwood_aws-1.2.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 6.2 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
2d0c09e71bd9a936cf8eab5201ea7f786b8cbc540e5731cb19b9fa20c98ad8da
BLAKE2b-256 checksum
How to use checksums
397b4acec455bfe89a01704554022613955e71bd0d099810609b4203bcd55af5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Release files / dogwood_aws-1.2.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL dogwood_aws-1.2.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 5.9 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
e80594aab6563f145e961c8d92410233735564df404a6082a49e8f26dc4812b0
BLAKE2b-256 checksum
How to use checksums
5907a73c02ad0140f7ba960322de9c0836b2b78dabac68d669c1d18edb9de802
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Release files / dogwood_aws-1.2.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL dogwood_aws-1.2.0-cp39-abi3-macosx_11_0_arm64.whl
Size 5.6 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0b97b0f63a1604abedf4ded44715b9e89ab6c061a4b85c923b760d1a362b57ba
BLAKE2b-256 checksum
How to use checksums
30f2840878cedd63070e7c0dc6a20b023edb5cff00f0fbf882fde11667222b7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Release files / dogwood_aws-1.2.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL dogwood_aws-1.2.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 5.9 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
d8c213ecb14f032d6adffa7afd0ece0acc72addb96d2fd0b0c2a2b765ab8d960
BLAKE2b-256 checksum
How to use checksums
3ba35541f53c60e40cbf91d7879f632ac4750ac09a37d0bdd07a2f9d783a6dd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Security for dogwood-aws 1.2.0

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 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

Attestation for dogwood_aws-1.2.0.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 Nov 24, 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

1.2.0 This release

9 release files Full provenance

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