PayGuard – AI-Powered Payment Security & Fraud Prevention
Inspiration
Online payments have made our lives easier, but they have also created new opportunities for scammers. Fake invoices, phishing messages, suspicious payment requests, and unauthorized purchases can put anyone's money at risk.
We started thinking about how people could protect themselves before making a payment, especially when a request looks genuine at first but may actually be fraudulent.
We were also interested in the growing use of AI shopping agents. These agents can make purchasing decisions on behalf of users, but giving them access to payments also means giving them some control over our money. We wanted to explore how that could be made safer.
This led us to build PayGuard, a payment security platform that combines AI-based fraud analysis, transaction risk scoring, and spending controls to help people make safer financial decisions.
What We Built
PayGuard provides multiple layers of protection for digital payments:
- AI-Powered Scam Detection: Examines invoices and payment requests for suspicious signs such as phishing, brand impersonation, fake urgency, advance-fee fraud, and other common scam patterns.
- AI Fraud Analysis: Uses Amazon Bedrock Mantle to access OpenAI GPT-OSS-120B and GPT-OSS-Safeguard-120B for invoice analysis, scam classification, and understandable explanations.
- AI Spending Guard: Allows spending limits, weekly budgets, category restrictions, and purchasing permissions for AI agents.
- Trusted Circle: Provides an approval workflow in which trusted or authorized people can review transactions requiring additional approval.
- Transaction Monitoring: Helps users review transaction activity, risk scores, security alerts, and audit records.
- PayPal Integration: Uses the PayPal Developer Sandbox to experiment with payment orders, payment capture, and webhook verification.
- Multilingual Protection: Supports explanations and recommendations in English, Hindi, and Marathi.
Our main aim is to make payment security easier to understand, rather than simply showing users a warning without explaining what went wrong.
How We Built It
We developed PayGuard using **React, TypeScript, Python FastAPI, and PostgreSQL.
The frontend provides the user interface for fraud checking, transaction monitoring, spending controls, and approval workflows. The FastAPI backend manages authentication, payment-related operations, fraud analysis, security policies, and communication between services.
For the AI component, we used Amazon Bedrock Mantle through its OpenAI-compatible API.
We used two models for different tasks:
- GPT-OSS-120B: Helps understand invoice content, extract suspicious details, and generate explanations that users can understand.
- GPT-OSS-Safeguard-120B: Supports specialized scam classification and analysis of potentially harmful or fraudulent content.
We also developed a Python-based risk-scoring engine. It combines AI-generated insights with security rules to examine suspicious patterns, merchant mismatches, unusual amounts, and other warning signs. The system produces risk assessments on a scale of 0–100 along with recommendations.
For payment functionality, we worked with PayPal Developer Sandbox APIs, including OAuth 2.0 authentication, order creation, payment capture, and webhook signature verification.
What We Learned
Building PayGuard gave us an opportunity to work with technologies that are used in real-world applications.
We learned how to:
- Work with PayPal Sandbox credentials and REST APIs.
- Understand OAuth 2.0 authentication and payment workflows.
- Connect AI models through Amazon Bedrock Mantle.
- Use different AI models for invoice understanding and scam classification.
- Combine LLM-based analysis with Python security rules.
- Generate understandable fraud explanations and risk assessments.
- Build backend APIs using FastAPI and manage data with PostgreSQL.
- Design transaction approval workflows and spending restrictions.
- Handle API responses, validation, and errors between frontend and backend.
One of the most valuable lessons was understanding that AI-generated results should work alongside predictable security rules, especially when financial decisions are involved.
Challenges We Faced
One of our biggest challenges was detecting suspicious payment requests without flagging every unusual transaction as fraud. A simple keyword check cannot always understand the context behind an invoice or payment message.
We addressed this by combining GPT-OSS-120B for understanding invoice content with GPT-OSS-Safeguard-120B for specialized scam analysis, supported by our Python-based risk-scoring engine.
Another challenge was connecting Amazon Bedrock Mantle with an OpenAI-compatible API. We had to understand authentication, model configuration, request handling, and structured responses.
PayPal integration was another important learning experience. Understanding the payment lifecycle, working with Sandbox credentials, creating orders, capturing payments, and verifying webhooks required careful testing.
We also worked on connecting spending policies and approval workflows so that transactions could be checked against user-defined limits.
These challenges helped us understand how different technologies need to work together to build a reliable payment security application.
Our Vision
We want PayGuard to become more than just a fraud detection tool. We want it to help people feel safer and more confident whenever they make digital payments.
By combining AI analysis, understandable security explanations, payment integrations, and spending controls, we hope to make financial protection more accessible.
Your money. Your rules. Your protection.
Built With
- 2.0
- ai
- amazon
- api
- bedrock
- detection
- fastapi
- fraud
- gpt-oss-safeguard-120b
- httpx
- mantle
- oauth
- openai
- paypal
- postgresql
- pydantic
- python
- react
- requests
- rest
- sandbox
- security
- tailwind-css
- typescript