Inspiration
A freelancer says the work is done. Before collecting a milestone payment, someone still needs to compare the delivery report with the agreement. PayGuard makes that comparison visible, with a reason and source quote for each requirement.
What it does
PayGuard connects a fixed acceptance checklist, local AI review, and PayPal Sandbox payments.
Each requirement is marked met, missing, or uncertain. Missing or uncertain requirements block capture. A human operator must review the evidence and confirm permission before collection.
The payment flow creates a PayPal order, sends the buyer to approval, authorizes the payment, and captures it after the review gate. The application records a successful capture only when PayPal returns COMPLETED.
How we built it
The backend uses Python's standard library and SQLite. Qwen2.5 7B runs locally through Ollama, without a paid AI API.
Each requirement is evaluated separately with a stable identifier. The backend rejects mismatched results and checks that positive verdicts include a quotation found in the supplied evidence.
AG Grid Community displays a sortable, filterable review table with CSV export. A button runs the included local component tests and loads their generated report.
PayPal OAuth, Orders v2, and Payments v2 calls run server-side. Credentials stay in environment variables. Capture requires explicit operator confirmation and matching evidence hashes. A failed re-review clears any previous approval.
Challenges we faced
Early model responses confused explicit non-delivery with missing information and assigned explanations to the wrong requirements. Separate requests, stable identifiers, a clearer rubric, and labelled examples improved the observed results.
Windows testing also exposed SQLite connections that remained open after transactions. Explicit connection closure and a regression test resolved the observed file-lock failure.
What we demonstrated
The negative example was classified missing. An explicitly illustrative report was classified uncertain. A report from nine passing local component tests was classified met.
A previous working run completed a USD 25 PayPal Sandbox payment after buyer approval, authorization, AI review, and human confirmation. The video shows its saved application export with a capture reference and COMPLETED status. No real money moved.
The final source includes sixteen passing workbench tests and nine local component tests. These functional checks are not a general model-accuracy benchmark, and the earlier Sandbox transaction was not repeated on the final release.
What we learned
A source quotation improves traceability but does not prove that a report is true or that an explanation fully supports a requirement. Payment decisions need clear scope, conservative failure handling, and human review.
Scope and next steps
The included delivery component is a generic local HMAC-signed event receiver. It is not a deployed store or a PayPal webhook verifier. The AI assesses supplied reports; it does not independently execute submitted code or prove delivery.
PayGuard is a single-operator local prototype, not a production payment service or regulated escrow system. Next steps include independently collected CI evidence, verified PayPal webhooks, authenticated buyer and seller roles, and broader adversarial evaluation.
AI disclosure
AI coding assistance was used during development. Runtime evidence reviews use Qwen2.5 7B locally through Ollama. Human confirmation remains required before Sandbox capture.