Inspiration

Over the last year, autonomous AI agents have evolved from chat interfaces into proactive workers that write code, manage cloud infrastructure, and conduct market research. But they face a fatal bottleneck: how does an AI agent pay for things?

Handing an autonomous AI agent an unrestricted corporate credit card or raw API credentials is an enterprise nightmare—prompt injection attacks, hallucinated retry loops, and supply-chain compromises can drain balances in seconds. Conversely, crypto rails lack chargeback protections, dispute arbitration, and regulatory compliance.

We asked: What if PayPal became the trusted financial, escrow, and dispute layer for the trillion-dollar Agentic Economy? We engineered NexusPay to make agentic commerce mathematically safe, auditable, and dispute-resilient.


What It Does

NexusPay is a zero-trust cryptographic protocol and multi-agent coordination layer that enables autonomous AI agents to procure goods and services safely via PayPal Orders v2:

  1. Cryptographic Spending Mandates: Human principals issue time-bound, HMAC-SHA256 signed JSON mandates defining maximum budgets, approved merchant categories, and risk thresholds.
  2. Autonomous Procurement (Agent Alpha): Agents reason through procurement tasks, search catalogs via Channel3, verify mandate policy compliance, and initiate PayPal Orders v2 captures.
  3. Risk-Based Multi-Sig Human-in-the-Loop: Low-risk purchases (< threshold) execute zero-touch. High-value transactions trigger real-time FIDO2/WebAuthn human co-signature requests before capture.
  4. Autonomous Dispute Resolution Oracle (Agent Omega): If a merchant delivers an invalid software key or breaches SLA uptime, Agent Omega automatically compiles a SHA-256 evidence package and files a claim via the PayPal Disputes API, securing autonomous refunds without human intervention.
  5. Real-Time Glassmorphic Command Center: An enterprise dashboard powered by AG Grid (Quartz Dark), live thought streams, acoustic feedback, and a tamper-sandbox.

How We Built It

  • Backend & Core Engine: Python 3.11, FastAPI, Pydantic, HMAC-SHA256 cryptography engine, asynchronous HTTP client.
  • PayPal Integration: PayPal REST APIs — Orders API v2 (Order Creation & Capture with custom mandate tracking), Payments API (Refunds), and Disputes API.
  • Agent Intelligence: Dual-agent state machine (Agent Alpha for intent parsing and catalog procurement, Agent Omega for telemetry breach analysis and evidence packaging).
  • Frontend Command Center: HTML5/CSS3 glassmorphic design system, AG Grid Community (Quartz Dark theme), and native Web Audio API acoustic synthesis.
  • Vendor Catalog: Channel3 client integration for structured item lookup.
  • Packaging & Hardening: Docker, Docker Compose, and a comprehensive pytest suite with 14/14 automated tests covering adversarial attacks (replay protection, cumulative spend overflow, and prompt injection tamper detection).

Challenges We Ran Into

  • Deterministic Cryptographic Serialization: Ensuring that JSON payloads serialized identically across platforms to guarantee HMAC-SHA256 verification was tamper-proof regardless of key ordering.
  • Autonomous Dispute Packaging: Designing an evidence format that bridges autonomous agent error telemetry into structured proofs compatible with PayPal's dispute claim models.
  • Zero-Latency Multi-Sig Interception: Creating a clean state-machine that pauses autonomous agent execution seamlessly while awaiting a human passkey co-signature, without dropping connection state.

Accomplishments That We're Proud Of

  • 100% Policy Adherence: Mathematically impossible for an agent to exceed its budget or bypass allowed categories without invalidating the cryptographic signature.
  • End-to-End Autonomous Dispute Loop: Demonstrated an autonomous agent detecting an SLA breach, generating an evidence certificate, filing a claim, and securing a PayPal refund with zero human intervention.
  • Enterprise-Grade Stability: 14/14 automated adversarial tests passing in under 0.25 seconds.

What We Learned

The future of payments is Agent-to-Merchant (A2M). The protocols that win will not be those that treat agents like humans, but those that provide cryptographic guarantees, automated dispute handling, and programmable trust.


What's Next for NexusPay

  • Integration with PayPal Vault and Recurring Subscriptions for autonomous recurring SaaS management.
  • Zero-Knowledge (ZK) proof generation for private corporate spending mandates.
  • Production SDK release for LangChain, AutoGen, and CrewAI frameworks.

Built With

  • ag-grid
  • ai-agents
  • channel3
  • cryptography
  • css3
  • docker
  • fastapi
  • fintech
  • hmac-sha256
  • html5
  • javascript
  • multi-agent-systems
  • paypal
  • paypal-disputes-api
  • paypal-orders-v2
  • pydantic
  • pytest
  • python
  • web-audio-api
  • zero-trust
Share this project:

Updates

Submission history