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.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 mandata 0.1.0
File Size Uploaded Provenance Actions
mandata-0.1.0.tar.gz 10.8 kB Without provenance Details for mandata-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 21.9 kB

Release files / mandata-0.1.0.tar.gz

Download URL mandata-0.1.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
93a20b0e174185fafb7a2bbc4916f2092a29228bc5c76179b11be2537a04026d
BLAKE2b-256 checksum
How to use checksums
b3a153605fdfeb002ca44d7bcff39ecefdbd945c76cb97aabfee7fb237f807a3
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.1.0-py3-none-any.whl

Download URL mandata-0.1.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8141be5dace948f56ef4680805353675a938d42ce893600d22128d041b888bac
BLAKE2b-256 checksum
How to use checksums
1fd3d86f0bca2398329d95adf1469f9110309a381f33589e0072354d6da9dbc0
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.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.

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