Inspiration

Businesses want the efficiency of autonomous AI agents, but they are terrified of giving probabilistic models write-access to their money. One hallucination or Business Email Compromise (BEC) attack could drain an account. We built PayPilot to bridge this gap: it proves that you can automate financial workflows using AI if you wrap the LLM in strict, deterministic guardrails.

What it does

PayPilot AI is an autonomous B2B collections agent that operates inside a "Glass Box."

  • Unstructured Extraction: It parses raw email requests for invoices using Groq/Gemini.
  • Layer 1 Firewall: It cross-references requested payee domains against an offline ledger to intercept BEC attacks before they reach the payment API.
  • Idempotent Execution: It routes approvals through a LangGraph state machine that safely handles API timeouts without double-charging.
  • Growth Loop: It catches simulated PayPal webhooks (secured by HMAC-SHA256) to dynamically update a customer's Reliability Score based on payment history.
  • Tamper-Evident Ledger: Every authorization decision, API call, and policy check is hashed using SHA-256 and chained to the previous entry, proving exactly why the system approved or blocked a transaction.

How we built it

  • Frontend (The Glass Box): React, TypeScript, SCSS, and AG Grid to visualize the agent's internal state and cryptographic ledger.
  • Backend & API: Python and FastAPI.
  • Agent Architecture: LangGraph for the deterministic, multi-path state machine.
  • AI Engine: Groq (Llama 3 / Qwen) with Google Gemini fallback for resilient extraction.
  • Database: PostgreSQL.
  • Payments Integration: PayPal Sandbox REST API and simulated webhooks.

Challenges we ran into

The biggest challenge was enforcing absolute determinism over an LLM's output. We solved this by treating the LLM strictly as a data extraction tool. The actual workflow logic—including the authorization fork, idempotency locks, and security firewalls—is handled entirely by the LangGraph state machine in Python. We also had to figure out how to securely validate simulated webhooks without fully standing up a public ngrok tunnel, which we solved by writing custom HMAC-SHA256 signature verification using the Web Crypto API on the frontend.

Accomplishments that we're proud of

Building a genuinely functioning Tamper-Evident Ledger. Seeing the SHA-256 hashes generate in real-time as the state machine moves from PROPOSED to EXECUTED—and seeing the system perfectly halt a seeded BEC attack—proves the core thesis of our security model.

What we learned

We learned that in FinTech AI, the "happy path" is easy, but handling failures is the entire product. Designing the graph to explicitly handle TIMEOUT and EXECUTION_FAILED states rather than blindly retrying transactions completely changed how we think about agent architecture.

What's next for PayPilot AI

  1. The Growth Engine: Implementing NLP distress extraction to negotiate split payments, calculating a dynamic T = 100(0.5P + 0.3C + 0.2R) score, and utilizing PayPal's allow_partial_payment API.
  2. Cross-Transaction Persistence: Migrating the per-transaction in-memory hash chain to PostgreSQL for exportable, cross-transaction cryptographic verification.
  3. Live Domain Intelligence: Expanding the firewall to run live DNS (SPF/DKIM/DMARC) and WHOIS domain age lookups.

Built With

Share this project:

Updates

Submission history