Skip to main content

decern — Python client

PyPI License DOI

Website · Repository · Commands · Issues

Ask whether an action is allowed, and get an answer somebody can check afterwards. Standard library only — no requests, no httpx. Python ≥ 3.11.

uv add decern
# and a server to ask:
cargo install decern-server && decern-serve --trust-proxy
# and, to check the log afterwards:
cargo install decern-cli
from decern import Client

c = Client("http://127.0.0.1:8080")  # optionally: token="…"

d = c.evaluate(
    subject={"type": "Principal", "id": "corp"},
    action="Read",  # or {"name": "Read"}
    resource={"type": "Resource", "id": "claim1"},
)

d.allowed   # True / False
d.reasons   # ids of the policies that decided it, permit or forbid
d.errors    # evaluation failures and server gates (a missing Mission); neither: a default deny

When token is set it is sent as Authorization: Bearer on every request, for a deployment that requires bearer tokens on the evaluation endpoint.

Also on the client: c.pubkey() (the Ed25519 key id the log is signed with) and c.healthy(). A non-2xx response or transport failure raises DecernError with the HTTP status and body, so a denial is distinguishable from a misconfigured endpoint. context reaches the policies wherever the model's schema declares it, apart from keys the server reserves for the caller, the Mission and the challenge. The server sets now from its own clock, and records the accountable owner and any verified caller itself, whatever the context says.

What the server gives you

decern is an AuthZEN 1.0 authorization server whose safety rules are machine-checked over the model's symbolic input space (what that covers), and whose decisions land in an append-only, signed, hash-chained log before they are served — a decision that cannot be recorded is refused, and a third party can verify what was decided without trusting the operator:

decern verify --ledger <file> --pubkey <key>   # the chain and every signature
decern explain --ledger <file> --seq 12        # one decision, in full

Obtain the public key out of band; a key handed over by the party being audited establishes nothing.

Test

cd sdks/python && python -m unittest discover -v

Apache-2.0. Published from CI by OIDC with no stored credential.

Metadata

Release files for decern 0.5.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 decern 0.5.0
File Size Uploaded Provenance Actions
decern-0.5.0.tar.gz 5.7 kB With provenance Details for decern-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for decern 0.5.0
File Interpreter ABI Platform Actions
decern-0.5.0-py3-none-any.whl Python 3 none any Details for decern-0.5.0-py3-none-any.whl

Total release size: 10.4 kB

Release files / decern-0.5.0.tar.gz

Download URL decern-0.5.0.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
04e4263f6fd9d0546abd3f2d9c2393a8e7bdbf6b72827b92778f5848cc00abb1
BLAKE2b-256 checksum
How to use checksums
f5e5061c6e591104fd08b526630e8049720ea4e56585e64219631aceb4301f24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 20, 2026.

Transparency log

Release files / decern-0.5.0-py3-none-any.whl

Download URL decern-0.5.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
405870e11c0e52c1b60427a476187662c7eb90e2389746803a68bfc6cc9fa8d5
BLAKE2b-256 checksum
How to use checksums
61d7dc2b09715d1709aa609301cd027f8de49d3c8da7db924064c790a7236f91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 20, 2026.

Transparency log

Security for decern 0.5.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 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for decern-0.5.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 Oct 20, 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.

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