Skip to main content

mandate-gate (Python)

The gate core of the decision ledger Applied Identities is building. import mandate_gate. Standard library only; Python 3.11 or later.

The gate classifies a tool call against a hash-pinned class map, extracts the bound argument values, checks authority in the fixed order (Passport first, ledger second; fail closed at M1 and above), asks the ledger through a client the adapter supplies and reads its answers. It opens no connection, holds no credential and never logs an argument value. The contract is SPEC.md at the repository root; every behaviour is a vector in vectors/, run by this implementation and the JavaScript one alike.

import mandate_gate as mg

class_map = mg.load_class_map(open("class_map.json", "rb").read(), pinned_sha256)
gate = mg.Gate(class_map, ledger_client, passport="hook")

g = gate.extract(tool_name, args, passport="granted")
if g["action"] == "govern":
    r = gate.reserve(g, transaction_id)
    ...  # settle or release after the act; escalate and bound_retry around an approval

Tests: PYTHONPATH=src python -m unittest discover -s tests.

Licence: Apache-2.0.

Metadata

Release files for mandate-gate 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 mandate-gate 0.1.0
File Size Uploaded Provenance
mandate_gate-0.1.0.tar.gz 22.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mandate-gate 0.1.0
File Interpreter ABI Platform
mandate_gate-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 44.6 kB

Release files / mandate_gate-0.1.0.tar.gz

Download URL mandate_gate-0.1.0.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
38b4dab2b0cbfcfc500c325118baa1a64b88d56702ca4d54e728ac27e5e8ad8f
BLAKE2b-256 checksum
How to use checksums
73235fe4ce8e0e79f496d6682ba7e7bc427ee8c62b491e08643415d16a18ef85
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 Oct 25, 2026.

Transparency log

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

Download URL mandate_gate-0.1.0-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
123dc1ff809d862ad8286df4b438fe873380f4a6dbd84a05d340e4eed707321c
BLAKE2b-256 checksum
How to use checksums
ac2d9774780d4d0472012eb204f63b1fd0169f9cc3924102b842b05f970ccd90
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 Oct 25, 2026.

Transparency log

Security for mandate-gate 0.1.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 mandate_gate-0.1.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 25, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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