AI-powered guardrails for your business finances. Your money moves only when you say so.
Built for the Auth0 "Authorized to Act" Hackathon
Live Demo: https://ledgerlock-git-main-estherea07s-projects.vercel.app Youtube Demo Video: Demo Video GitHub: https://github.com/estherea07/ledgerlock
Staff fraud costs SMEs billions annually β not through elaborate hacking, but through simple payment diversion. Employees give customers their personal account numbers instead of the company's. They transfer business funds to fake vendors. They exploit the gap between "someone initiated a payment" and "the owner noticed."
LedgerLock closes that gap with an AI agent named Elf who monitors every transaction, verifies every payment link, and never lets credentials leave a secure vault.
| Feature | Description |
|---|---|
| π€ Elf AI Agent | LangGraph-powered agent analyses every transaction against your policies in real time |
| π Auth0 Token Vault | All bank/payment credentials stored encrypted - staff never see raw keys |
| π² CIBA Step-up Auth | High-risk transactions push to owner's phone for one-tap approve/deny |
| π Verified Payment Links | Links locked to company account - customers always pay the business, not an employee |
| π Staff Risk Scoring | Elf tracks payment behaviour per employee and flags patterns early |
| π Audit Log | Every Elf action logged with Auth0 reference - tamper-proof |
| Layer | Technology |
|---|---|
| Frontend | Next.js 14 (App Router), TypeScript, Tailwind CSS |
| AI Agent | LangGraph, Anthropic Claude Haiku (claude-haiku-4-5-20251001) |
| Auth & Identity | Auth0 for AI Agents - Token Vault + CIBA, @auth0/nextjs-auth0 |
| Database | Prisma ORM + PostgreSQL (Neon) in production, SQLite locally |
| Payments | Paystack (via Token Vault) |
| Notifications | Twilio WhatsApp/SMS (via Token Vault) |
| Deployment | Vercel |
- Node.js 18+
- Git
- Auth0 account (free at auth0.com)
- Anthropic API key (free credits at console.anthropic.com)
git clone https://github.com/estherea07/ledgerlock.git
cd ledgerlock
npm install --legacy-peer-depscp .env.example .env.localOpen .env.local and fill in:
# Auth0 β from your Auth0 dashboard at manage.auth0.com
AUTH0_SECRET='run: node -e "console.log(require(crypto).randomBytes(32).toString(base64))"'
AUTH0_BASE_URL='http://localhost:3000'
AUTH0_ISSUER_BASE_URL='https://YOUR_TENANT.us.auth0.com'
AUTH0_CLIENT_ID='your_regular_web_app_client_id'
AUTH0_CLIENT_SECRET='your_regular_web_app_client_secret'
AUTH0_AUDIENCE='https://YOUR_TENANT.us.auth0.com/api/v2/'
AUTH0_TOKEN_VAULT_URL='https://YOUR_TENANT.us.auth0.com'
AUTH0_MGMT_CLIENT_ID='your_m2m_client_id'
AUTH0_MGMT_CLIENT_SECRET='your_m2m_client_secret'
# Database (SQLite for local dev)
DATABASE_URL='file:./ledgerlock.db'
# Anthropic β free credits on signup
ANTHROPIC_API_KEY='sk-ant-your-key'
# Paystack β use TEST keys (free, no real money)
PAYSTACK_SECRET_KEY='sk_test_your_key'
PAYSTACK_PUBLIC_KEY='pk_test_your_key'
# App
NEXT_PUBLIC_APP_URL='http://localhost:3000'
NEXT_PUBLIC_APP_NAME='LedgerLock'- Go to auth0.com β create free account β create tenant
- Applications β + Create Application β Regular Web Application β name it
LedgerLock - In Settings tab:
- Allowed Callback URLs:
http://localhost:3000/api/auth/callback - Allowed Logout URLs:
http://localhost:3000 - Allowed Web Origins:
http://localhost:3000
- Allowed Callback URLs:
- Applications β + Create Application β Machine to Machine β name it
LedgerLock M2M- Select Auth0 Management API β grant scopes:
read:users,update:users
- Select Auth0 Management API β grant scopes:
- Authentication β Social β GitHub β enable Connected Accounts for Token Vault
- Applications β APIs β Auth0 My Account API β Application Access β authorize LedgerLock
npx prisma db push
npx prisma generate
npm run devnpx ts-node prisma/seed.tsThis loads Greenfield Laundry Ltd with 3 staff members, sample flagged transactions, and demo vault tokens.
Once running (local or live), do this to see all features:
1. Sign in with GitHub via Auth0
2. Add a staff member - Staff β Add Staff Member β name: "David Kalu", role: Sales Rep
3. Test Elf blocking a transaction - Payments β New Payment Request:
- Amount: β¦200,000
- Description: "transfer to personal account"
- Submit β Elf blocks immediately (score: critical)
4. Test Elf flagging for CIBA - New Payment Request:
- Amount: β¦85,000
- Vendor: "Apex Supplies Ltd"
- Submit β Elf flags (new vendor + over limit) β CIBA approval required
5. Test auto-approval - New Payment Request:
- Amount: β¦5,000
- Vendor: "EKEDC"
- Description: "electricity bill"
- Submit β Elf auto-approves (low risk, known vendor)
6. Generate a verified payment link - Payment Links β Generate Verified Link
- See how the URL is locked to company account via Token Vault
7. Connect a service to vault - Token Vault β Connect Service
- See how only a reference ID is stored, never the raw key
Business Owner
β
βΌ
Connects API credentials β Auth0 Token Vault (encrypted, never in our DB)
β
βΌ (only tokenRef stored in LedgerLock DB)
Elf Agent (LangGraph 6-node pipeline)
β
βββ load_policies β fetch owner's guardrails from DB
βββ policy_check β rule-based risk scoring
βββ anomaly_detection β Claude Haiku AI reasoning
βββ make_decision β approve / flag / block
βββ trigger_ciba β Auth0 CIBA push to owner's phone (if flagged)
βββ persist_and_notify β log everything, update risk scores
β
βΌ (API calls go through Token Vault - Elf never sees raw credentials)
Bank API / Paystack / Twilio
- Push to GitHub
- Go to vercel.com/new β import repo
- Add all
.env.localvariables in Vercel β Environment Variables - Change
DATABASE_URLto a PostgreSQL connection string (free at neon.tech) - Change
AUTH0_BASE_URLandNEXT_PUBLIC_APP_URLto your Vercel domain - Update Auth0 Allowed Callback URLs to include your Vercel domain
- Deploy
src/
βββ app/
β βββ api/
β β βββ agent/route.ts # Direct Elf agent endpoint
β β βββ audit/route.ts # Audit log API
β β βββ auth/[auth0]/route.ts # Auth0 handler β login, callback, logout
β β βββ dashboard/route.ts # Aggregated metrics
β β βββ links/route.ts # Generate verified payment links
β β βββ onboarding/route.ts # First-time business setup
β β βββ payments/route.ts # Payments list
β β βββ payments/ciba/route.ts # CIBA approve/deny for payments
β β βββ staff/route.ts # Staff management
β β βββ staff/suspend/route.ts # Suspend a staff member
β β βββ transactions/route.ts # Submit transactions to Elf
β β βββ transactions/ciba/route.ts # CIBA approve/deny for transactions
β β βββ vault/route.ts # Token Vault connections
β β βββ webhook/paystack/route.ts # Paystack payment webhooks
β βββ audit/page.tsx # Full audit log
β βββ dashboard/page.tsx # Owner dashboard
β βββ links/page.tsx # Payment link management
β βββ onboarding/page.tsx # First-time business setup
β βββ pay/[reference]/page.tsx # Public payment page (customer-facing)
β βββ payments/page.tsx # Transaction list + CIBA approval UI
β βββ staff/page.tsx # Staff risk monitoring
β βββ vault/page.tsx # Token Vault UI
β βββ globals.css
β βββ layout.tsx
β βββ page.tsx # Landing page
βββ components/
β βββ dashboard/
β β βββ AlertsPanel.tsx
β β βββ ElfInsight.tsx
β β βββ MetricsRow.tsx
β β βββ Sidebar.tsx
β β βββ StaffRisk.tsx
β β βββ TransactionList.tsx
β βββ links/
β β βββ GenerateLinkModal.tsx
β βββ payments/
β β βββ CIBACard.tsx
β β βββ NewTransactionModal.tsx
β βββ staff/
β β βββ AddStaffModal.tsx
β βββ ui/
β βββ Badge.tsx
β βββ Button.tsx
β βββ Card.tsx
β βββ EmptyState.tsx
β βββ Input.tsx
β βββ LoadingSpinner.tsx
β βββ Modal.tsx
β βββ Select.tsx
βββ hooks/
β βββ useDashboard.ts
β βββ usePaymentLinks.ts
β βββ useStaff.ts
β βββ useTransactions.ts
βββ lib/
β βββ agent/
β β βββ audit.ts # Audit log helper
β β βββ elf.ts # Elf LangGraph agent (core AI)
β β βββ payment-links.ts # Payment link generation helper
β βββ auth/
β β βββ auth0.ts # Auth0 helpers (legacy)
β βββ auth.ts # Auth0 Token Vault + CIBA helpers
β βββ db.ts # Prisma client
β βββ notifications.ts # Twilio via Token Vault
β βββ paystack.ts # Paystack via Token Vault
βββ types/
β βββ index.ts # TypeScript interfaces
βββ middleware.ts # Auth0 route protection
MIT Β© 2026 LedgerLock
Built with Auth0 for AI Agents, LangGraph, Anthropic Claude, and a conviction that SME owners deserve financial guardrails that actually work.