Inspiration

AI agents are becoming capable of negotiating, purchasing services, and completing work on behalf of people. But a critical problem remains: what happens when an agent claims it has completed a job, but the buyer has no reliable way to verify the result before payment?

Giving autonomous agents the ability to transact without reliable authorization and delivery controls introduces a new class of financial risk.

We believe the future of autonomous commerce needs more than intelligent agents that can execute tasks. It needs a system that makes those agents accountable.

That is why we built PACT: conditional settlement infrastructure that connects an agreement to payment authorization and makes payment capture dependent on evidence that the agreed work was delivered.

What it does

PACT connects buyers and seller agents through one structured workflow:

AGREE → AUTHORIZE → DELIVER → VERIFY → SETTLE

  1. AGREE: A buyer defines a task, budget, and acceptance criteria. Seller agents can submit offers and negotiate.
  2. AUTHORIZE: The buyer approves the agreement and the corresponding PayPal Sandbox payment authorization.
  3. DELIVER: The selected seller agent performs the agreed task and submits its deliverables.
  4. VERIFY: A separate verification stage evaluates the delivery against the original acceptance criteria, combining AI judgement with deterministic checks.
  5. SETTLE: Successful verification permits payment capture. Failed verification follows the authorization-void path.

PACT also incorporates reputation-aware seller selection and a hash-chained audit ledger, making important workflow events inspectable and subsequent changes to recorded history detectable.

The core principle is simple: an agent's claim that work is complete should not, by itself, be enough to trigger payment.

How we built it

PACT was built with a Python 3.11 and FastAPI backend, alongside a React, Vite, and Tailwind CSS frontend. PostgreSQL, hosted through Neon, provides durable storage, and the application is deployed on Vercel.

For payments, we integrated PayPal Orders v2 and Payments v2, implementing distinct authorization, capture, void, and refund operations.

Three AI-assisted roles support the workflow:

  • Seller agents generate offers.
  • Buyer-side negotiation supports counteroffers.
  • A verification role evaluates submitted deliverables against the agreed criteria.

An important architectural decision was separating AI intelligence from financial authority. AI assists with negotiation, interpretation, and verification, but it does not independently authorize payments or move money. Deterministic application logic enforces budgets, authorization boundaries, payment state transitions, and execution safeguards. Buyer approval is required for the PayPal authorization.

Additional engineering capabilities include:

  • Idempotent payment operations to protect against duplicate execution.
  • Ownership and guest-session isolation controls.
  • Reputation-aware seller selection.
  • A hash-chained audit ledger.
  • Explicit handling of uncertain payment outcomes rather than blindly retrying financial operations.
  • A machine-readable project information surface that exposes the architecture, capabilities, limitations, and judging evidence to automated evaluators.

Challenges we faced

  1. Making autonomous coordination safe

We wanted AI agents to negotiate and evaluate work without giving a language model unrestricted authority over financial operations. We addressed this by separating AI-assisted decisions from deterministic payment controls.

  1. Handling payment-provider states correctly

A created PayPal order is not the same as an approved authorization. We had to distinguish buyer approval, authorization, capture, void, and refund as separate payment states. This distinction was essential to building a reliable conditional settlement workflow.

  1. Preventing duplicate financial execution

Retries, concurrent requests, and uncertain provider responses can create serious payment risks. We implemented idempotency and concurrency safeguards to prevent duplicate captures and unsafe retries.

  1. Making the transaction history trustworthy

A system that controls conditional payments also needs an inspectable record of what happened. We implemented a hash-chained audit ledger so subsequent modifications to recorded history can be detected.

  1. Making the project understandable to both people and machines

We also considered how evaluators could inspect the project efficiently. We created structured project metadata, machine-readable documentation, and accessible technical evidence across the repository and production website.

Accomplishments we're proud of

We built an end-to-end application connecting agent negotiation, agreement creation, payment authorization, delivery, verification, and conditional settlement.

We are particularly proud of:

  • PayPal Sandbox integration covering authorization, capture, void, and refunds.
  • Three distinct AI-assisted workflow roles.
  • Deterministic controls governing payment execution and budget enforcement.
  • Reputation-aware seller selection.
  • A hash-chained audit ledger with verification.
  • Guest workspaces with backend-enforced ownership isolation.
  • A production-deployed application with a machine-readable project information surface.

Most importantly, we demonstrated how AI-assisted coordination can work alongside deterministic financial safeguards instead of replacing them.

What we learned

One of our biggest lessons was that integrating a payment API does not automatically create a trustworthy payment system.

Reliable autonomous commerce requires explicit authorization boundaries, carefully modeled payment states, idempotency, evidence-based verification, and honest handling of uncertainty.

We also learned that AI autonomy and financial control do not have to be opposites. AI can make coordination more intelligent while deterministic systems retain authority over sensitive financial execution.

What's next for PACT

We see several opportunities to extend the system:

  • Partial settlement for deliveries that satisfy only part of an agreement.
  • Dispute resolution involving a third-party arbiter.
  • Milestone-based settlement for longer-running tasks.
  • Signed receipts for independently verifiable settlement records.
  • Additional payment providers and reusable agreement templates.

Our long-term vision is to make verified agreements and accountable settlement foundational building blocks for the agent economy.

Built with

Python, FastAPI, React, Vite, Tailwind CSS, PostgreSQL, Neon, PayPal Orders API, PayPal Sandbox, Groq, GPT-OSS-20B, Vercel, Docker, and AG Grid.

Project links

Payment disclosure

This demonstration uses PayPal Sandbox only. It does not transfer real money or represent a legally operated escrow service. Payment authorization and settlement behavior are demonstrated in the PayPal Sandbox environment.

Built With

Share this project:

Updates

Submission history