Skip to main content

Mandata

OpenSSF Scorecard

The mandate toolkit for agent-initiated payments.

When AI agents hold spending authority, someone must answer: what exactly are they allowed to do — and can you prove it afterward? Mandata is a reference implementation of the bounded-autonomy mandate chain:

principal → agent → credential → transaction → evidence

The problem

Agentic payment protocols (AP2, x402, card-network agent programs) let AI agents initiate real financial transactions. But production systems lack a standard way to:

  • Express mandates — bounded permissions: amounts, payees, time windows, velocity limits
  • Bind credentials — cryptographic proof a transaction was made within mandate
  • Enforce at the gate — deterministic checks before settlement, not logs after
  • Produce evidence — an auditable chain showing every agent action against its mandate

Mandata formalizes all four as a small, dependency-light library.

Quickstart

pip install mandata
from mandata import Mandate, Bounds, enforce

# A principal grants a bounded mandate to an agent
mandate = Mandate(
    principal="user:alice",
    agent="agent:shopping-bot",
    bounds=Bounds(
        max_amount=500.00,          # per transaction
        currency="GBP",
        allowed_payees=["store.example"],
        expires_in_days=30,
        velocity_limit=3,           # max transactions per day
    ),
)

# At transaction time: deterministic enforcement BEFORE settlement
decision = enforce(mandate, payee="store.example", amount=49.99)
assert decision.allowed          # → True
print(decision.check)            # → "WITHIN" (normative MMF check ID)
print(decision.evidence)         # → hash-chained evidence record of the check

Architecture

principal issues mandate ──► credential binds mandate to agent
        │                           │
        ▼                           ▼
  agent proposes transaction ──► mandate gate (enforce())
        │                           │
        ▼                           ▼
   allowed? ──► yes: execute    no: reject
        │                           │
        └───────► evidence record appended (hash-chained audit log)

See docs/architecture.md for the full model, docs/mandate-model.md for the schema, and docs/diagrams.md for the system design diagrams.

Roadmap

  • v0.1 — Mandate model, bounds enforcement, evidence chain (Python)
  • Credential signing (Ed25519) + verification API
  • Revocation registry (mandate kill-switch at transaction speed)
  • AP2 / x402 / LangChain adapter layer
  • Multi-hop delegation (agent → sub-agent mandate weakening)
  • v0.3 — MMF-v0.2: credential-bound gate, chain-wide delegation enforcement, fail-closed registry, canonical evidence hashing, 43 conformance vectors
  • TypeScript implementation (core gate scaffold only — not yet MMF-v0.2 conformant)

Research

This project is the open-source implementation arm of the survey:

Agentic AI in Payments and Financial Transactions: A Survey of Architectures, Safeguards and Open Problems — S.C. Aji, 2026. doi:10.13140/RG.2.2.13674.89288

Contributing

We welcome contributors — see CONTRIBUTING.md. Good entry points are labelled good first issue.

License

Apache-2.0 — see LICENSE.

Demo app

examples/demo_app.py runs a full simulated deployment over real HTTP — a revocation-registry service, a mock payment rail, and an agent whose every proposed payment goes through the gate: signed credentials, sub-agent delegation, x402 intake, compromise attempts, remote revocation, then a full evidence-chain audit. python examples/demo_app.py — stdlib only.

For a shorter single-process walkthrough see examples/end_to_end.py.

Metadata

Release files for mandata 0.3.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 mandata 0.3.0
File Size Uploaded Provenance Actions
mandata-0.3.0.tar.gz 27.2 kB With provenance Details for mandata-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 50.2 kB

Release files / mandata-0.3.0.tar.gz

Download URL mandata-0.3.0.tar.gz
Size 27.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a4a4362987349a48eb7790e99c0021b41c857b6978fa1904ae7a6c7afb685d98
BLAKE2b-256 checksum
How to use checksums
7f8327096498c45441c5360af912b4dc5ecc02d938ff2163d7916272b09cb1a1
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 15, 2026.

Transparency log

Release files / mandata-0.3.0-py3-none-any.whl

Download URL mandata-0.3.0-py3-none-any.whl
Size 23.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd9b19746151d926dae8fd9cf9f97c6cf4b95dbbdddb4bbabd18e3fd8a7a2f7c
BLAKE2b-256 checksum
How to use checksums
cd79be87dec2b4a07daa12d74a0cafcdd2a726cfca838ce2489874e923c358ed
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 15, 2026.

Transparency log

Security for mandata 0.3.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

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

Select from 2 files

Attestation for mandata-0.3.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 Nov 15, 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

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