Inspiration

Getting a new hire ready for their first day sounds simple: buy a laptop, buy a monitor, and make sure everything arrives on time. For a small company’s operations manager, that means checking approved equipment, comparing suppliers, accounting for shipping and tax, and staying within budget.

AI can help with the shopping, but giving an agent access to money raises a harder question: how do we make sure it buys only what someone actually authorized?

We built Purse Strings around one principle: the agent proposes, the rules decide. We wanted AI to handle the searching and planning while keeping purchasing authority explicit, reviewable, and enforced by code.

What it does

Purse Strings is an AI purchasing prototype for equipping new hires with approved laptops and monitors.

A manager starts with a plain-English request. Claude turns it into a structured purchase mandate, which is checked against company policy. A person then confirms the exact revision before shopping can begin.

The shopper can search approved catalogs, inspect products, build carts, and submit them for checking. It cannot approve purchases or make payments. Its carts contain only supplier IDs, product IDs, and quantities; the checker calculates prices independently.

The checker evaluates approved products and suppliers, price limits, warranty requirements, evidence freshness, delivery commitments, and the remaining budget and quantities across purchases. Accepted carts receive an atomic reservation in a SQLite ledger.

An operator separately starts execution. The default demo uses fake payment and supplier providers. An optional PayPal sandbox flow supports buyer approval, authorization, and capture of the reserved amount. Supplier orders remain simulated in every mode.

How we built it

We built Purse Strings with TypeScript, Node.js, SQLite, Zod, the Anthropic SDK, and PayPal’s Orders and Payments APIs.

We separated the system into a shopping agent, a deterministic checker, and an execution backend. Shared contracts define how they communicate. The shopper has four bounded tools and no access to payment credentials.

Claude runs through a manual tool loop, giving us direct control over input validation, retries, tool calls, and execution limits. SQLite transactions reserve money and equipment quantities together, preventing separate carts from independently consuming the same remaining allowance.

For payments, the backend creates a PayPal sandbox order from the checker’s reserved total. A sandbox buyer approves it on PayPal’s hosted page before the operator completes authorization and starts execution.

We also built a local browser interface and a read-only dashboard around the same underlying commands. Automated tests and a scripted offline demo let us exercise the workflow without API keys or network access.

Challenges we ran into

One challenge was keeping supplier content from becoming authority. A product listing may contain misleading text or instructions aimed at the agent. We included a deliberately hostile listing and tested a scripted shopper that followed its instructions. The enforced boundaries refused its attempts without reserving anything.

Another challenge was handling uncertainty. A timeout does not necessarily mean a request failed. We persist operation identities and use idempotent retries so an uncertain submission can be resolved before the shopper tries another cart.

PayPal sandbox testing also challenged an assumption: in our recorded tests, the provider accepted a capture above the authorization’s remaining amount. That made the application’s transactional ledger essential for enforcing the approved cumulative budget.

Finally, we had to distinguish purchasing progress from business outcomes. Reserving funds, capturing payment, placing an order, and having equipment ready are separate facts.

Accomplishments that we're proud of

We connected a plain-English request to a policy-checked mandate, bounded shopping, budget reservation, and operator-controlled execution.

The demo shows an unconfirmed mandate being refused, hostile instructions failing to gain authority, and a cart being rejected after supplier conditions change before an alternative is accepted.

A recorded PayPal sandbox rehearsal also completed authorization and capture of S$7,510.10 for five laptops and five monitors, with the amount reflected in the local ledger. The supplier order remained simulated.

We are especially proud that these decisions are visible: the interface shows what the shopper proposed, what the checker decided, and what the ledger recorded.

What we learned

We learned that useful autonomy depends on clear boundaries. An AI agent can search and adapt without owning approval or payment authority.

We also learned that mocked tests and sandbox exercises answer different questions. Automated tests help verify application behavior, while sandbox testing exposes provider behavior and integration assumptions.

Most importantly, we learned to make uncertainty visible. An unknown payment outcome needs reconciliation; a successful payment does not establish delivery or readiness.

What's next for Purse Strings

Our next steps are production authentication, approval and exception workflows, existing-stock assignment, and real supplier integrations.

We also want to expand live-model evaluation, exercise payment recovery and unused authorization closure in the sandbox, and add delivery and equipment-readiness tracking.

The goal is to help an operations manager follow the entire task—from an approved request to equipment ready for a new hire’s first day—with a clear record of each decision.

Built With

Share this project:

Updates

Submission history