Inspiration
AI is becoming remarkably good at giving answers. But knowing when to ask for help is a different kind of intelligence.
Imagine an AI reading a receipt with a folded corner, an obscured total, or a confusing discount. It could guess. It could stop processing. Or it could send every document for manual review.
None of those options is ideal.
We started HumanBridge with a question: What if an AI system could identify when human judgment is worth the cost—and responsibly pay for that judgment?
We wanted to build more than a human-in-the-loop demonstration. We wanted to connect AI uncertainty, human verification, requester approval, and real payment settlement into one accountable workflow.
That became HumanBridge: AI that knows when to ask.
What it does
HumanBridge is an AI-powered document verification workflow that recommends targeted human review when the evidence is uncertain.
Here's how it works:
- AI analyzes the document. A requester uploads a receipt. Google Gemini performs two structured extraction passes.
- HumanBridge checks the evidence. The system compares AI readings and applies deterministic validation for missing information, conflicting values, discounts, taxes, charges, and arithmetic inconsistencies.
- Uncertainty triggers a review recommendation. Instead of sending every document to a person, HumanBridge identifies cases that warrant closer inspection and explains why.
- A human verifies the relevant information. The reviewer receives a scoped task and submits a response.
- The requester makes the final decision. They compare the AI and reviewer values, inspect conflicts, and explicitly accept or reject the work.
- PayPal settles the approved service fee. HumanBridge captures the accepted verification charge against a previously authorized Sandbox budget.
The central idea is simple: AI handles routine reading. Humans handle uncertainty. PayPal handles authorized payment.
How we built it
We built HumanBridge with React, Vite, Tailwind CSS, Python, FastAPI, SQLite, Google Gemini, and the PayPal Developer Platform.
Gemini provides multimodal receipt understanding through two separately prompted extraction passes. The FastAPI backend validates structured results and uses deterministic checks rather than relying on an unexplained confidence score.
SQLite persists document readings, review decisions, budget state, and payment references. The frontend brings these into a single workflow where requesters can inspect evidence and make informed decisions.
Our PayPal integration
PayPal is a core part of the workflow—not a checkout button added at the end.
Using the PayPal Developer Dashboard, we configured Sandbox merchant and buyer accounts and registered a REST application.
We integrated:
- PayPal Orders v2 to create orders with authorization intent and obtain buyer approval.
- PayPal payment authorization to establish a verification budget.
- PayPal Payments v2 to capture approved review-service charges.
- Authenticated PayPal API read-back to confirm actual capture status and amount.
HumanBridge enforces review fees and spending limits on the server. Payment success is based on verified PayPal state, not a frontend confirmation message.
The prototype uses a designated verification-service merchant. It does not claim to provide escrow or direct payouts to arbitrary reviewers.
Challenges we ran into
Distinguishing uncertainty from an actual error. Two AI readings can agree and still be wrong. They can also disagree on a supporting field while correctly identifying the final total. We designed HumanBridge to surface evidence and inconsistencies rather than present every review recommendation as proof of an AI mistake.
Getting receipt arithmetic right. An early version incorrectly flagged a valid receipt because it ignored a discount. We fixed the underlying validation logic to handle discounts, additional charges, rounding adjustments, and included amounts using decimal-safe calculations.
Making human approval accountable. In one test, a requester accepted a reviewer-submitted total that conflicted with the receipt arithmetic by one cent. The payment worked, but the verification decision was questionable. We added conflict warnings and required explanations for certain inconsistent acceptances.
Managing real payment states. PayPal authorization, buyer redirects, captures, and cancellations require careful state management. We had to ensure that retries, browser reloads, and payment responses could not create misleading success states or bypass the budget policy.
Evaluating the system without overstating results. In our initial six-receipt evaluation, both Gemini readings correctly matched all six known totals. HumanBridge selected no reviews. That result did not establish an accuracy advantage, so we documented it honestly. Separate degraded-receipt tests demonstrated genuine uncertainty-triggered review behavior, including an unreadable cropped total.
Accomplishments that we're proud of
1. We completed a real PayPal Sandbox settlement.
In a verified end-to-end transaction, HumanBridge authorized USD 5.00, accepted a USD 0.75 review service, and captured USD 0.75 with final_capture=true.
PayPal's authenticated API confirmed the capture as COMPLETED. The remaining USD 4.25 was not captured.
This was an actual Sandbox transaction—not a mocked success screen.
2. We connected real AI decisions to real financial operations.
The application combines live Gemini extraction, validation, reviewer input, requester acceptance, and PayPal settlement in a coherent workflow.
3. We made uncertainty explainable.
HumanBridge reports concrete reasons for review, such as missing fields, arithmetic conflicts, or disagreement between AI readings. It doesn't pretend that a model-generated confidence number is sufficient evidence.
4. We built safeguards around human decisions.
Reviewers cannot simply trigger payment by submitting an answer. The requester retains approval authority, with additional checks for conflicting corrections.
5. We made the prototype reproducible.
Our local release passed 33 backend tests, 12 automated Chrome regression tests, a production frontend build, and clean-clone installation checks. We also published the source code, setup instructions, synthetic test materials, and evaluation methodology.
What we learned
The most important lesson was that automating a task and knowing when to trust its result are two different problems.
We learned that:
- AI agreement does not automatically guarantee correctness.
- Validation rules must themselves be tested against real-world document structures.
- Human approval needs evidence and accountability.
- Financial workflows require authoritative state verification.
- A successful payment does not prove the underlying answer was correct.
- Honest evaluation is more valuable than an impressive but unsupported metric.
We also learned how to translate a product decision into an actual PayPal authorization-and-capture workflow, while keeping approved spending under backend control.
Building HumanBridge made us think less about replacing humans and more about designing better collaboration between humans, AI systems, and financial infrastructure.
What's next for HumanBridge
HumanBridge is currently a working prototype focused on receipt verification.
Our next priorities are to evaluate it on larger and more representative datasets, measure when human review genuinely improves outcomes, and strengthen the security and operational requirements for broader deployment.
We also see applications beyond receipts: invoice processing, claims verification, financial document analysis, and other AI workflows where uncertain information can lead to consequential decisions.
The longer-term vision is an infrastructure layer where AI systems can recognize the limits of their evidence, request human expertise when justified, and connect approved work to accountable payments.
The future of AI isn't just about making systems more autonomous. It's also about making them more responsible when they need help.
HumanBridge — AI that knows when to ask.