Skip to main content

auth51-governance

The governance-time engine for auth51. It does three things, all pure and stdlib-only:

  1. Classify an action's consequence into an ordered tier (READ < WRITE < SENSITIVE < FINANCIAL < DESTRUCTIVE).
  2. Synthesize a guarded workflow from sampled run observations plus the roster's capability catalog. Guard strength follows the tier, not a single boolean.
  3. Validate a proposed workflow against the tier floor, so the authority can reject a workflow that frees a dangerous capability regardless of who proposed it.

Why it's a separate library

Deriving and registering workflows is a governance-time act, not a runtime one — even though the learning signal (observations) comes from runs. Any client can produce observations: the reference workforce, a custom app on the auth51 client, or the auth51d gateway. They all feed the same engine here, and the authority stays the single source of truth for guard strength by calling validate_workflow at registration.

Kept dependency-light and portable, exactly like auth51-checksum, so both the authority and clients can depend on it without pulling a framework.

The guard ladder

observed (≥ min_support runs) unobserved / under-supported
READ free (no step)
WRITE free (no step)
SENSITIVE ordered (must follow legit predecessors) approval gate
FINANCIAL ordered (value-bound in a later phase) approval gate
DESTRUCTIVE approval gate (never downgraded) approval gate

Two properties over the old binary model: a real ladder (an identity edit ≠ a money movement), and high tiers never auto-free (a DESTRUCTIVE op seen once still needs a human; a FINANCIAL op is never free).

Usage

from auth51_governance import (
    Capability, obs_from_spans, synthesize, validate_workflow, ConsequenceTier,
)

# what the roster CAN do (classified from spec risk/tags, else the name)
caps = [
    Capability.classify("refunder", "RetrieveCustomer"),
    Capability.classify("refunder", "CreatePayout", risk="financial"),
    Capability.classify("admin", "DropDatabase"),
]

# what runs DID (from each run's spans)
runs = [obs_from_spans(spans) for spans in sampled_runs]

wf = synthesize("refund-flow", runs, caps)          # a guarded WorkflowDefinition dict

# at the authority, before registering:
violations = validate_workflow(wf, tier_of=lambda a, act: my_registry_tier(a, act))
assert not violations

Compiles down to the authority's step primitives

synthesize emits the same WorkflowStep shape the authority already enforces: dependencies (ordering), scopes (subset), and an approval-gate step. Each step also carries a tier annotation the authority stores and the value-binding phase will use.

Release files for auth51-governance 0.1.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 auth51-governance 0.1.0
File Size Uploaded
auth51_governance-0.1.0.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for auth51-governance 0.1.0
File Interpreter ABI Platform
auth51_governance-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.1 kB

Release files / auth51_governance-0.1.0.tar.gz

Download URL auth51_governance-0.1.0.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
aebfb42d79e1f6273dbf381d063ce6bd83cd80ce592231cfa1530513d4b5abe8
BLAKE2b-256 checksum
How to use checksums
facc6131a6a658b48b11d32ab8e284941efb24d74053ecab306f18ac1ab8812d
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 Sep 20, 2026.

Transparency log

Release files / auth51_governance-0.1.0-py3-none-any.whl

Download URL auth51_governance-0.1.0-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
459472dbadfab6a73d3c4198218c232138618f0ff4361ed1ef0f9cbe038ee74a
BLAKE2b-256 checksum
How to use checksums
fc5d7cc06b6bb5b2426a3c525308ecf065c0dacb657fbce8dd148e26cfd90f24
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 Sep 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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