AgentGuard — IntentLock

The Problem

AI agents are increasingly capable of finding products and initiating purchases on behalf of users. But giving an AI agent the ability to act on a user's behalf raises an important question: how do we ensure the agent purchases exactly what the user approved?

A user might approve a specific product for a specific price, but an agent-driven workflow could encounter changed amounts, altered transaction details, repeated requests, or uncertain payment outcomes. A confirmation screen alone does not enforce the user's original intent at the payment layer.

Our Solution

AgentGuard — IntentLock is a security layer for AI-assisted purchases built around one principle: an AI agent should not be able to silently change the terms of a purchase after user approval.

AgentGuard binds an authorization to the intended purchase details, including the product, merchant, amount, and currency. Before a payment is captured, the backend checks the PayPal order against the stored authorization. It also tracks authorization states to help prevent reuse of consumed approvals and to handle uncertain capture outcomes safely.

The goal is simple: give AI-powered commerce a stronger connection between what the user approved and what the payment system processes.

How It Works

  1. Define the purchase: The application identifies the product, merchant, amount, and currency.
  2. Authorize the intent: The user approves the specific purchase.
  3. Validate the transaction: The backend checks the PayPal order against the stored authorization before attempting capture.
  4. Verify the outcome: AgentGuard checks the payment result and reconciles uncertain outcomes before treating a payment as verified.
  5. Audit the workflow: Authorization and payment events can be recorded for investigation and debugging.

Built With

AgentGuard uses a TypeScript backend, a web frontend, SQLite for authorization state, and PayPal Sandbox integration. The project is deployed with Vercel for the frontend and Render for the backend.

Challenges and What I Learned

One of the most important challenges was handling the difference between requesting a payment capture and actually verifying that the payment completed as expected. A capture request can have an uncertain outcome, so treating every response as an immediate success can create duplicate-payment risks or misleading user feedback.

I worked on validating PayPal order details, tracking pending authorization states, and reconciling payment outcomes before reporting success. I also developed automated tests for authorization behavior and ambiguous capture scenarios.

This project taught me that payment security is not just about displaying a confirmation message. It requires backend enforcement, careful state transitions, transaction verification, and clear handling of failure cases.

What's Next

The next steps are to strengthen end-to-end testing, improve the audit experience, and evaluate the system against additional tampering, replay, and recovery scenarios. The current prototype uses SQLite storage that may not survive every deployment or restart, so durable authorization storage is an important future improvement.

AgentGuard — IntentLock explores a key question for agentic commerce: how can we let AI act for users without letting it silently redefine what those users approved?

Share this project:

Updates

Submission history