\## Inspiration\\ “I’ll pay you Friday.” Every freelancer has heard it, and Friday rarely comes. Chasing a late invoice is awkward: nag too hard and you lose the client, stay quiet and you eat the loss. And when a client genuinely can’t pay in full, you’re suddenly negotiating a payment plan, doing the math and issuing new invoices by hand.\\ \\ AI can already write a polite email. I wanted to find out whether it can be trusted with the part that involves money.\\ \\ \## What it does\\ Chaser is an AI agent that chases overdue PayPal invoices for a freelancer.\\ \- Ranks overdue invoices by risk, with a plain-English reason for each\\ \- Uses an LLM provider to classify client replies and write follow-ups in the tone you choose\\ \- When a client can’t pay in full, offers a payment plan inside limits you set once: minimum deposit, maximum installments, maximum length, and discount cap\\ \- Issues installment invoices through PayPal once the client accepts and the plan passes policy checks\\ \- Sends anything out of bounds (a big discount demand, a dispute, or an angry message) to an approval inbox with a recommendation\\ \- Records every agent action and policy decision in an audit log\\ \\ \## How I built it\\ The core idea is simple: the AI proposes; deterministic code decides. Everything the model suggests is validated, then checked by a deterministic policy engine before anything happens. The model cannot change the rules, mark an invoice paid, or accept a plan on a client’s behalf. Client messages are treated as untrusted text, prompt-injection attempts are covered by tests, and money is always handled as integer cents.\\ \\ The stack is Next.js, TypeScript and Drizzle, with local SQLite for development and Turso for persistent hosting. The PayPal Invoicing v2 API is used through a direct client, with verified webhooks plus a polling fallback. The agent is tool-using with a bounded loop. The hosted demo uses a configured LLM provider for live classification, drafting and tool selection. Scripted fallbacks keep the guided walkthrough reliable if the provider is temporarily unavailable, while both paths use the same policy checks, tool boundaries and audit trail. A mock PayPal mode mirrors the real integration, so the complete flow can also run without moving real money.\\ \\ \## Challenges\\ Keeping negotiation deterministic wherever money is involved while the conversation still feels natural. Exact arithmetic on odd-cent plans. Protecting the agent from prompt injection and duplicate invoice creation. And building a demo anyone can use, with no login, no user-supplied API keys and no waiting for a real client to reply.\\ \\ \## What I’m proud of\\ A complete loop from overdue invoice to negotiated plan to PayPal installment invoices, with guardrails that are tested, not just promised: 430 automated tests and 16 scripted guardrail evals. The evals cover prompt injection, policy recovery, exact-cent arithmetic, idempotency and unsafe requests. Scripted runs verify the safety layer, not model behavior.\\ \\ \## What I learned\\ Trust is the product. An agent is only useful if the owner can see, bound and audit everything it does. LLMs are valuable for language, classification and tool selection, but financial authority should remain in deterministic, testable code.\\ \\ \## What’s next\\ Real email and WhatsApp channels, multi-currency, Venmo, and learning each client’s payment habits while preserving clear owner control.\\ \\ \## Try it\\ Live demo: https://tinyurl.com/Chaser-PayPal-AiHackathon. It uses fictional data and needs no login. It runs on free hosting, so the first load can take about a minute. Guided client conversations can be simulated for repeatability, and all money is PayPal Sandbox or mock money, never real.\\ \\ \## Built with\\ Next.js, TypeScript, React, Tailwind, Zod, Drizzle, SQLite, Turso, PayPal Invoicing API, Vitest and a configured LLM provider. Built with the help of Claude Code, Cursor, GitHub Copilot, Codex and Kiro.

Built With

Share this project:

Updates

Submission history