Inspiration
Freelancing has a trust problem.
Clients hesitate to pay before seeing results. Freelancers hesitate to deliver before knowing they'll get paid. Existing solutions often rely on expensive intermediaries, subjective reviews, or disputes after the damage is done.
We asked a different question:
What if payment itself could follow verified work, rather than promises?
We built ProofPay around one principle: define the agreement before money moves, verify the deliverable against measurable evidence, and let deterministic code, not an AI model, control the payout.
Our goal was to explore how PayPal's existing payment infrastructure could support a more transparent, evidence-driven way to pay for digital work without introducing cryptocurrency or requiring users to manage wallets.
What it does
ProofPay is an AI-verified, PayPal-powered payment settlement system that connects agreed work to proportional payments.
It transforms a freelance agreement into an evidence-based settlement process through five stages:
1. AGREE: Turn agreements into measurable criteria
The client describes the project in natural language. Gemini converts it into 4–5 objectively checkable criteria, assigning weights that total 100%. Both parties review the criteria before funding.
2. HOLD: Reserve the payment
The client authorizes the full amount through the PayPal Orders API. The authorization reserves the funding amount without immediately capturing it.
3. DELIVER: Submit actual work
The freelancer submits a live website URL or public GitHub pull request as evidence of completed work.
4. VERIFY: Combine deterministic checks with AI reasoning
ProofPay uses a hybrid verification engine:
- Deterministic DOM checks validate structural requirements.
- Gemini evaluates criteria that require contextual judgment.
- Failed deterministic checks cannot be overridden by AI.
- Every criterion produces a PASS/FAIL result with supporting evidence.
Submitted content is treated as untrusted data, with suspicious instructions flagged as potential tampering.
5. SETTLE: Calculate and execute the payout
This is ProofPay's defining architectural decision.
The AI never determines payment amounts or directly controls payment APIs.
Instead, the backend calculates:
Payout = Round(Deal Amount × Earned Weight / 100, 2)
PayPal captures the calculated amount using partial authorization capture with final_capture: true, releasing the unused remainder. If no criteria pass, the authorization is voided.
The captured amount is then sent to the freelancer through PayPal Payouts.
The result: payment follows verified work, and financial authority remains entirely in deterministic server-side logic.
Verified PayPal Sandbox Results
We tested the complete settlement workflow using deployed application instances and PayPal sandbox accounts.
- Complete deliverable: 100% verification → $10 captured
- Missing contact form: 70% verification → $7 captured, $3 released
- No meaningful content: 0% verification → authorization voided
- Hidden instructions targeting AI: 0% verification → tamper warning, nothing captured
The settlement ledger displays actual identifiers returned by PayPal, including order, authorization, capture, and payout batch IDs.
These are sandbox transactions, not real-money payments.
Built for AI Agents and Humans
ProofPay is not limited to a human-operated interface.
Every major workflow step is exposed through JSON API endpoints, allowing an AI agent to create agreements, retrieve criteria, submit deliverables, initiate verification, and trigger settlement.
The buyer's PayPal approval remains a human-controlled step, as required by the payment flow.
This makes ProofPay an agent-compatible payment infrastructure experiment rather than simply another AI-powered freelance dashboard.
How we built it
We designed ProofPay around a strict separation of responsibilities: AI interprets evidence, deterministic code enforces rules, and PayPal executes payments.
Technology Stack
- Frontend: React, TypeScript, Tailwind CSS and Vite.
- Backend: Node.js, Express and TypeScript.
- AI Engine: Google Gemini 2.5 Flash for agreement interpretation and evidence evaluation.
- Structural Verification: Cheerio for deterministic DOM inspection.
- Payment Infrastructure: PayPal Orders v2, Payments API and Payouts API.
- Development: Google AI Studio for initial scaffolding, followed by manual implementation, debugging and sandbox testing.
Payment Architecture
- PayPal Orders API creates orders using
intent: AUTHORIZE. - PayPal Payments API authorizes funds, partially captures earned amounts, and voids fully failed authorizations.
- PayPal Payouts API transfers captured funds to the freelancer.
- Unique
PayPal-Request-Idvalues are used for payment POST requests.
Security and Reliability
We implemented several safeguards:
- API credentials remain on the backend.
- Submitted URLs are restricted using private-address and localhost checks.
- Deliverable fetching has a 20-second timeout and 40,000-character limit.
- Untrusted submitted content is isolated from verifier instructions.
- Deterministic checks run before AI evaluation.
- Payment amounts are calculated independently of model output.
- Payment records display actual provider-returned identifiers.
Challenges we ran into
Building ProofPay exposed problems that a typical AI prototype would not encounter.
1. Payment infrastructure and regional sandbox restrictions
Our initial PayPal sandbox accounts, configured for India, rejected USD transactions with a currency acceptance error. We investigated the issue and configured US sandbox accounts to test the intended payment workflow.
2. Making AI verification resistant to manipulation
An LLM that evaluates submitted content can be manipulated by instructions embedded in that content. We addressed this by introducing deterministic checks before AI evaluation and treating submitted material as untrusted input.
3. Separating AI decisions from financial authority
We deliberately avoided allowing model-generated amounts to reach payment APIs. The model returns criterion-level decisions and evidence; the backend independently calculates the settlement amount.
4. Making payment records trustworthy
During development, we discovered that fallback behavior could make failed operations appear successful. We removed misleading identifiers and ensured the settlement ledger displays only identifiers actually returned by PayPal.
5. Understanding the difference between authorization and escrow
A PayPal authorization is not equivalent to holding funds in a regulated escrow account. We had to understand the payment lifecycle, authorization validity, partial capture behavior, and the limitations of the sandbox integration.
These challenges changed the architecture, not just the interface.
Accomplishments that we're proud of
- Built an end-to-end PayPal payment workflow covering authorization, partial capture, release of unused funds, voiding, and freelancer payouts.
- Demonstrated proportional settlement using actual PayPal sandbox responses.
- Designed a hybrid AI and deterministic verification engine.
- Established a strict separation between AI-generated decisions and financial execution.
- Implemented tamper detection for adversarial instructions embedded in submitted deliverables.
- Exposed the workflow through agent-friendly JSON APIs.
- Created a transparent settlement ledger backed by payment-provider identifiers.
- Documented technical limitations instead of presenting a sandbox prototype as production-ready escrow infrastructure.
Our biggest accomplishment is not simply integrating AI with PayPal. It is designing a system where AI can evaluate work without having the authority to move money.
What we learned
Building ProofPay taught us that introducing AI into financial infrastructure requires more than accurate model outputs.
It requires clear boundaries around authority, deterministic execution, verifiable evidence, and failure handling.
We learned that:
- AI should interpret ambiguous information, not control financial execution.
- Deterministic verification is essential when decisions have monetary consequences.
- Payment authorization, capture, release, and payout are distinct financial operations.
- Agent-compatible infrastructure needs explicit human approval boundaries.
- Honest limitations are part of responsible engineering.
The most important lesson: In financial systems, intelligence should inform decisions, but authority must remain controlled, predictable, and auditable.
What's next for ProofPay
ProofPay currently demonstrates its core workflow in the PayPal sandbox. Our next goal is to evolve it into production-ready infrastructure.
1. Persistent Infrastructure
- Replace in-memory storage with PostgreSQL.
- Introduce durable deal records and transaction history.
- Implement PayPal webhooks for asynchronous payment events.
2. Stronger Verification
- Add browser-based rendering and screenshot comparisons.
- Validate mobile responsiveness and accessibility.
- Introduce functional testing rather than relying primarily on structural checks.
3. Trust and Dispute Resolution
- Introduce human review for disputed verification results.
- Add an auditable decision history.
- Improve handling of failed captures and authorization expiration.
4. Marketplace Integration
- Investigate PayPal-supported marketplace payment products and delayed disbursement options.
- Explore integrations with freelance platforms and autonomous AI agents.
- Validate production payment eligibility and compliance requirements with PayPal.
Our long-term vision is to make ProofPay a reliable payment-verification layer for digital work, where clients pay for measurable outcomes and freelancers receive transparent, evidence-based compensation.
ProofPay: Agree on the work. Verify the result. Pay what is earned.
Built With
- node.js
- paypal
- paypalsandbox
- react
- typescript