Inspiration
As autonomous coding agents and workflow bots take over complex tasks, developers are granting them access to make real-world purchases: buying API inference tokens, spinning up cloud GPUs, and accessing paid datasets.
However, non-deterministic LLMs present an existential financial risk. A single prompt injection, vendor spoofing redirect, or hallucinated runaway loop can drain an entire corporate balance in minutes. We built PayAgent Sentinel to provide deterministic financial guardrails, human-in-the-loop review queues, and enterprise auditability for autonomous agentic commerce.
What It Does
PayAgent Sentinel acts as an autonomous runtime firewall and proxy gate for AI agents making programmatic procurement calls (paypal_procure).
- 5-Stage Security Pipeline: Every agent tool call is audited through:
- Ingest & Signature Validation: Intercepts outbound procurement requests.
- Deterministic Budget Gate: Enforces strict single-transaction caps and rolling session budgets.
- Threat Intelligence Reputation: Checks target merchant domains against real-time blacklists and suspicious TLD patterns.
- Semantic NLP Scanner: Detects adversarial prompt-injection payloads (e.g.
SYSTEM OVERRIDE, jailbreak evasion). - Conditional PayPal Settlement: Programmatically routes decisions to PayPal Orders v2.
- Dynamic Settlement Routing:
- APPROVED (Risk < 20): Zero-touch auto capture via PayPal Orders v2 REST API.
- FLAGGED (Risk 20-59 or > Warning Threshold): Staged in
CREATEDstate for operator Human-in-the-Loop review. - BLOCKED (Risk >= 60): Immediate abort with zero funds committed.
- AG Grid Real-Time Audit Ledger: Enterprise-grade data grid powered by AG Grid v36 Community (
ag-theme-quartz-dark), featuring instant risk filtering, quick text search, expandable LLM reasoning traces, and one-click CSV export for finance teams.
How We Built It
- Next.js 15 App Router & TypeScript: Production-grade full-stack architecture with server actions and route handlers.
- PayPal Developer Platform (Sandbox REST API v2): Programmatic integration with
/v2/checkout/ordersand/v2/checkout/orders/{id}/capturefor authentic checkout workflows, paired with a high-fidelity fail-safe simulator so judges can test instantly without pre-configured API keys. - AG Grid v36 Community: Built with custom dark quartz styling, row-level selection, pinned columns, and custom cell renderers for real-time transaction updates.
- Deterministic Policy & Guardrail Engine: Fast semantic regex and token scanning achieving
< 2msevaluation latency. - Tailwind CSS & Lucide Icons: High-density fintech command center aesthetic.
Challenges We Ran Into
- Hydration & Bundle Optimization with AG Grid in Next.js 15: AG Grid is powerful but heavy. To avoid layout shifts and SSR hydration mismatches, we implemented client-side dynamic imports with fallback skeletons, keeping first-load JS minimal.
- Deterministic Governance for Non-Deterministic Agents: Balancing autonomous execution speed with strict financial safety. We solved this with a tiered disposition model (instant capture vs. human approval queue).
Accomplishments That We're Proud Of
- Zero-latency execution: Security evaluations complete in under 2ms.
- True end-to-end PayPal sandbox integration supporting both auto-capture and interactive human approval.
- High-density fintech UI that gives operators complete forensic transparency over autonomous agent purchases.
What We Learned
Bridging AI agents and fintech APIs requires shifting from "prompt-only safety" to layered, deterministic software guardrails. Financial rails must verify intent before committing capital.
What's Next for PayAgent Sentinel
- Multi-agent fleet management with role-based budget allocations.
- Automated dispute negotiation agent via PayPal Dispute APIs.
- MCP (Model Context Protocol) native server so any Claude/Hermes/Cursor agent can plug into Sentinel as a native tool.
Built With
- ag-grid
- ai-agents
- artificial-intelligence
- cybersecurity
- fintech
- next.js
- paypal
- react
- rest-api
- tailwind-css
- typescript
- vercel