naïve
← Blog
GuideDevelopersNovember 26, 2026·11 min read

How to Let an AI Agent Buy Things Safely: Virtual Card, Spending Limit, Approve Each Purchase

Give an AI agent a prepaid virtual card capped at its load, make issuing it ask you first, and audit every purchase. Code for SDK, CLI and MCP.

Guide/cards

TL;DR

  • Never hand an agent your own credit card. Give it a prepaid virtual card that belongs to its identity and holds only what you load onto it: $1 to $150, in whole cents.
  • Three layers keep spending in check: the card's prepaid load is the hard limit, the identity's approval rule asks you before a card is issued or funded, and a workspace rule asks before any single call over $5.
  • With default rules, issuing any card over $5 already asks you (the any-call-over-$5 rule), and the card rule adds its own over-$50 check. Set the card rule to always, issue one card per purchase, and you approve every purchase before any money moves.
  • The agent finds the product with data tools (Google Shopping and Amazon, from fractions of a cent per call) and checks out in its own cloud browser.
  • Cards are in early access. A quote shows the load plus the issue fee before anything is bought, and every reveal of a card number is audited.

Tools used in this post

The safe way to give an AI agent a credit card is not to give it yours: give it a prepaid virtual card of its own, so the most it can ever spend is the amount you loaded. Naive is an API platform that gives AI agents their own identities, cards, browsers and computers. On Naive that card belongs to the agent's identity, holds $1 to $150, and issuing it can be set to ask you first, so you approve every purchase before any money moves. The agent finds the product with data tools and pays in its own cloud browser.

Definitions. Identity: the name an agent acts as, which owns its resources. Prepaid card: a virtual card bought once for a fixed load, never reloaded. Load: the card's spending limit. Approval rule: a per-action setting (never, always, or over a dollar amount) that holds a call until a person decides.

Cards are in early access and need business verification. Everything else in this guide (identities, approval rules, shopping data, the browser) is live today.

Is it safe to give an AI agent a credit card?

Giving an agent your own card is not safe. A model can misread a product page, loop on a failed checkout, or follow instructions hidden in a web page. With your card, each of those mistakes is limited only by your credit line, and the charges land on your statement next to your own.

A card the agent owns changes the worst case. It is prepaid, so the most it can lose is its load. It belongs to one identity, so every card, reveal and logged purchase is tied to that agent. And it sits behind approval rules enforced by the API, not by a sentence in the prompt.

Your own cardA prepaid card the agent owns
Worst caseYour whole credit limitThe card's load, $1 to $150
Who approvesWhatever the prompt saysAn approval rule the API enforces
Where charges showMixed into your statementLogged against one identity's card
Reading the numberPasted into a prompt or a fileOne audited call, never cached
Stopping itCancel your own cardRetire the agent's card, yours keeps working

If you are new to agent identities, start with give your AI agent its own identity. This post covers the money part. More developer guides are in the Developers blog.

How do I set spending limits for an AI agent?

Three independent checks sit between the agent and your money: the card's prepaid load ($1 to $150), an approval rule on issuing cards, and an approval rule on any call over $5. Each one works even if the other two are misconfigured.

LayerWhat it limitsDefaultWhere you change it
Prepaid loadThe most one card can ever spend$1 to $150, set at issue, never reloadedThe load_micro_usd you issue with
Issue / fund a card ruleWhether issuing a card needs your OKAsks when over $50 (the next row already asks over $5)Identity approval rules (card.spend)
Any single call over $XAny one paid call, card or not; a card issue counts its loadAsks when over $5Identity or workspace rules (spend.over)

The load is the hard limit. Logging a purchase that would take a card past its load is refused, and there is no top-up: a card that runs out stays empty, and the agent has to ask for a new one.

The approval rules decide when a person is asked. Each action can be never, always, or "over $X". With default rules, issuing any card over $5 already asks you, because the issue reports its load as the amount and the over-$5 rule applies; card.spend adds its own over-$50 rule. For a shopping agent the strongest setting is simple: set card.spend to always and issue one card per purchase, sized to that purchase. Each purchase is then one approval, and your yes covers exactly one amount. The approvals guide covers how held calls work in general.

Approving and changing rules are a person's decisions. An API key cannot approve its own held call or loosen its own rules. You do both in the developer console, or from the CLI while signed in as an owner or admin:

naive approvals rules --identity shopper --set card.spend=always --set spend.over=over:5

How do I give an AI agent a virtual card?

