AgentPay Guard – Building Trust in Autonomous Payments

Inspiration

Artificial intelligence is rapidly moving beyond answering questions. AI agents are becoming capable of taking actions, interacting with services, and making decisions on behalf of people.

But this creates an important question: If an AI agent can initiate a payment, how do we ensure it does so safely and responsibly?

We were inspired by this challenge. Giving AI the ability to transact should not mean giving it unlimited financial authority.

We wanted to build a security layer that allows AI-powered payments while keeping humans in control. That idea became AgentPay Guard.

Our guiding principle is simple:

Let AI transact. Let humans stay in control.

What it does

AgentPay Guard acts as a security guard between an AI agent and the payment process.

Instead of blindly processing a payment request, it:

  • Understands natural-language payment requests using AI.
  • Extracts important details such as merchant, amount, currency, description, and payment purpose.
  • Identifies missing information and asks for clarification.
  • Evaluates payment requests using deterministic risk and policy rules.
  • Classifies requests into three outcomes: ALLOW, REVIEW, or BLOCK.
  • Provides a human reviewer with the ability to approve or reject requests.
  • Integrates with PayPal Sandbox to demonstrate authorization-only payment order creation.
  • Records important actions in Elasticsearch for auditability and traceability.

The key design decision is that AI helps understand the request, but the backend policy engine makes the authoritative risk decision. Human approval remains essential for controlled payment execution.

How we built it

We developed AgentPay Guard using a combination of AI, backend security logic, payment integration, and audit technology.

AI-powered understanding: We integrated Groq to process natural-language payment requests and extract structured payment information. When essential details are missing, the system identifies the gaps and requests clarification instead of proceeding blindly.

Deterministic risk engine: We built backend policy rules to assess payment amounts, currencies, risk indicators, and other conditions. These rules determine whether a request is allowed, requires human review, or must be blocked. The AI cannot override these decisions.

Human oversight: We implemented a reviewer workflow so that payments requiring additional scrutiny can be approved or rejected by a human.

PayPal integration: We integrated the PayPal Developer Platform Sandbox to demonstrate payment order creation. The workflow uses authorization-only orders, with buyer approval and a separate human-controlled capture step.

Auditability: We integrated Elasticsearch to store and retrieve important audit events, creating a record of key actions throughout the payment workflow.

Application and deployment: The frontend was developed using React, TypeScript, and Vite. The backend uses Python and FastAPI. AG Grid Community helps display transaction information. We deployed the application using Render and made the source code publicly available on GitHub.

Challenges we faced

One of our biggest challenges was separating AI intelligence from financial authority.

An AI model can interpret a payment request, but it should not have the final say on whether money can move. We addressed this by making deterministic backend policies authoritative and keeping human approval in the payment workflow.

Another challenge was handling incomplete or ambiguous payment instructions. We needed to ensure that missing information, especially payment purpose, would not be silently ignored. We built a clarification step to make the request complete before risk assessment.

Integrating the payment lifecycle was another important challenge. Creating an order, obtaining buyer approval, and capturing a payment are different stages. We designed the PayPal Sandbox workflow to keep these stages separate and avoid treating order creation as a completed payment.

We also worked through deployment configuration and Elasticsearch connectivity to ensure that audit events could be written to and retrieved from the deployed service.

What we learned

This project taught us that building an AI-powered financial system is not just about making an AI model smarter. It is about designing the right boundaries around what AI is allowed to do.

We learned the importance of:

  • Separating AI-generated understanding from deterministic security decisions.
  • Asking for clarification instead of making assumptions.
  • Keeping humans involved in sensitive financial actions.
  • Treating authorization and capture as separate payment stages.
  • Maintaining reliable audit records for accountability.
  • Testing the complete workflow, not just individual features.

We also learned how AI services, payment APIs, backend policy engines, and audit systems can work together in a practical application.

What's next

AgentPay Guard is a foundation for safer agentic commerce. Future improvements could include persistent transaction storage, stronger production-grade authentication, more advanced policy configuration, and deeper verification of payment deliverables.

Our vision is a future where AI agents can take useful financial actions without removing human accountability.

AgentPay Guard – Let AI transact. Let humans stay in control.

Built With

Share this project:

Updates

Submission history