- ›
Agents that provision SaaS tools for customers need recurring spend rails— a shared corporate card in a prompt cannot cap monthly subscription burn - ›Naïve lets you issue one virtual card per subscription or vendor with spending_limit_cents enforced by the card network, not the model
- ›Scope every call with naive.forUser(clientId) so each tenant's agent only funds its own tool stack
- ›Card creation and top-ups can freeze as pending_approval until a human approves large recurring commitments
- ›
When a customer churns, revoke the card or tenant session— no orphaned subscriptions billing your platform - ›
Same Account Kit + cards primitive as travel and event bookings— one governance layer for one-time and recurring agent spend
An agent that provisions SaaS tools for customers — spinning up analytics, email, or API keys on signup — eventually hits the billing page. Every vendor wants a card on file. Naïve is the autonomous company infrastructure that gives agents real-world capabilities, and /cards is the primitive that turns "subscribe to this tool for Client A" into governed recurring spend the agent can complete without sharing one corporate Amex across every tenant. Part of the autonomous company use-case cluster.
This guide shows how to give a subscription-provisioning agent per-tool virtual cards: funded, capped monthly, approval-gated for new commitments, and scoped with naive.forUser(customerId) so multi-tenant SaaS platforms stay isolated. Enforcement lives in the card network and the Naïve gateway — not in a system prompt.
This tutorial connects to event booking cards, the corporate travel desk, and spend caps and approvals — same primitive, recurring use case.
Why subscription spend needs cards
| Scenario | Agent-friendly? | Needs recurring payment? |
|---|---|---|
| Research & compare plans | Yes — search, rank features | No |
| Checkout & subscribe | Risky without enforcement | Yes — monthly SaaS billing |
| Rotate or cancel on churn | Needs a revocable rail | Yes — stop future charges |
Sharing one platform card across all customers fails isolation: every tenant's subscriptions bill the same balance, and one agent mistake affects everyone. Pasting card numbers into prompts fails the ceiling test — there is no hard monthly cap the model cannot exceed.
The Company → Employee → Primitive model applies: your platform defines policy, each customer's agent acts on their behalf, and /cards binds spend to that agent with a limit you set in cents.
Architecture
Four pieces work together:
- Users — one tenant user per customer.
- Account Kits — enable cards, default monthly limits, gate new subscriptions.
- Cards — virtual card per tool or vendor category.
- Approvals — human gate before large recurring commitments.
Setup
npm install @usenaive-sdk/serverimport { Naive, isPendingApproval } from "@usenaive-sdk/server";
const naive = new Naive({ apiKey: process.env.NAIVE_API_KEY! });Use naive.forUser(customerId) for every call that touches cards.
Step 1 — Encode subscription policy in an Account Kit
const saasKit = await naive.accountKits.create({
name: "SaaS provisioning — standard",
primitives_config: {
cards: {
enabled: true,
requiresApproval: true,
defaults: { spending_limit_cents: 50_000 }, // $500/mo default per card
},
formation: { enabled: false },
verification: { enabled: false },
},
});requiresApproval: true on cards means creating or topping up a card freezes until a human approves — the right default when agents subscribe to tools with recurring fees.
Step 2 — Create a tenant user per customer
const customer = await naive.users.create({
external_id: "acme-corp-001",
email: "ops@acme.com",
account_kit_id: saasKit.id,
});
const client = naive.forUser(customer.id);Every card and transaction below is scoped to customer.id.
Step 3 — Issue a per-subscription card
When the agent provisions "PostHog for Acme — $89/mo," issue a card scoped to that tool:
const card = await client.cards.create({
name: "Acme — PostHog analytics",
spending_limit_cents: 9_000,
});
if (isPendingApproval(card)) {
return { status: "pending_approval", approvalId: card.approval_id };
}The spending_limit_cents value is the hard monthly cap — the network declines anything above it.
For lightweight tools under the documented prepaid maximum, a gift card may suffice. For higher recurring limits, use a managed virtual card after cardholder setup. See the cards docs.
Step 4 — Complete checkout and log the charge
Once funded and active, the agent completes the SaaS billing checkout through the governed API. Log the first charge:
// Manual logging uses the card log-transaction endpoint:
await fetch(`https://api.usenaive.ai/v1/cards/${card.id}/log-transaction`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.NAIVE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
amount_cents: 8_900,
merchant_name: "PostHog",
description: "Monthly analytics — Acme",
}),
});Managed virtual cards may also capture recurring charges via webhooks; manual logging covers prepaid flows and reconciliation.
Step 5 — Revoke on churn
When a customer cancels, revoke their cards or session so no new subscription charges clear. See instant revocation for the broader pattern.
What this enables for SaaS operators
- Per-tool budgets — one card, one monthly cap, one approval gate.
- Multi-tenant isolation — each customer's tool stack bills only their balance.
- Clean offboarding — revoke stops the spend rail; pair with vendor cancellation in your agent.
- Audit trail — finance reconciles subscription spend per tenant without trusting agent summaries.
The agent still handles research and provisioning logic. /cards is what makes the payment step real and bounded.
Related reading
- Introducing /cards — primitive overview
- Event booking cards — one-time deposit pattern
- Corporate travel desk — per-trip card pattern
- Spend caps, approvals, and revocation — governance deep dive
- Cards documentation — API reference
Can an AI agent pay for SaaS subscriptions on its own?+
How do you cap monthly subscription spend for an agent?+
How does multi-tenant subscription spend work?+
What happens when a tenant churns?+
Should I use one card per subscription or one card per customer?+
Building the autonomous company infrastructure.
Issue virtual cards for your agents — a prepaid gift card or a managed virtual card — funded via checkout, capped by a spending limit, and fully audited.
Give each event agent a spend-capped virtual card for venue deposits, tickets, and vendor payments — hard limits and approval gates enforced at execution time.
Build a multi-tenant corporate travel desk with the Naïve SDK: an AI agent that researches, ranks, and books hotels, with spend capped and approvals enforced.
Spend caps, human approvals, and instant revoke for AI agents must be enforced server-side — Naïve's governance gateway applies all three on every call.