First quote, then issue. A quote has no side effects. It returns the price (the load plus the issuer's fee) and the minimum and maximum load you can ask for, so the fee is visible before anything is bought.

issue-card.ts
import { createNaive } from "@usenaive-sdk/naive";
 
// Reads NAIVE_API_KEY. "wait" makes a held call wait for your decision, then return the result.
const naive = createNaive({ approvals: "wait" });
 
const shopper = await naive.identities.create({ name: "shopper" });
 
// $25.00 in micro-USD. Loads are $1 to $150, in whole cents.
const quote = await naive.identities.cards.quote(shopper.id, { load_micro_usd: 25_000_000 });
console.log(`price $${quote.price_micro_usd / 1e6} for a $${quote.load_micro_usd / 1e6} load`);
 
// With card.spend set to always, this waits until you approve it in the console.
const card = await naive.identities.cards.issue(shopper.id, {
  label: "USB-C power bank",
  load_micro_usd: 25_000_000,
});
// The issuer settles the card shortly after: wait until it is active (about 30 seconds).
let current = card;
while (current.status !== "active" && current.status !== "failed") {
  await new Promise((r) => setTimeout(r, 3000));
  current = await naive.identities.cards.get(shopper.id, card.id);
}
if (current.status === "failed") throw new Error("card failed: call cards.retry, or cards.refund for the credits");
console.log(current.brand, current.last4); // brand and last four only, never the number

Issuing debits your Naive credits for the quoted price before the card is ordered. The card can come back as issuing or pending_payment and turn active a little later; the number can only be revealed once it is active. If it ends failed, cards.retry tries again and cards.refund returns the credits. If the balance is short, the call fails with insufficient_credits and nothing is bought. A held issue waits up to 10 minutes in the SDK by default. A pending approval expires after 24 hours and is then never run.

The same from the CLI:

npm i -g @usenaive-sdk/cli
naive identity create --name shopper                     # prints the idn_… id
naive identity card quote idn_… --usd 25
naive identity card issue idn_… --label "USB-C power bank" --usd 25 --wait
naive approvals list --status pending                    # what is waiting for you
naive identity card reveal idn_… --card vcd_… --i-understand-this-is-audited
naive identity card spend idn_… --card vcd_… --usd 23.99 --merchant store.example.com --description "USB-C power bank"

Quoting needs a key with agents:read; issuing and revealing need billing:write. If your workspace has not been granted card access yet (it needs business verification), the issue call is refused with an error saying so. That is the early-access gate, not a bug.

The card object never carries the number. It shows brand, last4, load_micro_usd, spent_micro_usd and status. The card resource page lists every route, and the Cards primitive shows how it fits with wallets and trading.

How does the agent find the right product?

Most bad purchases are research failures, not payment failures. So before any card exists, let the agent compare offers and read reviews with data tools. These are read-only calls billed per call or per result from the same balance:

ToolWhat it returnsPrice
shopping.offers (Google Shopping)Offers for a product across stores, cheapest first$0.00015 / call
amazon.search (Amazon)Products for a keyword, with price and rating$0.00015 / call
amazon.reviewsA review summary, themes with positive and negative counts, example reviews$0.015 / call

The Google Shopping group starts from $0.000001 per call and the Amazon group from $0.0001 per result, with more endpoints for sellers, product pages and price comparisons.

research.ts
const offers = await naive.tools.run("shopping.offers", { product: "anker 737 power bank" });
const search = await naive.tools.run("amazon.search", { query: "anker 737 power bank", country: "us" });
 
for (const run of [offers, search]) {
  if (run.object === "run") console.log(run.tool, run.status, run.cost_micro_usd, run.output);
}
naive tools run shopping.offers --arg product="anker 737 power bank"
naive tools run amazon.search --arg query="anker 737 power bank" --arg country=us

A good habit is to make the agent write its pick and the price down before it asks for a card: the store, the total with shipping and tax, and why this offer won. That text becomes the card's label and your approval context.

How does the agent pay at checkout?

The agent pays in a real browser on its own cloud computer. The browser takes plain-language steps, and you can watch it live.

This continues issue-card.ts, so naive, shopper and card are the same objects; put the snippets in one file to run them.

checkout.ts
const computer = await naive.computers.create({ name: "checkout" });
const browser = naive.computers.browser(computer.id);
 
await browser.goto("https://store.example.com/products/power-bank");
 
// The one call that returns the number. Every reveal is audited and never cached.
const creds = await naive.identities.cards.revealCredentials(shopper.id, card.id);
 
// Variables fill the %name% placeholders and never come back in a result.
await browser.act(
  "Add one to the cart, check out as a guest, and pay with card %number%, expiry %expiry%, security code %cvv%",
  { number: creds.number, expiry: creds.expiry ?? "", cvv: creds.cvv ?? "" },
);
 
// Record what was spent. A spend past the card's load is refused.
await naive.identities.cards.logTransaction(shopper.id, card.id, {
  amount_micro_usd: 23_990_000,
  merchant: "store.example.com",
  description: "USB-C power bank, order confirmation saved",
});
 
await browser.close();

Two things keep this tidy. The reveal is a separate, audited call, so a grep of your code finds every place a card number is read, and the audit log names the card and the caller. And the number goes into the browser step as a variable rather than into the model's chat history.

How do I review purchases and shut a card down?

Every card keeps a ledger of logged purchases, each with an amount, merchant, description and the session that made it:

const { data } = await naive.identities.cards.transactions(shopper.id, card.id);
for (const t of data) console.log(t.created_at, t.merchant, t.amount_micro_usd / 1e6);
 
await naive.identities.cards.cancel(shopper.id, card.id);
naive identity card transactions idn_… --card vcd_…
naive identity card cancel idn_… --card vcd_…

Be clear about what each of these does:

  • Transactions are a ledger your agent writes, not a live feed from the card network. A prepaid card has no authorization feed. The ledger is useful for auditing what the agent says it bought, and it refuses entries past the load, but the merchant's receipt is the source of truth.
  • Cancel retires the card in Naive, so your agents stop using it. A prepaid card cannot be voided at the issuer, and its number stays valid for whatever load is left. That is the reason to size each load to the purchase. To cut off an agent completely, see how to revoke AI agent access instantly.
  • Refund applies to a card the issuer never delivered (pending_payment or failed): the credits come back. It is an operator action in the console.

What does it cost?

ItemPrice
IdentityFree
CardIts load plus a small issue fee, shown in the quote before you buy
Product research$0.00015 per Google Shopping offers or Amazon search call; $0.015 per Amazon review summary
Browser$0.10 an hour while open, plus $0.01 per AI action
Cloud computerBilled per hour while running

Everything comes from one prepaid credit balance, and new accounts start with $1 of free credit and no card on file. Card access is early access: request it from the developer console.

Can Claude buy something for me?

Yes. Connect Claude, ChatGPT or Cursor to https://mcp.usenaive.ai/v1/mcp and ask it to compare offers and read Amazon reviews; that works in a chat today. For the purchase, let Claude Code (or any agent with a shell) run the CLI lines above with a key that has billing:write: it quotes, issues a card that waits for your approval, reveals the number into its browser, and logs the spend. You stay the one who says yes to each card.

When should you not use Naive for agent purchases?

  • Large or recurring purchases. A card tops out at $150 and is never reloaded. For a monthly subscription or a $2,000 order, buy it yourself or use your company's procurement tools.
  • Stores that need a named cardholder or a billing address check you cannot meet. Some merchants decline prepaid cards. Have the agent pick a store that accepts them, or do that one checkout yourself.
  • When you need a live authorization feed. If your finance process depends on real-time declines and per-merchant controls from the card network, this prepaid card does not provide them.
  • When the agent does not need to pay at all. If the job is "find the best price and send me the link", skip the card. The data tools and an inbox are enough.

How do I start?

  1. Get a key with $1 free credit, no card: developers.usenaive.ai/signup.
  2. Or hand your agent one line: set up https://usenaive.ai/developers/skill.md.
  3. In Claude, ChatGPT or Cursor, add the MCP server https://mcp.usenaive.ai/v1/mcp and ask: "compare offers for an Anker 737 power bank and read the Amazon reviews". The research works in a chat today. Issuing and revealing a card needs a key with billing permission, so the purchase runs from your own agent code.
  4. Request card access in the developer console, set card.spend to always, and run the three snippets above.

Reference: Cards docs, Approvals docs, Tools docs. More on the platform at /developers.

FAQ

Is it safe to give an AI agent a credit card?
Not your own card: a model that misreads a page or gets prompt-injected can spend your whole limit. It is reasonably safe to give an agent a prepaid virtual card of its own, because the most it can ever spend is the amount you loaded, and you can require approval before each card is issued.
How do I set a spending limit for an AI agent?
On Naive the limit is the card's prepaid load, between $1 and $150 in whole cents, and it cannot be raised after issue. On top of that, the identity's approval rules ask you before a card is issued: with default rules any card over $5 asks, because the any-call-over-$5 rule covers the load and the card rule adds an over-$50 check. Set the card rule to always to make every issue ask.
Can I approve each purchase before my AI agent pays?
Yes. Set the identity's Issue / fund a card rule to always and issue one card per purchase, sized to that purchase. Every card then waits for your approval in the developer console, so no money moves until you say yes. A pending approval expires after 24 hours and is never run.
Can Claude or ChatGPT buy something for me?
Yes, in two parts. In Claude, ChatGPT or Cursor, connect https://mcp.usenaive.ai/v1/mcp and have it compare offers and read Amazon reviews. Then let Claude Code (or any agent with a shell) run the purchase with the Naive CLI or SDK using a key that has billing permission: quote, issue (which waits for your approval), reveal into its browser, and log the spend.
What happens if I cancel the card?
Cancelling retires the card in Naive so your agents stop using it. A prepaid card cannot be voided at the issuer, though, so its number stays valid for any unspent load. Size each load to the purchase so little or nothing is left over.
How much does a virtual card for an AI agent cost?
The card costs its load plus a small issue fee, and the quote shows the exact total before you buy. Both are paid from your Naive credits. The identity is free, and the product research costs fractions of a cent per call.