Guide/cards2 min read

How to Give an AI Agent a Virtual Card With a Spend Limit

Give an AI agent a virtual card with a spend limit: issue per tenant user, cap in the Account Kit, and enforce every charge at the gateway.

Read the docs →

/cards /cards /cards /cards /cards /cards /cards /cards /cards /cards
/cards /cards /cards /cards /cards /cards /cards /cards /cards /cards
/cards /cards /cards /cards /cards /cards /cards /cards /cards /cards
/cards /cards /cards /cards /cards /cards /cards /cards /cards /cards
/cards /cards /cards /cards /cards /cards /cards /cards /cards /cards
/cards /cards /cards /cards /cards /cards /cards /cards /cards /cards
/cards /cards /cards /cards /cards /cards /cards /cards /cards /cards
/cards /cards /cards /cards /cards /cards /cards /cards /cards /cards
/cards /cards /cards /cards /cards /cards /cards /cards /cards /cards
/cards /cards /cards /cards /cards /cards /cards /cards /cards /cards
/cards /cards /cards /cards /cards /cards /cards /cards /cards /cards
/cards /cards /cards /cards /cards /cards /cards /cards /cards /cards
/cards /cards /cards /cards /cards /cards /cards /cards /cards /cards
/cards /cards /cards /cards /cards /cards /cards /cards /cards /cards
Guide/cards
TL;DR
  • A virtual card for an AI agent is a per-tenant-user payment credential the agent can charge capped and approval-gated server-side.
  • Set spending_limit_cents in the Account Kit; every card issued under that user inherits the ceiling.
  • Issue and fund the card through governed tools the agent never sees a PAN it can exfiltrate via prompt injection.
  • Agent calls to issue or fund a card default to pending_approval (HTTP 202) until a human approves (per published docs).
  • Prepaid gift cards support a published $150 maximum (per published docs).
  • Scope with forUser(id) so each customer's card is isolated from every other customer's.

Agents that book travel, buy ads, or pay vendors need a payment credential. Handing them a shared corporate card number is how runaway spend and cross-tenant leaks happen. The pattern below issues a virtual card per tenant user, capped in the Account Kit and enforced on every authorization.

For budget caps beyond cards, see how to set a budget cap on an AI agent.

Step 1 — Enable cards on the Account Kit with a ceiling

await naive.accountKits.update(kitId, {
  primitives_config: {
    cards: {
      enabled: true,
      spending_limit_cents: 7500, // $75.00
      requiresApproval: true,     // agent issue/charge gates (default for cards)
    },
  },
});

Step 2 — Create the tenant user and assign the kit

const user = await naive.users.create({
  email: "customer@acme.com",
  account_kit_id: kitId,
});
const client = naive.forUser(user.id);

Step 3 — Issue a virtual card (approval-gated for agents)

import { isPendingApproval } from "@usenaive-sdk/server";
 
const result = await client.cards.create({
  name: "Q3 ad spend",
  provider: "prepaid_gift", // default: prepaid Visa, $150 max, no cardholder
  spending_limit_cents: 5000, // $50.00 cap on this card
});
 
if (isPendingApproval(result)) {
  // Surface in your UI — see how-to-add-human-approval
}

Prepaid gift cards support a published $150 maximum (per published docs). Fund narrowly for the task at hand.

Step 4 — Fund the card

Use the returned checkout_url or top-up to load exactly what the task needs — a $30 campaign gets $30 on the card, not a $500 float.

Step 5 — Let the agent charge through governed tools

Pass client.agentTools() or an MCP session into your agent loop. When the model calls the card charge tool, the gateway checks kit policy, remaining balance, and approval rules before authorizing.

Where to go next

Frequently Asked Questions
How do I give an AI agent a virtual card?+
Assign an Account Kit with cards enabled, scope to a tenant user with forUser(id), and issue a card through the governed cards tool or SDK. The card attaches to that tenant user. Fund it via checkout_url or top-up. The agent charges against the card through the gateway — it receives a handle, not raw card credentials suitable for exfiltration.
How do I set a spend limit on the agent's card?+
Set spending_limit_cents in the Account Kit's cards primitive config before issuing. The limit applies to cards created under that kit. You can also fund each card narrowly — a $20 task gets a $20 balance — so even a compromised agent cannot overspend the prefunded amount.
Can the agent issue itself a higher-limit card?+
Only if your Account Kit and approval policy allow it. Card issuance is a regulated action: agent calls default to requiring approval (per published docs). Without approval, the issue call returns pending_approval and no card is created until a human approves.
What is the maximum card limit on Naïve?+
Prepaid gift cards support a published $150 maximum (per published docs). Managed virtual cards follow kit defaults and funding — design narrow-purpose cards for agent tasks rather than open-ended corporate cards.
Does each customer get their own card?+
Yes — cards belong to exactly one tenant user. In a multi-tenant SaaS, call users.create per signup and scope every card operation with forUser(customerId). Customer A's agent cannot charge Customer B's card.
How do I audit what the agent spent?+
List transactions on the card and query the tenant user's activity log. Every charge records amount, merchant, and timestamp under that identity — see audit logging for AI agent actions for the full trail.
NT
Naïve Team

Building the agent-native backend.

Keep reading