How dheerajgowdads/paari_payments_protocol works
Paari is a governed payment service for AI agents: an agent presents a parent-authorized identity, authenticates, proposes a payment, and receives a bounded authorization only after policy checks. The payment boundary executes it through a provider; verified provider events and direct reconciliation establish settlement, with audit and proof records supporting accountability. The README documents major protocol, mandate, autonomous-provider, tenant, and settlement capabilities. Some subsystem links are based on that documentation and the tree; unsampled implementation details are not assumed.
Main entry points: payments.py Payment Orchestration · main.py Paari API · database.py Persistent State · base.py Provider Interface
Components 26
Identity & Trust
- Agent Registration
app/routers/agents.py - Parent Governance
app/routers/parents.py - Trust Validation
app/trust.py - User Mandates
app/mandates.py
Protocol & Access
- Agent Client SDK
sdk/paari_agent/client.py - Paari API
app/main.py - Protocol Discovery
app/protocol/discovery.py - Signed Envelopes
app/protocol/envelope.py - Proof Authentication
app/routers/auth.py
Payment Governance
- Payment Orchestration
app/routers/payments.py - Governance Rules
app/governance.py - Mandate Signing
app/mandate_signing.py - Transaction State
app/transitions.py
Provider Settlement
- Provider Interface
app/providers/base.py - Razorpay Adapter
app/providers/razorpay.py - Autonomous Adapter
app/providers/razorpay_agentic.py - Reference Provider
app/providers/reference_autonomous.py - Settlement Webhooks
app/routers/payments.py - Provider Reconciliation
app/reconcile.py - Reconciliation Worker
app/reconcile_worker.py
Audit & Evidence
- Hash-chain Audit
app/audit.py - Proof Bundle
app/proof_bundle.py - Persistent State
app/database.py
Other components
- AI Agent
- Parent Authority
- Payment Provider
Connections 41
- AI Agent → Agent Client SDK: uses
- Agent Client SDK → Paari API: sends requests
- Paari API → Protocol Discovery: serves discovery
- Agent Client SDK → Signed Envelopes: signs messages
- Paari API → Agent Registration: routes registration
- Paari API → Parent Governance: routes authority
- Parent Governance → Agent Registration: delegates authority
- Agent Registration → Trust Validation: validates trust
- Agent Registration → Persistent State: stores identity
- Paari API → Proof Authentication: routes authentication
- Proof Authentication → Persistent State: checks credentials
- AI Agent → Proof Authentication: proves possession
- Paari API → Payment Orchestration: routes payment requests
- AI Agent → Payment Orchestration: proposes payment
- Payment Orchestration → Trust Validation: revalidates trust
- Payment Orchestration → User Mandates: resolves mandate
- Payment Orchestration → Governance Rules: evaluates intent
- Payment Orchestration → Mandate Signing: verifies mandate
- Payment Orchestration → Persistent State: reserves authorization
- Payment Orchestration → Transaction State: applies transitions
- Payment Orchestration → Provider Interface: executes authorization
- Provider Interface → Razorpay Adapter: implemented by
- Provider Interface → Autonomous Adapter: autonomous option
- Provider Interface → Reference Provider: conformance option
- Razorpay Adapter → Payment Provider: calls provider API
- Autonomous Adapter → Payment Provider: calls provider API
- Reference Provider → Payment Orchestration: returns provider result
- Payment Provider → Settlement Webhooks: sends events
- Settlement Webhooks → Transaction State: records legal transition
- Settlement Webhooks → Persistent State: records event
- Paari API → Reconciliation Worker: starts worker
- Reconciliation Worker → Provider Reconciliation: reconciles transactions
- Provider Reconciliation → Provider Interface: reads provider truth
- Provider Reconciliation → Transaction State: confirms settlement
- Reconciliation Worker → Persistent State: loads pending transactions
- Payment Orchestration → Hash-chain Audit: records events
- Proof Authentication → Hash-chain Audit: records authentication
- Provider Reconciliation → Hash-chain Audit: records reconciliation
- Hash-chain Audit → Persistent State: appends entries
- Paari API → Proof Bundle: serves proof bundle
- Proof Bundle → Persistent State: reads stage evidence