Skip to main content

Mandata

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.evidence)         # → signed 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)
  • TypeScript implementation
  • AP2 / x402 adapter layer
  • Multi-hop delegation (agent → sub-agent mandate weakening)

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.

Metadata

Release files for mandata 0.2.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.2.0
File Size Uploaded Provenance Actions
mandata-0.2.0.tar.gz 18.6 kB Without provenance Details for mandata-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 36.0 kB

Release files / mandata-0.2.0.tar.gz

Download URL mandata-0.2.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7ae229dcc4c7b08b25e5ada5422fd4088404b00a15991febd37f024ca64ad90b
BLAKE2b-256 checksum
How to use checksums
c9522acef47d0a1abaf2166c92edaf1c26fad4b84360b3a029c8ec50c0513b3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

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

Download URL mandata-0.2.0-py3-none-any.whl
Size 17.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
268378198c6fad6dd60dfc35e97cc77d8a75b90eb073bbf4af7cd23e6c1fd816
BLAKE2b-256 checksum
How to use checksums
89eea183fefadc0f7024ebb0da5ea9abb479d562a42753e34db9e3b18d0d4ba1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

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

No provenance found

None of the files in this release were uploaded with provenance metadata.

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