Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

warden

Identity and audit for Python web applications: users, sign-in, invitations, OpenID Connect single sign-on, roles and permissions, API keys, and a tamper-evident audit trail with syslog forwarding.

Status: beta. 0.1.0 is feature complete and in testing; it takes fixes only until its release. Before 1.0 a minor version may break the public API, and every break is named in the changelog with an upgrade note.

warden is built by Cognisn as the shared identity and audit foundation for its products. It is an embedded library, not a service: an application installs it, passes in its database connection pool and configuration, and mounts warden's FastAPI routers wherever it chooses. warden has no user interface; each application builds its own screens against warden's documented HTTP contract.

What it provides

Identity

  • User lifecycle: invite, activate, suspend and deactivate.
  • Password sign-in with TOTP and recovery codes, with Argon2id hashing.
  • Passkeys and security keys (WebAuthn): as a second factor beside TOTP, or a passkey on its own, with a passkey_only sign-in method, an emailed registration link and passkey invitations.
  • Invitations and password reset by single-use, expiring emailed links.
  • OpenID Connect single sign-on: authorisation code with PKCE, pre-provisioned accounts only, and local password sign-in kept as the break-glass path.
  • Access tokens and rotating refresh tokens, with reuse detection and an absolute session lifespan.
  • API keys scoped to a subset of permissions.
  • Roles defined by the application as named sets of its own permissions, with FastAPI dependencies to enforce them.

Audit

  • One recording funnel for warden's own events and the application's.
  • A hash-chained, append-only audit trail, with a verification command.
  • Forwarding to a syslog collector (RFC 5424 over UDP, TCP or TLS) that never slows a request.
  • Filtering and export to CSV or NDJSON.
  • Configurable retention, with signed checkpoints that keep the chain verifiable across purges.
  • Signed anchors of the chain's head, which a SIEM keeps and verification checks the database against.

The audit half works on its own, so an application with its own authentication can still use it.

Requirements

  • Python 3.12 or later.
  • PostgreSQL. warden keeps its tables in a dedicated warden schema with its own migration history.
  • FastAPI and psycopg 3, installed with warden.
  • cognisn-konfig for configuration and secrets, installed with warden.

psycopg needs the PostgreSQL client library, libpq. Install the binary build alongside warden (psycopg[binary]) or provide a system libpq.

Installation

pip install cognisn-warden "psycopg[binary]"

The import name is warden. A pre-release, such as 0.1.0rc1, needs pip install --pre cognisn-warden or the exact version.

An application loads its WardenConfig through konfig, runs warden migrate against its database, passes warden its connection pool, and mounts warden's routers under prefixes it chooses. The client-behaviour guide describes what a client of those routes must do, and the HTTP contract documents every route.

Documentation

Sample console

examples/console is a small sample product that mounts warden's routers in FastAPI and exercises them from a plain HTML and JavaScript console: sign-in with TOTP, single sign-on, invitations and password reset (with an in-memory outbox), administration, API keys, and the audit trail with export, verification, anchors and syslog. It shows how a product integrates warden, using only warden's public surface. It is for local development only, not a deployment template, and it is not part of the published package.

Licence

Licensed under the Apache License, Version 2.0. Copyright 2026 Cognisn Pty Ltd. See NOTICE.

Metadata

Release files for cognisn-warden 0.1.0b18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cognisn-warden 0.1.0b18
File Size Uploaded Provenance Actions
cognisn_warden-0.1.0b18.tar.gz 479.4 kB With provenance Details for cognisn_warden-0.1.0b18.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cognisn-warden 0.1.0b18
File Interpreter ABI Platform Actions
cognisn_warden-0.1.0b18-py3-none-any.whl Python 3 none any Details for cognisn_warden-0.1.0b18-py3-none-any.whl

Total release size: 721.6 kB

Release files / cognisn_warden-0.1.0b18.tar.gz

Download URL cognisn_warden-0.1.0b18.tar.gz
Size 479.4 kB
Tags Source
SHA-256 checksum
How to use checksums
255c5299a13e551e1401e16e90b9c2ddecbc49652ac1bb789ba4f8ea61edbfbd
BLAKE2b-256 checksum
How to use checksums
3338d36b34e5537b5f4e60cd5d8b09cf3274e141c57293bb2fb744e1905a734f
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 8, 2026.

Transparency log

Release files / cognisn_warden-0.1.0b18-py3-none-any.whl

Download URL cognisn_warden-0.1.0b18-py3-none-any.whl
Size 242.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
189e3abf0a95428b223365e069ab4a862b4021590b6f8c346718a2015d38ef0d
BLAKE2b-256 checksum
How to use checksums
9a93c5e9e219389fba0107593c25048a90bae31f190e4aadc3b598f91a8cecc8
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 8, 2026.

Transparency log

Security for cognisn-warden 0.1.0b18

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cognisn_warden-0.1.0b18.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 8, 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