ClearLine — the autonomous credit desk

An AI credit analyst for order-to-cash: it buys the evidence it needs per request over x402, decides trade credit under a deterministic policy, escalates with a brief when it must, learns from the human's answer, and defends every decision from a hash-chained record.

Inspiration

Every distributor has a person who decides whether a net-30 order ships. They juggle a bureau login, a bank portal, an AR aging report and "what we did last time". Hyphenate's framing — automate a task or own the work to an outcome — made me ask what it would take to actually hire an agent into that seat: a wallet with a cap, a signing limit, a manager to ask, and a clean record.

Aside from that, 2 weeks ago I joined the Berkeley Blockchain hackathon where I first got access to agent finance and while I can think of agents helping people buy stuff, the most valuable use case is for businiesses. This is the main reason I discussed with AI and came up with the idea and the solution even if I lacked some prior knowledge.

What it does

Eight messy net-30 orders hit the queue. For each, ClearLine reads the order and our ledger, decides which data is worth paying for, buys it through an x402 gateway (CRS tri-bureau credit, identity + OFAC, Capital One Nessie cash flow), runs a policy that produces the decision, limit and ECOA-style reason codes, records a rationale or escalates with a brief, and logs everything to a hash chain. A human can approve, modify or decline an escalation — that becomes a precedent the agent applies next time — and can challenge any decision and get an answer grounded only in the audit record.

The moment: SO-10420 looks clean on paper; the identity check shows a synthetic-looking guarantor and a 20-day-old shell account. ClearLine holds $27k of inventory and writes the fraud brief.

How I built it

Python/Starlette backend, vanilla-JS ops console over SSE. Claude (tool use) drives the workup and writes the rationale; the policy is a plain Python module the credit manager can own. x402 is implemented from the v2 spec on both sides (402 → PAYMENT-SIGNATURE → facilitator verify/settle → PAYMENT-RESPONSE), with real EIP-3009 USDC authorizations on Base Sepolia. CRS sandbox for credit/IDV, Nessie seeded via API for bank cash flow. Every integration has a mock twin so the demo cannot die on venue wifi, and every data object carries a source label so the judges can see what's real.

Testing it on real data

The demo queue is hand-built, so I tested the claims behind it offline (details in docs/DATA.md):

  • Is bureau data worth buying? On Kaggle's Home Credit Default Risk dataset (307k real applications with real Credit Bureau records and outcomes), adding bureau data cut credit granted to people who later struggled to pay by 5–16% at the same approval rate. Buying it only for the most borderline 30% kept 61–75% of that gain. This is the reasoning behind ClearLine buying pulls per order instead of always running a full workup.
  • Red team. Real SBA 7(a) small-business borrowers plus a Claude fraud agent with a budget and a fixed menu of moves, adapting each round to the reason codes it got back. It found a real gap: a synthetic identity split into small orders that skipped the identity check. In another scheme, the analyst escalated a stolen identity that the rules alone would have approved.

Challenges

Keeping the model honest: it is tempting to let the LLM "decide". I made record_decision refuse any decision that doesn't match policy, enforced authority and budget in code, and auto-escalate if the model stops. Settling payments for failed pulls: I only settle on 2xx; 503s are voided and visibly unpaid.

Accomplishments

75% of a deliberately nasty queue decided autonomously with the right answers, two correct escalations, one fraud catch, a bureau outage survived, a wallet that ran dry gracefully, and a human override that became a standing approval — all on a verifiable chain.

What I learned

"Knowing when to ask" is a product feature, not a prompt. Budgets, authority and precedents are the difference between a chatbot that reads JSON and a colleague you would give a seat to.

What's next

ERP connectors (open orders + AR aging), policy versioning with approvals, dunning and dispute workflows, and selling the decision itself over x402 so other agents can buy an underwritten verdict.

Built With

  • capital-one-nessie
  • claude-(tool-use)
  • coinbase-x402-(base-sepolia
  • crs-credit-api
  • kaggle-(home-credit-default-risk)
  • python
  • sba-7(a)-foia-data
  • scikit-learn
  • server-sent-events
  • starlette
  • usdc)
Share this project:

Updates

Submission history