Inspiration
Organizations and individuals lose over $135 billion annually to "zombie" SaaS subscriptions, underutilized multi-seat licenses, duplicate productivity tools, and silent recurring price hikes. Traditional spend tools only send passive alerts—leaving finance teams to manually hunt down billing agreements.
At the same time, Agentic Commerce promises autonomous AI agents that can purchase compute credits, renew infrastructure, and negotiate services. Yet a critical barrier remains: no CFO or consumer will hand an unconstrained LLM raw access to a PayPal account.
We built SentinelPay to bridge that trust gap: combining Google Gemini 2.5 Flash financial intelligence with deterministic, zero-trust Budget Guardrails and deep PayPal REST API execution.
What it does
SentinelPay is an autonomous treasury and procurement platform built natively on PayPal Sandbox REST APIs:
Telemetry-Driven Subscription Audit & Revolut-Style Sparklines:
- Correlates active PayPal recurring billing agreements (
I-...) with product usage telemetry (active days in last 30d, seat utilization ratio, functional overlap, and 90-day price creep). - Computes a
0–100Waste Score, Cost-per-Active-Day, and exact Annual Recoverable Savings ($2,682.00/year on our benchmark portfolio). - Displays 6-month historical SVG sparklines and instant price delta badges (+20% surge, -75% savings).
- Correlates active PayPal recurring billing agreements (
Autonomous & 1-Click PayPal Subscription Remediation (
/v1/billing/subscriptions):- Plan Downgrade via
/revise: When SentinelPay detects that only2 of 10 seatsare used on DesignFlow Enterprise ($120/mo), it revises the PayPal Billing Plan down to the Starter Duo Plan ($29/mo)—saving $1,092/year with zero workflow disruption. - Zombie Cancellation via
/cancel: Terminates dormant services (CloudGPU Studio Pro, 52 days inactive, saving $1,068/year) and duplicate tools (MeetScribe AI, saving $348/year). - Price-Creep Suspension via
/suspend: Freezes recurring micro-subscriptions (PulseMetrics, +45% silent price hike with 0 usage) while preserving account state.
- Plan Downgrade via
1-Click SaaS Arbitrage Auto-Switch (PayPal
/cancel+ Orders v2):- Automatically detects cheaper, feature-equivalent alternatives (e.g., replacing overpriced CloudGPU Pro at $89/mo with RunPod Serverless GPU at $19/mo).
- In a single atomic operation, cancels the legacy billing agreement via PayPal
/canceland provisions the cheaper tool via PayPal Orders v2, unlocking $840/year net savings.
Live PayPal Webhook Trap Interceptor & Instant Clawback Refund (
/v2/payments/captures/{id}/refund):- Intercepts incoming signed PayPal Webhook events (
PAYMENT.SALE.COMPLETED/BILLING.SUBSCRIPTION.RENEWED). - Instantly traps unauthorized trial-to-paid conversions ($1.00 → $49.00/mo) and silent price hikes (+169%), automatically freezes the billing agreement, and executes a full clawback refund via PayPal Captures Refund API v2 in under 100 milliseconds.
- Intercepts incoming signed PayPal Webhook events (
Active B2B Retention Negotiation & Certified CFO Audit Boardpack:
- Gemini B2B Negotiator: Generates formal telemetry-backed legal notices to vendor accounts citing active days, unused seats, and PayPal agreement IDs, securing 40% enterprise retention discounts applied directly via PayPal Plan Revision.
- Corporate CFO Boardpack: Generates a printable, certified executive boardpack complete with before/after financial benchmarks, subscription matrices, and cryptographic SHA-256 ledger proof.
Model Context Protocol (MCP) Server for Autonomous Agents (
mcp_server.py):- Implements the standard JSON-RPC 2.0 Model Context Protocol, exposing 5 guarded PayPal financial tools to external AI agents (Claude Desktop, Cursor, OpenAI Agents) under strict zero-trust budget guardrails.
How we built it
We engineered SentinelPay using a strict 3-tier modular architecture:
- Presentation Layer (React 18 + TypeScript + Vite + Tailwind CSS):
- Designed in PayPal's institutional palette (
#003087Deep Navy,#0070BACerulean Blue,#F5F7FAledger canvas) with Apple-inspired fluid craft: translucent sticky header, tabular financial numerals (tabular-nums), and instant tactile response.
- Designed in PayPal's institutional palette (
- Domain & Business Layer (Python 3.13 + FastAPI + Pydantic v2):
SubscriptionAuditEngine: Deterministic scoring model calculating waste scores and seat utilization efficiency.BudgetGuardrailEngine: Zero-trust policy gatekeeper enforcing monthly caps, single-transaction auto-approval thresholds, and category whitelists.- Strategy & Factory Design Patterns (
ActionStrategyFactory): Cleanly decouplesCancelSubscriptionStrategy,SuspendSubscriptionStrategy,DowngradePlanStrategy, andAutonomousOrderStrategy.
- Infrastructure Layer (PayPal Sandbox REST Client + Google Gemini 2.5 Flash):
PayPalSandboxClient(httpxAsync): Handles OAuth 2.0 Bearer token caching (/v1/oauth2/token), Catalog Products (/v1/catalogs/products), Billing Plans (/v1/billing/plans), Subscriptions (/v1/billing/subscriptions), and Checkout Orders v2 (/v2/checkout/orders).GeminiReasoningProvider(gemini-2.5-flash): Generates structured executive briefings and parses natural-language financial commands into typed tool executions, backed by a deterministic financial intelligence fallback engine for 100% uptime.
Challenges we ran into
- Solving the "Empty PayPal Sandbox" Problem for Judges:
- A fresh PayPal Developer Sandbox account has no pre-existing recurring subscriptions. To make live evaluation effortless for judges, we built a 1-Click Live Sandbox Seeder (
POST /api/v1/paypal/seed-sandbox) that provisions real Catalog Products and Billing Plans directly inside the connected PayPal account, alongside a seamless simulator mode.
- A fresh PayPal Developer Sandbox account has no pre-existing recurring subscriptions. To make live evaluation effortless for judges, we built a 1-Click Live Sandbox Seeder (
- Preventing AI Hallucinations from Executing Unintended Payments:
- Relying solely on LLM prompts to enforce financial limits is unsafe. We decoupled AI intent generation from execution by placing the deterministic
BudgetGuardrailEnginein the critical path before any PayPal API call can be dispatched.
- Relying solely on LLM prompts to enforce financial limits is unsafe. We decoupled AI intent generation from execution by placing the deterministic
- Intelligent Remediation vs. Blind Cancellation:
- Terminating an active tool can disrupt business operations. Leveraging PayPal's
/v1/billing/subscriptions/{id}/reviseendpoint allowed SentinelPay to downgrade seat tiers automatically rather than breaking team workflows.
- Terminating an active tool can disrupt business operations. Leveraging PayPal's
Accomplishments that we're proud of
- End-to-End PayPal API Depth: Going far beyond a standard payment button by integrating OAuth 2.0, Catalog Products v1, Billing Plans v1, Subscriptions v1 (
/cancel,/suspend,/revise), and Orders v2 (/v2/checkout/orders). - Zero-Latency Institutional UI: Building a high-density financial ledger interface that feels like a native PayPal enterprise product.
- Cryptographic Financial Compliance: Delivering a verifiable SHA-256 hash chain linking every autonomous transaction to its exact
PayPal-Request-Id.
Built With
- fastapi
- google-gemini
- model-context-protocol
- paypal
- paypal-rest-api
- python
- react
- tailwindcss
- typescript
- vite