Agentspay
All posts

How to Give an AI Agent a Virtual Card

Marcus Feld, Developer Relations · Jun 20, 2026 · 8 min read
Agent Payments Console

Pick an agent

Payment intent

intent:

Policy evaluation

Human approval required

This spend is over your approval threshold. Approve it to issue a scoped card, or deny it.

Scoped virtual card issued

Agentspay

single-use

Wallet budget

spent of

Audit trail

To give an AI agent a virtual card safely, issue a scoped card through an API rather than handing the agent your real card number. Lock the card to a single merchant, set a maximum amount, give it a short expiry, and make it single-use where possible. The agent receives a tokenized, masked reference, never the raw number, and every charge is checked against your spend controls before it settles. If the card leaks or the agent misbehaves, the card is worthless beyond its scope and you can revoke it instantly.

That is the whole idea in one paragraph. The rest of this guide is the how.

Why not just give the agent a normal card?

A normal card has no scope. It works at any merchant, for any amount, until it expires or is cancelled. Put that number in an agent's context and you have handed full spending power to a system that can loop, hallucinate, or be steered by a malicious prompt. One bad call and the charge clears. A scoped virtual card removes that risk by making the credential almost useless outside the one thing you authorized.

The four scopes that make a card safe

A virtual card for an agent should carry as many of these constraints as the task allows:

ScopeWhat it doesUse it when
Merchant-lockedCard only works at one named merchantYou know exactly where the agent will buy
Amount-cappedCard declines above a set totalAlways; pick a ceiling close to the real cost
Single-useCard dies after the first successful chargeOne-off purchases
Time-boundCard expires after minutes or hoursThe task has a short, known window

Stack them. A merchant-locked, amount-capped, single-use card that expires in one hour is hard to abuse even if the number leaks.

Step by step

  1. Create or fund the agent's wallet. The card draws from a capped agent wallet, so even an unexpected charge cannot exceed the wallet balance.
  2. Define the scope. Decide the merchant, the maximum amount, the expiry, and whether it is single-use, based on the task the agent is about to run.
  3. Issue the card by API. One call returns a tokenized reference. The raw PAN never enters your application or the agent.
  4. Hand the agent the masked reference. The agent uses the token to pay. It never sees real card data, which keeps you out of PCI scope.
  5. Let policy check every charge. Each attempt is evaluated against the card's scope and your spend controls before it clears. Out-of-scope attempts are declined.
  6. Require approval above a threshold. For larger spend, route the charge to a human for one-tap approval before it settles.
  7. Revoke when done. Single-use cards self-retire. Otherwise revoke instantly so nothing lingers.
  8. Reconcile from the audit trail. Every charge is written to an audit trail tied to the agent, owner, and policy verdict.

An illustrative API call

The exact shape depends on your stack, but the pattern is short. The snippet below is illustrative, not copy-paste production code, and shows how few lines it takes to issue a scoped card.

POST /v1/cards
{
  "wallet_id": "wal_29f...",
  "scope": {
    "merchant": "openai.com",
    "amount_limit": { "currency": "USD", "max": 50.00 },
    "single_use": true,
    "expires_in": "1h"
  }
}

// response
{
  "card_id": "card_8a3...",
  "token": "tok_live_...",      // hand THIS to the agent
  "last4": "4242",
  "status": "active"
}

The agent pays with the token. Your application never touches the raw number. If the agent tries to spend at a different merchant or above the cap, the charge is declined at the boundary.

Common questions

Can an agent reuse a single-use card?

No. A single-use card retires after the first successful charge. A second attempt is declined. Use single-use for one-off purchases and amount-capped or time-bound cards for repeated, predictable spend.

What happens if the token leaks?

A leaked token is bounded by its scope. If the card is merchant-locked, amount-capped, and time-bound, an attacker can do little with it, and you can revoke it instantly. This is the core reason to scope cards rather than share a real one. See more in stopping runaway agent spend.

Does this keep me out of PCI scope?

Issuing through a provider that returns tokenized, masked references, so raw card data never enters your systems or the agent, is what keeps your PCI burden low. Read our security overview for the architecture.

How many cards should an agent have?

As many as it needs and no more. A common pattern is one scoped card per task or per merchant relationship, so each charge is isolated and easy to reconcile. Because cards are issued and revoked by API, the cost of issuing many narrow cards is low.

The takeaway

Giving an agent a virtual card is not about trusting the agent. It is about making the credential safe to lose. Scope it to one merchant, cap the amount, keep it short-lived, make it single-use when you can, and let policy check every charge. Then a card in an agent's hands is a bounded permission, not a blank cheque. If you are weighing when to use a single-use card versus a reusable one, our guide on single-use vs delegated cards for AI agents covers that choice. To see the full lifecycle end to end, read how it works or compare the best agent payment platforms.

Try it in the sandbox

Give an agent a wallet, write a policy, and issue a scoped virtual card in an afternoon. Never moves money without policy.