Dogwood Policy Python SDK#
Python SDK and PyO3 binding for the Dogwood policy language. Dogwood is a policy language for fine-grained authorization decisions that depend on history or patterns of events over time - not just a single request. It adds temporal conditions (since, formerly, once, aggregations) and information providers (computed guardrail facts) on top of Cedar policy syntax, then lowers everything back to Cedar for evaluation. Existing Cedar policies stay valid as-is. For information, read the Dogwood documentation.
Warning
Current Dogwood reference interpreter is not intended for production use; therefore, this Python SDK and PyO3 binding is experimental in nature.
The public API is modeled after the Rust dogwood-language lifecycle:
Build a
ServiceSchemaandPolicySchema.Parse and lower policy source into a
LoweredPolicySet.Validate it.
Feed
Eventvalues to a statefulAuthorizer.
This package uses PyO3/maturin to bind the Rust dogwood-language reference
for schema-backed lowering, validation, and trace replay. The Python SDK also
keeps a temporary pure-Python fallback only for source-tree examples that omit
a full Cedar action schema. Schema-backed workflows require the native
extension.
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. See Strands Agents Integration for the integration API and Strands Shopping Agent for a runnable shopping-agent example.
User Guide