Inspiration
AI assistants can shop now. OpenClaw, Hermes Agent, Claude Code: give one your card and it'll buy what you ask for. It'll also buy what a web page, an email or a product listing tells it to. A prompt injection doesn't need your password; it only needs your assistant to have your money.
The open-source assistants, OpenClaw and Hermes Agent, are the ones people build on: they run on your own machine, with your own skills, and you can change anything about them. A hosted assistant can lean on its platform to pay. One you run yourself has had nothing safer than your card number. So PureStrings is open the same way, all the way down:
- you run the server yourself;
- you flash the key's firmware onto an off-the-shelf ESP32-S3 board;
- the key protocol is written down, so anyone can build a key.
Build your assistant, and build your key.
I wanted to keep the useful part, an assistant that finds things and fills the cart, and take away the dangerous part. Banks solved this for transfers years ago: a little device with its own screen shows you the amount and the payee, and its signature is tied to both, so changing either one breaks it. I built that for agent payments, on PayPal.
What it does
PureStrings sits between your assistants and your PayPal.
- Any assistant can shop. It connects over MCP with its own token. It can search the shops and ask to buy; there is no tool to pay.
- Only your key can pay. Every purchase goes to your key: the PureStrings button on your desk (an off-the-shelf ESP32-S3 board with a speaker and one button), or a key in your browser. It reads out who asked, the shop, every line and the total, taken from the exact text it signs (with a screen plugged in, it shows them too). It signs with a P-256 key that never leaves its chip, and only when you hold it for two seconds. A tap says no.
- The shop checks before PayPal is charged. The shop checks the signature against the key you linked to your PayPal (PayPal Vault), and the cart against the one it priced. Only then does it charge with Orders v2. A changed cart, a forged payment or a replay is refused.
- Allowances from one sentence. "Coffee and tea, up to $15 a time and $40 a week, for OpenClaw only." A model turns that into limits, your key reads them out and signs them once, and the shop holds every payment under them to those limits.
- An auditor on PayPal's own record. PureStrings reads PayPal's webhook events and matches every capture to a signature. A charge nobody signed is flagged in red, with a dispute drafted for you.
- A Ledger built on AG Grid shows every payment: who asked, who signed, what PayPal says, and whether it was flagged. It has filters, search and a CSV export.
- An open key layer. The key protocol is written down, with test vectors, so any device can be a key: the button, a browser, a terminal, a phone.
How I built it
- PayPal:
- Vault: setup tokens and payment tokens save your PayPal once, on PayPal's approval page, when you link a key.
- Orders v2 charges with the vault id.
- Refunds.
- Webhooks, with each event verified by PayPal.
- The webhook events API, which the auditor reads back.
- All on the sandbox.
- AI:
- PureStrings is an MCP server (
shop_search,shop_buy,payment_status,list_payments,list_allowances), with an Agent Skill for OpenClaw, Hermes Agent and Claude Code. - WebMCP hands
shop_search,shop_buyandlist_paymentsto a browser's built-in agent. - A chat model (gpt-4.1-mini; Nemotron on Nebius Token Factory also works) writes allowances from your words and drafts disputes.
- OpenAI's gpt-4o-mini-tts is the button's voice, streamed to it over USB.
- PureStrings is an MCP server (
- The key:
- Firmware for the ESP32-S3 in C++: mbedTLS P-256 signing, an I2S amplifier for its voice, an optional 1.8" screen, and a USB link that PureStrings finds on its own.
- Its signing code is built on the computer and checked against the server's own verification in the tests.
- The browser key uses WebCrypto with a key that can't be read out.
- The stack: TypeScript on Node 22+ (node:sqlite, Hono), React 19 with AG Grid for the web app, Docker on Render with a persistent disk.
- Tests: 109, with no mocks. The PayPal tests charge and refund in the sandbox.
Challenges I ran into
- Making the key show what it signs, and nothing else. One payment must have exactly one way to be written, or a key and a shop could read the same text two ways. I made the text strict JSON with a fixed key order, and the button, PureStrings and the shop all refuse anything written differently. The button reads every fact from that text, never from a label sent beside it.
- The voice over USB. The ESP32-S3's USB serial drops bytes when its buffer fills. Streaming speech broke up until I moved the cable reading into its own task, paced the audio from the server, and buffered the first 0.4 seconds.
- Locking the button. A key is only as good as its firmware. If any program could reflash the button over its cable, holding it would prove nothing. So I moved its cable to the chip's USB-OTG port and turned off the reboot-to-flasher. Now new firmware goes on only if you hold the button while plugging it in, and the flashing tool gets "Failed to connect".
- An auditor that's fair. It judges only charges made since the first key was added, so old charges that nothing could have signed don't count against you.
Accomplishments that I'm proud of
- Real button presses paying real (sandbox) PayPal orders, with no browser open: the button over USB, an assistant over MCP, PayPal behind.
- The attack demo works against the running system:
- a poisoned page's $200 gift card is refused on the key;
- a tampered cart is refused by the shop before PayPal is called;
- a charge made straight through PayPal's API is caught by the auditor, with a dispute drafted.
- The hardware story is written up honestly: what the button stops today, and what it doesn't yet.
What I learned
The safest place for the "yes" is a device the assistant can't reach. The model is great at the parts that are words: what you meant by "coffee, up to $15", what a dispute should say. But what's paid has to be what a person saw and signed. And PayPal's Vault and Orders v2 make "charge this saved PayPal, but only for this exact cart" a small, clean step at the shop.
What's next for PureStrings
- Hardened buttons: secure boot and flash encryption, or a secure element (ATECC608B) that keeps the key, plus attestation, so a shop can take only keys that live in hardware.
- More keys: a phone app with the key in its Secure Enclave or Keystore; watches; tills.
- Signed carts as AP2 mandates, so a PureStrings purchase can travel with PayPal's agent payments work.
- Shops beyond the demo: a small library a PayPal merchant can drop in to accept key-signed carts.
