← Blog

How to Give an AI Agent a Credit Card Safely (Step by Step)

The agent pays with your user's own card and never sees the number.

The safe way to give an AI agent a credit card is to keep the number away from it. With Agentcard's Vault, your user saves their own card once, your agent shops, and each purchase waits for the user to approve it with a passkey or Face ID. Then the real card pays. The agent only ever handles a placeholder card.

This guide is for teams building agents that buy things for their users.

Why pasting a card into the chat isn't safe

A card number typed into a chat becomes part of the model's context. It can end up in logs and tool calls, and nothing stops the agent from using it on a purchase the person never saw. More on this in Don't send your card to a chatbot.

The safe setup, step by step

  1. Your user saves their card once. You create a vault session and send the link wherever you already talk to them: iMessage, WhatsApp or your app. They type the card and save it with a passkey (Face ID, Touch ID or a fingerprint). The card is encrypted on their device before it leaves.
  2. Your agent shops as usual. In an agent browser (Browser Use, Kernel, Browserbase or Anchor), or through opencommerce, one endpoint that buys from any online store. At checkout, the agent fills the card form with a placeholder card and submits it.
  3. Agentcard pauses the payment. Your app sends the user an approval link for that purchase, and they approve it with their passkey.
  4. The real card pays. The user's device sends the real card to the payment processor, and the paused payment goes through. Your agent confirms the order with the store before it tells the user anything.

The user's card stays theirs, and they keep collecting its points.

Purchases your app already asked about

If your app already asks the user before each purchase, you can ask them once, in the vault link, to let your app pay with their card. From then on, supported purchases go through without an approval link, and every other purchase still waits for the user's approval. This works in live mode for purchases in US dollars. Turning it on is your commitment that your app asks the user before each purchase. See Enable auto-approval.

Users can also approve by voice, in early access: Agentcard Voice.

When the agent should spend as itself

Some agents need their own card instead of the user's. With Issuing, Agentcard creates single-use or multi-use virtual cards funded from a balance, and an issued card can never spend more than the balance behind it.

A checklist for any setup

  • The agent never sees the full card number.
  • The person whose card it is approves each purchase, or has given your app permission for it.
  • Spending is capped by something outside the model: the user's approval or a balance.
  • The agent confirms the order with the store before it says the purchase is done.

Try it

The Vault quickstart takes about fifteen minutes in sandbox, with a test card and a demo store that always works. To talk to us about your agent, get started here.