Inspiration

AI agents are getting better at reasoning, planning, and taking actions — including actions that move money.

But there is a trust problem: an agent may understand what it wants to buy, yet it should not be allowed to authorize its own payment.

Pulse Safe Commerce Agent was built around a simple idea:

AI can propose the payment. It should not authorize itself.

What it does

Pulse Safe Commerce Agent adds a deterministic safety layer between AI intent and PayPal execution.

A user starts with a natural-language commerce request, such as paying $24.50 for a research report.

The agent:

  • converts the request into a structured payment
  • checks the amount and currency against policy
  • requires explicit owner approval
  • binds that approval to the exact payment details
  • creates a PayPal Sandbox order
  • captures the payment only after valid approval
  • generates a deterministic receipt
  • reconciles local state with PayPal
  • prevents replay and duplicate execution

If the payment exceeds policy, or the approved details are changed, execution is blocked before PayPal is called.

How we built it

The project uses PayPal Sandbox as the load-bearing commerce execution layer.

The core workflow is:

AI intent → structured payment → policy → owner consent → exact binding → PayPal → receipt → reconciliation

The backend is built with Python and FastAPI, with SQLite for durable state.

The payment flow uses PayPal Sandbox Orders APIs. Owner consent is bound to a canonical payment payload, and the application verifies that binding again before execution.

Idempotency and replay protection ensure that an already completed payment cannot be captured twice.

The application also restores the full payment state after returning from PayPal, so the user can see the completed execution, receipt, reconciliation result, and agent trace directly in the UI.

Challenges we ran into

The biggest challenge was making PayPal genuinely part of the agent workflow rather than adding a simple checkout button.

We also had to handle several execution-safety problems:

  • ensuring the AI cannot authorize itself
  • binding consent to the exact payment
  • preventing duplicate capture
  • reconciling local state with PayPal
  • handling PayPal return URLs correctly in both local and deployed environments
  • keeping all credentials isolated from the public repository

We also built explicit negative paths so policy violations, consent mismatches, and replay attempts fail visibly instead of producing plausible-looking success states.

Accomplishments that we're proud of

  • Real PayPal Sandbox integration
  • Successful end-to-end Sandbox payment flow
  • Explicit owner approval before payment
  • Exact payment consent binding
  • Replay and duplicate-capture protection
  • Deterministic payment receipts
  • PayPal reconciliation
  • Policy-block and consent-mismatch negative paths
  • Public live deployment
  • Public open-source repository
  • 42 passing automated tests
  • Secret isolation and Sandbox-only configuration

What we learned

Agentic commerce needs more than payment APIs.

The difficult part is not allowing an AI agent to create a payment request. The difficult part is proving that the final executed payment is exactly the action that was reviewed and approved.

We learned that consent, policy, idempotency, receipts, and reconciliation are not secondary safety features — they are part of the core commerce architecture.

PayPal gives the agent a real commerce rail. Pulse adds the control layer between agent intent and execution.

What's next for Pulse Safe Commerce Agent

Next steps include:

  • configurable merchant and recipient policies
  • daily and category-based spending limits
  • richer agent identity and authorization
  • reusable MCP integration for paid tools
  • x402 and other agent-payment rails
  • stronger reconciliation and dispute workflows
  • multi-agent commerce approval flows

The long-term goal is to make safe payment execution a reusable trust layer for autonomous agents.

Built With

Share this project:

Updates

Submission history