Inspiration

We all know that one person (or you are that person) who spends impulsively outside of their budget. Traditional budgeting apps don't provide enough friction and are typically used after the fact. We wanted to build a tool that argues against the user's purchases, forcing them to think about whether they actually need the purchase or not.

What it does

Devil's Advocate is a Chrome extension that intercepts Amazon purchases. When you go to check out, a transparent overlay opens with a chart of your budget, income, and monthly spending on the left and a chat with an AI agent on the right. The agent has read your transaction history and argues against the purchase using your own data. If you bought jeans two days ago, it will say so and ask what's different about these. If you have a good reason, you can make your case. Account connection is optional, and the agent adjusts its judgment based on how much it knows about you. A companion app holds your settings and your history of past intercepts.

How we built it

  • Frontend: a Chrome extension (Manifest V3) with a React overlay mounted in a Shadow DOM so Amazon's styles can't break it. It catches "Place your order" clicks and shows the cart, the income split, a budget chart, recent transactions and a chat with the agent.
  • Banking data: Capital One's Nessie API, with seeded customers acting as mock bank connections. The user's income, fixed bills and savings are saved to Nessie, and purchases are logged back there. Linking a bank is optional: without one, it scores from the budget the user entered in the extension.
  • Backend: Python with FastAPI. At checkout it reads the user's Nessie data in parallel and condenses it into a compact snapshot (about 0.2 s warm). A pure-Python scoring function then turns that into a verdict: approve, nudge or block.
  • Agent: Claude, called from our backend with fixed money facts (price, bills, budget left, balance after), recent purchases and short notes on similar past checkouts. It only explains the verdict and answers follow-up questions. Any reply with a number not in the facts, or a mention of the scoring, is swapped for a template.

Challenges we ran into

  • Making the agent worth arguing with. Our first prompt scripted what to say for each verdict, so every response sounded the same ("Sleep on the decision."). We rewrote it around goals instead of scripts and gave it richer facts to link together.
  • Untrusted input. Item titles come from web pages and the user's chat replies are free text, so both are treated as data, never as instructions.
  • Optional connections. Simulated transactions had to stay hidden when no account is connected, then appear in the right order, exactly once, when one is.
  • Mock data. Nessie's default data is generic, so we wrote our own personas and seed history to make the demo believable.

Accomplishments that we're proud of

  • An agent that makes specific, personal arguments instead of generic finance advice
  • A full loop from intercept to chat to verdict to history, all working end to end
  • A design that keeps the agent honest by checking its claims against real data

What we learned

  • An agent is only as sharp as the facts you hand it. The best improvements came from better backend data, not cleverer prompts.
  • Loose prompts need firm integrity rules. Give the model freedom in style and tight limits on facts.
  • Doing the heavy computation up front makes the live experience feel instant.
  • Edge cases in simple-sounding features, like optional account linking, take real design work.

What's next for Devil's Advocate

  • Real bank connections through an aggregator like Plaid, replacing the Nessie mock with the same snapshot pipeline behind it
  • Multi-platform support outside of just Amazon
  • Mobile coverage with a Safari extension on iOS, plus bank and email receipt signals to catch purchases we can't intercept
  • Better agent personalization using user regret feedback about purchased products

Built With

Share this project:

Updates

Submission history