Inspiration

AI agents are becoming increasingly capable of negotiating, researching, and completing tasks on behalf of people. But when an agent hires another service or delegates work, an important question remains: how do we make sure the work is actually delivered before payment is released?

I wanted to explore this problem through the PayPal AI Hackathon. I was particularly interested in what happens when a service provider misses a requirement, requests an unexpected additional fee, or submits incomplete work. A conventional payment flow does not necessarily handle these situations well.

This inspired me to build ResolveAI: a platform that combines AI-powered service recovery with evidence-based milestone payments.

What it does

ResolveAI helps manage service agreements when work does not go as planned.

It brings together two AI agents: a buyer agent and a seller service agent. When a delivery problem occurs, they negotiate a recovery plan within the boundaries of the original agreement.

For example, if a seller requests an additional $5 to complete an incomplete deliverable, the buyer agent can reject the unauthorized fee and negotiate a recovery plan without changing the agreed budget.

ResolveAI also evaluates submitted work through a seven-check evidence validation process. It checks required sections, source citations, content length, relevance, duplicate content, and potential prompt injection.

Payment is handled separately from the AI negotiation process. A successful negotiation does not automatically authorize payment. Buyer acceptance and evidence validation are separate requirements, while deterministic backend checks enforce payment conditions.

The platform includes:

  • AI-powered buyer and seller negotiation with a limited number of rounds.
  • Evidence validation with explicit PASS, FAIL, and review outcomes.
  • Milestone-based payment tracking.
  • PayPal Sandbox authorization and capture integration.
  • An interactive financial and milestone dashboard built with AG Grid.
  • Hash-linked audit records for verifying the integrity of recorded events.
  • Payment safety checks, including budget limits and idempotency protections.

How I built it

I built ResolveAI as a full-stack web application using Next.js, React, and TypeScript.

The application uses AI-powered agent workflows for negotiation and structured responses. Ollama provides the local AI integration, while the backend remains responsible for enforcing agreement rules and deciding whether payment conditions have been met.

I used Prisma with SQLite for data persistence, storing agreements, milestones, evidence submissions, negotiation records, payment operations, and audit events.

For payments, I integrated the PayPal REST API and used the PayPal Sandbox environment to demonstrate authorization and milestone capture. The project successfully completed a USD 10.00 Sandbox milestone capture. I independently verified the PayPal-issued capture ID through the API and matched it against the Sandbox business transaction history.

AG Grid powers the interactive milestone command centre, making it easier to inspect payment amounts, captured amounts, and milestone statuses.

I also implemented automated tests using Vitest to test important evidence, agreement, and payment-safety rules.

Challenges I ran into

One of the biggest challenges was ensuring that AI-generated decisions could not directly control payments or change the original agreement.

An AI agent can propose a recovery plan, but its output cannot be treated as authorization. I had to separate the negotiation layer from the deterministic backend rules that enforce agreement limits, buyer acceptance, evidence requirements, and payment conditions.

Integrating PayPal Sandbox payments was another challenge. I needed to distinguish between a locally recorded payment operation and a transaction actually completed by PayPal. I added independent verification and reconciliation so that the application could check the PayPal transaction rather than simply trusting its own database record.

Evidence validation also required careful handling. A submission might pass content-length and relevance checks while still missing mandatory sections or valid citations. Critical failures must not be overlooked simply because other checks pass.

Finally, I had to bring the different parts of the system together within the hackathon timeframe, while testing failure scenarios such as unexpected fees, incomplete deliverables, and prompt-injection attempts.

Accomplishments that I am proud of

I am proud to have built a working end-to-end prototype that connects AI negotiation, evidence validation, and milestone-based payment processing.

Some of the key accomplishments include:

  • Successfully completing and independently verifying a USD 10.00 PayPal Sandbox capture.
  • Implementing separate AI negotiation and deterministic payment-control layers.
  • Demonstrating how an unauthorized additional fee can be rejected during negotiation.
  • Building a seven-check evidence validation workflow with critical failure handling.
  • Implementing hash-linked audit records and successfully verifying all 44 recorded events.
  • Passing 40 automated tests across four test suites.
  • Building an interactive milestone and financial dashboard using AG Grid.

Most importantly, ResolveAI demonstrates that an AI agent reaching an agreement and a payment being authorized are two different things.

What I learned

Building ResolveAI taught me that integrating AI into a payment-related workflow requires more than generating convincing responses.

AI can help interpret situations, propose solutions, and negotiate, but important actions need explicit rules and independent verification. A reliable system should not assume that an AI-generated answer is correct or that a successful negotiation means the work has been completed.

I also learned a lot about the PayPal REST API, authorization and capture flows, payment reconciliation, structured AI outputs, backend validation, and automated testing.

Working on this project helped me understand the practical challenges of building agentic applications where AI interacts with real-world services and financial workflows.

What's next for ResolveAI

ResolveAI is currently a hackathon prototype using PayPal Sandbox. The next step would be to develop it into a more complete platform.

Future improvements could include:

  • More comprehensive evidence verification and source-quality checks.
  • Stronger buyer approval and human-review workflows.
  • Support for additional milestone and partial-completion scenarios.
  • More extensive adversarial testing of AI negotiation and evidence submissions.
  • Improved audit storage and monitoring.
  • A production-ready PayPal integration, subject to the necessary approvals and safeguards.

The long-term goal is to make delegated AI-driven services more accountable by connecting what was agreed, what was delivered, and when payment should be released.

Built With

Share this project:

Updates

Submission history