Skip to main content

mintid-agent

The MintID agent client for Python: the agent runtime's side of an agent credential. An agent credential proves that a person, verified at an issuer, delegated this agent to pay this kind of counterparty within stated bounds, and nothing about who that person is. The client obtains the credential from an agent offer, keeps its witnesses current, answers a seller's identity requirement inside an x402 payment flow, and refuses, before anything is sent or paid, whatever the delegation does not cover.

It carries no cryptography of its own: proofs come from the MintID holder library (mintid-proof-core), signatures from a signer you inject.

Where it fits

MintID is a network for verifiable, human-backed identity. Accepted issuers verify people and issue the credentials; the chain publishes their status roots, their bonds and the registries; each verifier decides on its own service. MintID itself issues nothing, certifies nothing and verifies nobody.

The agent client runs in your own infrastructure, and its keys never leave it: the credential's private bytes go only to the credential store you inject (encryption at rest is yours), and the request-signing key stays behind the signer you inject. The operator who mints the agent, not the agent, decides the delegation.

Install

pip install mintid-agent              # Python 3.12 or later
pip install "mintid-agent[ed25519]"   # with the software Ed25519 signer

It depends on mintid-proof-core, which compiles the Rust proof core in; where no wheel matches your platform, pip builds it from source with a Rust toolchain. Version 0.6.0 (with mintid-proof-core 0.5.4 or later 0.5), published from the main repository, https://gitlab.com/mintid/mintid (sdk/python/mintid-agent).

New in 0.6. A refusal that carries the relying party's onboarding route (bIP-0002 §3.10) comes back from pay as a RefusedWithOnboarding instead of raising — for a terminal identity rejection and for a policy the credential cannot satisfy (nothing presented, nothing paid); a malformed object is ignored and the refusal raises as before. Where no vendor sends the route, nothing changes. The network registry's production profile gains network_page and p2p.

New in 0.5. The split mint, for a principal's holder and an agent runtime in different places: mint_token runs the token step beside the principal and returns a MintMaterial that carries nothing of the principal; AgentClient.complete_issuance (and complete_renewal) completes it in the runtime. AgentClient.can_satisfy says whether the credential can satisfy a claim policy, with nothing requested or sent. The requester side of the agent-to-agent handshake ships here as mintid_agent.handshake. Additive: issue_from_offer and renew behave as before.

New in 0.4. Network profiles: MINTID_NETWORK=testnet (or network="testnet") gives the kill switch the relay and the node of the public testnet from the network registry mintid-proof-core carries; AgentClient.endpoint(role) names any of its endpoints. MINTID_RELAY_URL, MINTID_CHAIN_RPC and MINTID_TESTNET_* win when set; an unknown profile fails naming the valid ones. Additive: without a profile nothing changes.

New in 0.3. Agent profile v2 offers (mintid_agent_v2, MINT-479): the client redeems them, the principal proves the issuer's age threshold when the mint challenge asks one, and self-revocation reads the issuer's agent_v2 anchoring. Additive: agent v1 offers are unchanged.

Upgrading from 0.1. Two behaviour changes. The holder checks every challenge's signature before it presents: give AgentClient a source of verifiers' request keys, verifiers= (ProvenVerifierKeys over a proven chain read, or StaticVerifierKeys of records you pinned); without one, or for an unsigned or wrongly signed challenge, present raises ChallengeRefused and nothing is sent or paid. And refresh().usable is true only once a finalised root anchors every scope value of the delegation (agent.scope_anchored), so a new agent no longer presents into scope_axis_unprovable: poll refresh() until usable, as below.

Example

import time

from mintid_agent import AgentClient
from proof_core.holder import urllib_transport

# offer: the agent offer the operator made; principal: the principal's
# identity credential (a proof_core.holder.Holder); store: your CredentialStore.
# verifiers: where the holder reads verifiers' request keys (ProvenVerifierKeys
# over a proven chain read, or StaticVerifierKeys of records you pinned).
agent = AgentClient.issue_from_offer(
    offer, principal, transport=urllib_transport(), store=store, verifiers=verifiers
)

while not agent.refresh().usable:      # the status witness, then the scope log;
    time.sleep(5)                      # usable once a root anchors the delegation
envelope = agent.present(challenge)    # checks the verifier's signature (ChallengeRefused), then
                                       # proves or refuses, naming what the delegation cannot satisfy
result = agent.pay(url, payer=payer)   # one paid request; your payer builds the payment header

When the principal's holder is not where the agent runs, split the mint: mint_token(offer, principal, transport=...) beside the principal returns a short-lived, single-use MintMaterial that carries nothing of the principal, and AgentClient.complete_issuance(material, ...) in the agent's runtime completes it, so the agent's custody is born there.

agent.can_satisfy(claim_policy) says whether a policy is within the credential before any challenge, naming the output keys it cannot prove, with nothing sent. mintid_agent.handshake answers the provisional agent-to-agent handshake (A2A, MCP) without the verifier package.

The same client renews the credential from a renewal offer and holds the agent's kill switch: holder self-revocation, submitted through a privacy relay and confirmed against the chain.

Where to test

On the public testnet and its KYC sandbox, and only there: check the status line of its page first. Nothing minted on it carries weight. The single-node production chain is not for third parties and is never a place to test.

Licence

Apache License 2.0 (LICENSE, NOTICE). Author: Marc Molas.


This repository

This is a read-only mirror of sdk/python/mintid-agent of the MintID source tree, https://gitlab.com/mintid/mintid, and is published from it: each publication replaces its content, and nothing is merged here. Issues and merge requests go to the main project, https://gitlab.com/mintid/mintid/-/issues; a vulnerability goes privately to the address in its SECURITY.md, never to a public issue. Licence: Apache License 2.0 (LICENSE and NOTICE); contributions follow the main project's CONTRIBUTING.md.

Package: mintid-agent (Python >= 3.12). It depends on mintid-proof-core, the Python bindings of the Rust proof core and holder library, whose source is identity-proof-core/python of the main repository. To work here against the proof core of the same revision, build it from a clone of the main repository (pip install ./identity-proof-core/python, with a Rust toolchain), then install this package (pip install -e ".[ed25519]").

Metadata

Release files for mintid-agent 0.6.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 mintid-agent 0.6.0
File Size Uploaded Provenance Actions
mintid_agent-0.6.0.tar.gz 66.3 kB Without provenance Details for mintid_agent-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mintid-agent 0.6.0
File Interpreter ABI Platform Actions
mintid_agent-0.6.0-py3-none-any.whl Python 3 none any Details for mintid_agent-0.6.0-py3-none-any.whl

Total release size: 120.5 kB

Release files / mintid_agent-0.6.0.tar.gz

Download URL mintid_agent-0.6.0.tar.gz
Size 66.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ce6cd8f261156cd43d29d0ca6892c75de2e96dda35b1235d251036be178ae377
BLAKE2b-256 checksum
How to use checksums
2f3503da13870d25e24c0c75111a3b0ab2286a2a07f730730f901afc665d504d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / mintid_agent-0.6.0-py3-none-any.whl

Download URL mintid_agent-0.6.0-py3-none-any.whl
Size 54.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
524d7995fe8340cdcdc531a21dc1113574b3c14e22d74ed7a75c146a2c887979
BLAKE2b-256 checksum
How to use checksums
7b4de0e67869ee55abca8a15782fc92fcef30628364d8c3c1ec4257194cd8a37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.15

Security for mintid-agent 0.6.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.

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