Skip to main content

Deterministic policy evaluation layer for dbl-core

Project description

DBL Policy

DBL Policy provides deterministic, tenant-scoped policy evaluation that produces DECISION events only. It does not execute tasks.

Scope

  • Policy decisions derived only from authoritative inputs.
  • No execution, no orchestration, no IO side effects.

Contract

  • docs/dbl_policy_contract.md

Install

pip install dbl-policy

Requires dbl-core>=0.3.0, Python 3.11+.

Usage

from dbl_policy import (
    PolicyContext,
    PolicyDecision,
    PolicyId,
    PolicyVersion,
    TenantId,
    DecisionOutcome,
    decision_to_dbl_event,
)

context = PolicyContext(
    tenant_id=TenantId("tenant-1"),
    inputs={"use_case": "llm-generate"},
)

decision = PolicyDecision(
    outcome=DecisionOutcome.ALLOW,
    reason_code="ok",
    policy_id=PolicyId("example"),
    policy_version=PolicyVersion("1.0.0"),
    tenant_id=context.tenant_id,
)

event = decision_to_dbl_event(decision, correlation_id="c1")

License

MIT License. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbl_policy-0.1.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbl_policy-0.1.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file dbl_policy-0.1.1.tar.gz.

File metadata

  • Download URL: dbl_policy-0.1.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for dbl_policy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 668f17d67e2ad30f24d891d784b754c7db8b103dff7090c9d49b4eb429298aa6
MD5 aa3985c7af683946c05832afbd783af7
BLAKE2b-256 cea61d3b5889a6fc16ceec833a16fb5c5eb02d13421d836b0e1fad4ab79b0a07

See more details on using hashes here.

File details

Details for the file dbl_policy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dbl_policy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for dbl_policy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 36a164ba3c371625c9176e33ae1dac5592a68e6e828279b7a032df04cacebdce
MD5 29c7803fb72a4ec21fe9a6fec5c8bb98
BLAKE2b-256 f7ab42da1283fe94bead91c3a0ad34e4ad33e3550fc5c7e32e3b5ad4dab667bf

See more details on using hashes here.

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