- ›
A budget cap on an AI agent must be enforced at execution time— telling the model a dollar limit in the prompt is not a cap. - ›Naïve applies caps at two layers: agent-profile budget (hard/soft) and per-primitive defaults in the Account Kit.
- ›Hard caps reserve atomically and return budget_exceeded when exhausted; soft caps route to the approvals queue.
- ›
Card spending limits are set in cents on the kit— prepaid gift cards support a published $150 maximum (per published docs). - ›Scope caps per tenant user with forUser(id) so one customer's overrun never touches another's budget.
- ›Combine profile budget + card limit + approval gates for defense in depth.
Telling an agent "don't spend more than $50" in the system prompt is not a budget cap — it is a suggestion the model can ignore, misread, or be tricked into overriding. A real cap is enforced before money moves, on every call.
This how-to shows the Naïve pattern: agent-profile budget plus Account Kit defaults. For the full governance story, read spend caps, approvals, and revocation.
Step 1 — Scope to one tenant user
Budget caps attach to an agent identity. Create or resolve the tenant user first:
const user = await naive.users.create({ email: "customer@acme.com" });
const scoped = naive.forUser(user.id);Step 2 — Set card defaults on the Account Kit
Put the per-card ceiling in the kit's primitives_config.cards defaults:
await naive.accountKits.update(kitId, {
primitives_config: {
cards: {
enabled: true,
spending_limit_cents: 5000, // $50.00 per card
},
},
});Every card the agent issues for users on this kit inherits the limit. Prepaid gift cards support a published $150 maximum (per published docs).
Step 3 — Set the agent-profile budget cap
The combined cost ceiling lives on the agent profile in your IaC config and is enforced at the governance gateway. Set limits.budget on the agent blueprint in naive.config.ts:
// naive.config.ts
import { defineConfig, agent, identity, skills } from "@usenaive-sdk/iac";
export default defineConfig({
agents: {
"travel-agent": agent({
is: identity.agent(),
can: [skills.llm, skills.search],
limits: {
budget: "$100/mo", // combined cap — alerts at 80%, hard-denies at cap
},
}),
},
});Apply with naive up. The cap sums every metered action (LLM, search, compute, hosted runtime, card spend) over the window and reserves atomically under a lock — an over-budget action returns 403 budget_exceeded. Use a soft cap if over-threshold spend should route to human approval instead.
Step 4 — Run a gated action and confirm enforcement
Issue a card or attempt a charge through the governed tool path. Confirm:
- Under the cap → executes (or
202if approval-gated) - Over the hard cap →
budget_exceeded - Activity log shows the attempt under the correct tenant user
Step 5 — Layer approvals for irreversible spend
Caps limit volume; approvals gate sensitivity. Cards default to requiring approval for agent calls (per published docs) — combine both so a large spend within cap still waits for a human when policy demands it.
Where to go next
- How to give an AI agent a virtual card with a spend limit — card-specific walkthrough
- The Governed Agent Profile — full lifecycle
- Cards docs — issue, fund, transactions
How do I set a spending limit on an AI agent?+
What is the difference between a hard and soft budget cap?+
Can the AI agent raise its own spending limit?+
Where do card spending limits come from?+
Do budget caps work per customer in a multi-tenant app?+
What happens when an agent hits the cap mid-run?+
Building the agent-native backend.
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.
A governed agent profile is an AI agent with identity, spend limits, approvals, audit, and instant revoke — enforced on every action. Here's the full lifecycle.
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.
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.