Last night my AI agent paid a law firm at 3 in the morning. I was sleeping. The agent was sleeping too, most of the time. That was the whole point.
Let me explain.
The problem
I live in Costa Rica. If you want to open a company here to buy land or run a hotel, you need a law firm. They file papers in the national registry, you wait weeks, and you pay before you can really check anything. You just trust them.
Some time ago I built a project called Pacta. It is a marketplace where small businesses put real money on the table as a promise that they will do the work. If they cheat, they lose that money. And every job is backed by public registry records, so the work can be checked.
But one side was still manual: the buyer. Someone still had to search providers, compare them, sign, pay the deposit, chase the paperwork, and check every document. That someone was me.
So for Google's hackathon I built the missing piece. I called it ProofPay.
What it does
You give ProofPay a goal and a budget. Something like "form a company in Costa Rica to run a hotel, budget $6,000". That is it.
The agent searches the marketplace and compares the offers. It does not pick the cheapest one. It picks the one with the most money at risk and the best history, because a provider with skin in the game is a safer bet. Then it signs the contract and puts the deposit in escrow.
And then it goes to sleep. For real. The program shuts down. There is no loop running, nothing burning money in the background. Hours or days can pass.
When the provider finishes the work, a message wakes the agent up. And here comes my favorite part: the agent does not trust anyone. It takes every registry certificate and checks it again, directly at the source, at the moment of paying. Then a small piece of code runs five simple checks. If all five pass, the money moves. If one fails, the money stays, a dispute opens, and the provider loses part of the money they put on the table.
The one rule I never broke
The AI never touches the money.
Gemini does the thinking: it picks the provider, it reads the proofs, it gives its opinion, it even writes the complaint when something is wrong. But the final decision is made by plain code that anyone can read. The AI can say "do not pay, something smells bad" and stop a payment. It can never say "pay". I think that is the only honest way to let an agent handle money today.
The demo I love showing
Here is a fun question: what if a document was real when the provider sent it, but someone cancels it later? Like a permit that gets revoked.
The platform already checked it and said everything was fine. But my agent checks again right before paying. In the demo, the certificate is gone, the registry says "this does not exist anymore", and the agent refuses to pay. The provider loses $1,000 of the money they had at risk. Two checks, at two different moments, and the interesting part is when they do not agree.
Where I messed up
My first long test failed, and not because of the AI.
I set up a mission that should sleep for a day and a half. But I had one setting wrong, a simple time limit. So at hour 24 the agent woke up, saw no delivery, and opened a dispute. It did exactly what I built it to do. The bad setting was mine.
I fixed it, launched it again, and wrote the mistake in the project log for everyone to see. Lesson: if your agent handles money, the boring settings deserve as much care as the smart prompts.
Try it
The live demo takes two minutes. You press one button and watch the agent hire a real provider, sleep, wake up, check everything, and pay. In front of you.
Demo: https://proofpay-agent-305908094913.us-central1.run.app/
Code: https://github.com/JafCR/ProofPay
Built with Gemini, Google's agent tools, and Google Cloud for the All Things Agentic Hackathon.
Top comments (0)