-
-
Search in plain English. SafeCart ranks live Channel3 listings by relevance, rating and value and explains its top pick.
-
Voice shopping: speak a request, Gemini transcribes it (audio not stored), and you confirm what it understood before searching.
-
Real PayPal Sandbox orders, each with PayPal order ID, capture ID, amount and a backend-confirmed CAPTURED status.
-
Audit log: every safety decision is recorded, including a guardrail refusing a duplicate capture of an already-paid order
-
Payment confirmed automatically: the backend verifies PayPal order 14 as CAPTURED and shows the capture ID, amount and timestamps.
-
Emergency pause: one click and SafeCart stops all new spending. The banner confirms nothing new can start until you resume.
Inspiration
Online shopping is convenient, but finding the right product within a specific budget and completing a secure payment can still be challenging. Many shopping platforms recommend expensive alternatives, making it difficult for users to stick to their spending limits. At the same time, allowing AI agents to make purchases introduces security and authorization risks.
This inspired me to build Safe_cart_agent, an AI-powered shopping assistant that makes online shopping smarter, budget-friendly, and secure.
My vision was to create a system where users can simply describe what they need, set their budget, discover suitable products, and complete their purchases securely without worrying about overspending or unauthorized transactions.
The core idea is simple: AI should help users shop smarter, not make them spend more.
What it does
Safe_cart_agent is designed to combine intelligent product discovery, strict budget management, and secure payment processing into one shopping workflow.
Its main features include:
- Smart Product Discovery: Helps users find products based on their requirements and preferences.
- Strict Budget Filtering: Filters out products that exceed the user's specified budget.
- Budget-Friendly Shopping: Focuses on finding suitable products within the user's spending limit.
- Price Verification: Rechecks product prices before checkout to prevent unexpected price changes.
- Secure PayPal Payments: Integrates PayPal Orders API in sandbox mode for payment processing.
- Human-in-the-Loop Approval: Requires explicit user authorization before proceeding with a purchase.
- Spending Protection: Implements spending limits, transaction restrictions, and an emergency pause mechanism.
- Secure Approval System: Uses cryptographic signatures to protect purchase approvals against tampering and reuse.
- Transaction Tracking: Maintains records of important purchase and approval activities.
The goal is to give users a convenient shopping experience while ensuring they remain in control of their money.
How we built it
We built Safe_cart_agent using Python and a modular backend architecture.
The application follows a structured shopping and checkout workflow:
- Users provide their shopping requirements and budget.
- The product discovery component retrieves relevant products through the Channel3 integration and demo catalog.
- The backend validates product prices and filters out products that exceed the specified budget.
- Users can review suitable products before making a purchase decision.
- Before checkout, the system verifies the latest product price and validates the purchase.
- A secure approval mechanism generates and verifies signed purchase authorizations using HMAC-SHA256.
- The checkout module independently validates the approval before processing the payment.
- PayPal Orders API handles payment operations in sandbox mode.
- SQLite stores persistent application data, while FastAPI exposes the backend functionality through REST API endpoints.
Technologies used:
- Python – Core application logic
- FastAPI – Backend API development
- SQLite – Database and persistent storage
- Channel3 API – Product discovery
- PayPal Orders API – Payment integration
- HMAC-SHA256 – Secure purchase approvals
- Pytest – Automated testing
One of our most important architectural decisions was separating product discovery from payment execution. The shopping agent cannot directly authorize payments. Independent backend security checks must validate every purchase before checkout.
Challenges we ran into
Building Safe_cart_agent introduced several interesting technical challenges.
1. Enforcing strict budget limits
We wanted to ensure that users would not be shown or allowed to purchase products beyond their specified budget. We addressed this by implementing independent backend budget validation instead of relying only on AI instructions.
2. Preventing unauthorized purchases
We needed to ensure that the AI agent could not independently spend the user's money. We implemented signed purchase approvals using HMAC-SHA256, expiration validation, and one-time approval consumption.
3. Handling product price changes
Product prices can change between discovery and checkout. We implemented price verification before payment so that unexpected changes could stop the transaction.
4. Securing payment operations
Payment workflows require careful handling of repeated requests and transaction limits. We addressed this through PayPal sandbox integration, idempotency protection, and independent checkout validations.
5. Testing unexpected scenarios
We needed to test more than successful purchases. We created automated tests covering expired approvals, modified purchase amounts, excessive spending, price changes, and repeated checkout attempts.
Accomplishments that we're proud of
We are proud of building a functional safety-focused shopping backend that brings together product discovery, budget validation, secure approvals, and PayPal payment integration.
Some accomplishments include:
- Successfully building a modular backend using FastAPI.
- Integrating product discovery with budget validation.
- Implementing independent spending and checkout guardrails.
- Building a cryptographically signed approval mechanism.
- Integrating PayPal Orders API in sandbox mode.
- Implementing transaction restrictions and idempotency protection.
- Creating automated tests to validate normal and security-related scenarios.
- Achieving 290 passing automated tests in our verified project test run.
Most importantly, we are proud that security is built into the system's architecture rather than treated as an additional feature.
What we learned
This project helped us understand that building an AI-powered application involves much more than connecting an AI model to an API.
We gained practical experience in:
- Designing modular backend architectures.
- Building REST APIs using FastAPI.
- Integrating third-party APIs.
- Working with databases and persistent storage.
- Implementing cryptographic approval mechanisms.
- Understanding payment workflows and transaction security.
- Building independent validation and spending restrictions.
- Writing automated tests for real-world failure scenarios.
Our biggest takeaway was that an AI agent should be intelligent enough to help users, but it should also have clearly defined boundaries.
Trust, security, and user control should be fundamental parts of every autonomous payment system.
What's next for Safe_cart_agent
Our vision is to transform Safe_cart_agent into a complete AI-powered personal shopping assistant.
Some of our planned improvements include:
- Integrating an LLM for natural-language shopping conversations.
- Allowing users to describe products using simple everyday language.
- Improving personalized product recommendations.
- Adding smarter product comparisons based on price, quality, and user preferences.
- Strengthening protection against prompt injection and malicious product listings.
- Building a user-friendly shopping dashboard.
- Introducing voice-based shopping interactions.
- Expanding payment and transaction management capabilities.
Our ultimate goal is to create a shopping assistant that understands what users need, respects what they can afford, and helps them complete purchases with confidence.
Find what you need. Stay within your budget. Shop with confidence. Pay securely.