Inspiration

We kept seeing the same failure: companies hand out compute credits, teams hoard them, and nobody can move them back safely — so credits expire unused while other teams run out. Hackathon deadlines make it worse: a fast-moving credit system that "mostly works" is scarier than no system at all. We wanted to show what it looks like when an AI agent handles credit moves, but the money math never trusts the AI — the database enforces every rule.

What it does

JRR Token (Just Really Reliable) is a demo of an issuer-controlled compute-credit program. Teams request to return or reallocate credits. An AI agent processes each move step by step — reading the rules, checking balances, reserving funds, applying the move, reconciling — but every money-changing step runs through locked-down database functions the AI can't bypass.

You can toggle between two versions of the agent:

  • v1 (the naive agent) — trusts the model, skips checks, and lets money move that shouldn't. The Reconciliation page goes red.
  • v2 (the reliable agent) — follows a fixed order, and the database enforces budget caps, per-team limits, expiry dates, and eligibility. Runs reconcile cleanly.

Every run is logged in an append-only audit trail, and every AI step is traced live to PRISM so you can watch the agent think.

How we built it

  • The app — React (TanStack Start) with seven pages: Program, Wallet, Queue, Reconcile, Audit, Demo Control, and a How-to-use guide with a stage diagram.
  • The database — Postgres (Lovable Cloud) with an issuer ledger, reservations, and an append-only event log. The money functions (reserve, apply, reconcile) are SECURITY DEFINER and own all arithmetic; the AI only calls tools.
  • The agent — server-side loop with nine tools (get rules, check balance, reserve, apply, reconcile, flag for admin…). It runs on Nicrron's gateway (Claude Haiku), with automatic fallback if Nicrron is down.
  • PRISM — every model call is traced live to PRISM's dashboard, grouped per operation, so v1 vs v2 behavior is visible step by step.
  • Demo controls — seed sample data, snapshot the ledger, reset, switch v1/v2, and run a batch of operations in parallel.
  • Narration — an animated walkthrough video with an ElevenLabs anime-girl voice from our cat-wizard mascot, who also sits in the header.

Challenges we ran into

  • Getting the trust boundary right: it's tempting to let the agent compute amounts, but that's the bug. Moving all math into database functions meant designing idempotent operations, reservation expiry, and reconciliation from scratch.
  • Making v1 fail reliably — a demo where the "bad agent" sometimes succeeds is a bad demo. We tuned scenarios so v1 deterministically overdraws, and reset always restores a clean snapshot.
  • Keeping the ledger append-only: we had to add triggers blocking updates/deletes on the audit trail so even the demo can't rewrite history.
  • The classic race: two runners claiming the same operation. Solved with a conditional status update (requested → processing) so only one runner wins.

Accomplishments that we're proud of

  • A working before/after demo in one app: flip one toggle and watch the same batch go from red (mismatched ledger) to green (fully reconciled).
  • An append-only audit trail with every AI decision recorded, plus live PRISM tracing of every step.
  • The AI never touches money: in v2, an agent that tries to invent an amount simply fails — the database says no.
  • A presenter-ready package: guided walkthrough page, animated narrated video, and one-click reset between demos.

What we learned

  • "The model decides, the database guarantees" is a genuinely useful pattern: agent flexibility where it's safe, hard rules where it isn't.
  • Observability changes the story — with PRISM traces, you don't just claim the v2 agent is safer, you show the exact step where v1 went wrong.
  • Reconciliation isn't overhead; it's the feature. If the ledger can prove itself after every run, trust comes free.

What's next for JRR Token

  • Multi-issuer programs and partial returns.
  • Human-in-the-loop approvals for flagged operations, not just an admin queue.
  • Streaming PRISM traces into the Queue page live during a demo.
  • Publish the agent loop for real integration — Nicrron's actual credit APIs instead of the simulated issuer.

Built With

  • block
  • convey
  • elevenlabs
  • nicrronninoo
  • prism
Share this project:

Updates

Submission history