Inspiration
Credit funds get payment requests by email every day: margin calls, loan draws, wire instructions. Someone has to read each one, recompute the numbers from the fund's own data, and decide whether to pay. Overcharges slip through, and a single phishing email with new wire details can move millions. We wanted an AI that does the reading and the math, with rules it physically cannot break.
What it does
Cosign reads an incoming payment request, recomputes it from source data (positions, agreements, haircuts), and proposes only the verified amount. The money sits in a Solana vault program that enforces the rules on-chain:
- Overcharge: a $2.4M margin call is recomputed to $1.9M verified, with $0.5M disputed and the clause that shows why. Payments above the large-amount limit need two human approvals before they can execute.
- Bad loan request: a $5M draw is rejected because only $3M remains under the facility.
- Attack: a compromised agent tries to pay a phishing wallet. The program rejects it because the wallet is not an approved payee, a newly added payee stays timelocked, and the kill switch blocks the agent from proposing anything else.
How we built it
- Solana program (Rust, Anchor) holding the vault, payee allowlist, approval rules, timelock, per-transaction limit and kill switch, deployed to devnet.
- Backend (Node, Fastify) with a Gemini parser that turns emails into structured requests, plus a plain-code verification engine so the math never depends on the model.
- Frontend (Next.js, React, Tailwind): inbox, request detail with the recomputed lines next to the original email, a payment ticket with approval signatures, an audit trail with Solana Explorer links, a vault view, and an attack lab that shows the on-chain error when the attack fails.
- A shared contract file for every data shape and error code, so four people could build in parallel against mocks.
Challenges we ran into
Keeping the frontend, backend and program in sync while all three changed overnight. We froze a shared contract early and built the UI on mock data that matched it, then added runtime checks that flag when a real response does not match the contract.
Accomplishments that we're proud of
The attack demo: even with the agent fully compromised, the payment fails on-chain, and the UI shows exactly which rule stopped it.
What we learned
How margin calls and loan draws actually work, how to write Anchor programs, and that the LLM should read documents but plain code should do the math.
What's next for Cosign
Enforce the daily cap on-chain, connect a real inbox, and add a mobile approver so signers can approve from their phone.
Built With
- anchor
- fastify
- gemini
- next.js
- node.js
- react
- rust
- solana
- tailwind-css
- typescript
Log in or sign up for Devpost to join the conversation.