Inspiration

AI agents are becoming capable of doing much more than answering questions. They can search for products, compare prices, make decisions, and even perform actions on behalf of users. While exploring this idea, we started thinking about something important: what happens when we allow an AI agent to spend our money?

Giving an AI unrestricted access to a payment method is risky. It might select the wrong product, exceed a budget, purchase from an untrusted merchant, or make a payment without the user's knowledge. We wanted to solve this problem by building something that allows AI to handle shopping tasks without giving it complete control over someone's money.

That's how Allowance started.

What it does

Allowance is a financial authorization platform designed for AI-powered shopping agents. It has two main components: ShopMind: The AI shopping agent that understands shopping requests, searches a product catalog, compares products, and prepares shopping carts. PayPilot: The financial authorization engine that checks whether a purchase follows the user's spending rules. Before a purchase can proceed, PayPilot evaluates it against the configured policies. These include: Daily spending limits. Maximum amount per transaction. Approved merchant lists. Human approval thresholds. Automatic approval rules. Spending velocity limits. Emergency freeze controls. Depending on the result, a purchase can be automatically approved, sent for human approval, or blocked.

How we built it

We built Allowance with a modular architecture because we wanted shopping decisions and financial decisions to remain separate.We used Python and FastAPI for the backend, where the main application logic, APIs, and authorization workflows are handled.

For the AI shopping component, we developed ShopMind around a bounded agent workflow. It searches a predefined product catalog and prepares shopping carts using validated product information. Product prices are controlled by the backend rather than trusted from the AI's responses.

PayPilot is implemented as a deterministic policy engine. It evaluates purchases through a sequence of financial rules, covering account freezes, merchant restrictions, transaction limits, daily budgets, approval thresholds, and automatic approvals.

We used SQLite with WAL mode for database management. One important architectural decision was to maintain financial facts separately from purchase workflow states. This allows financial records to remain append-only while budget accounting can be reconstructed from those records.For payment processing, we designed an integration around PayPal Orders v2, including mock and live payment clients.

Challenges we ran into

One of the biggest challenges was understanding how unpredictable payment operations can be.

  1. Handling payment timeouts A payment request can time out even when the payment provider has already received it. Sending the same request again could result in a duplicate payment. Instead of blindly retrying, we designed a CAPTURE_UNKNOWN state. The system holds the budget reservation and checks the payment provider's actual transaction status before deciding what happened.

  2. Preventing overspending We had to consider what would happen if multiple agents tried to purchase products at the same time. Without proper synchronization, they could all see the same available budget and collectively exceed it. We addressed this in our architecture using atomic database transactions and budget reservations.

  3. Keeping AI under control We didn't want the AI model to make financial decisions on its own. ShopMind handles product discovery and cart preparation, while PayPilot independently evaluates every purchase request.

  4. Maintaining financial records Another challenge was deciding how to record purchases that fail at the application level but might still have been captured by the payment provider.

We designed separate financial records and workflow states so that a later payment confirmation does not require rewriting the original purchase history.

Accomplishments that we're proud of

What we're most proud of is the idea behind Allowance and the architecture we developed to support it.

Some of the things we accomplished include: Bringing AI-powered shopping and financial authorization into one platform. Designing ShopMind and PayPilot as separate components with different responsibilities. Developing a structured financial policy engine with multiple authorization rules. Designing a payment capture workflow that avoids unsafe retries. Establishing an append-only financial journal. Designing budget reservations to handle concurrent purchase requests.

Creating a detailed adversarial testing plan covering 53 scenarios, including payment failures, concurrency issues, security, and recovery.

What we learned

This project taught us that making an AI agent capable of performing tasks is only one part of building a useful autonomous system.We also need to think about what the agent is allowed to do, what happens when it makes a mistake, and how the system recovers when something fails.

During this project, we learned more about: Building AI agent workflows. Designing deterministic authorization systems. Working with FastAPI and database transactions. Managing concurrent financial operations. Payment API integration and idempotency. Financial journaling and transaction reconciliation. Security, prompt injection, and failure recovery.

One of our biggest takeaways was that AI autonomy should come with boundaries. A system should not have to trust an AI model completely to keep its users safe.

What's next for Allowance

Allowance is currently being developed with the goal of making it useful beyond a predefined shopping demonstration.

We want to take it further by: Integrating more payment providers. Allowing individual users to configure their own spending policies. Supporting real-world merchant and product integrations. Extending the platform to business use cases. Supporting multiple AI agents under one authorization system. Improving spending analytics and fraud detection. Strengthening deployment, monitoring, and production security.

Eventually, we want Allowance to work as a financial control layer for different types of AI agents, not just shopping assistants.

Built With

Share this project:

Updates

Submission history