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.6.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.6.0
File Size Uploaded Provenance Actions
decern-0.6.0.tar.gz 5.7 kB With provenance Details for decern-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 10.4 kB

Release files / decern-0.6.0.tar.gz

Download URL decern-0.6.0.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b89b378d6b765cb8c4ad1c7bc95c4a859af068294b3779df8192b2485f1acace
BLAKE2b-256 checksum
How to use checksums
90af800fe0ede1b8274430b828749940e0a533daea3f622b8c82421f0b476fde
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.6.0-py3-none-any.whl

Download URL decern-0.6.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a1a5fa34b074a2f026093957ac8113c2cb5a4e9342fbcf3c1a396407d7e8a85
BLAKE2b-256 checksum
How to use checksums
6a1fa638d7f101e9d2b992f3b180e48b69b3457d11aad55fdcb71c4fa46b19a8
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.6.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.6.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