Skip to main content
const client = naive.forUser(alice.id);

// Sensitive calls may defer to a human instead of executing:
const res = await client.cards.create({ name: "Ads", spendingLimitCents: 50000 });
if (isPendingApproval(res)) {
  console.log("Needs approval:", res.approval_id);
}

await client.approvals.list({ status: "pending" });
await client.approvals.get(res.approval_id);
await client.approvals.approve(res.approval_id);     // replays the frozen action
await client.approvals.deny(res.approval_id, { reason: "later" });
await client.approvals.wait(res.approval_id);         // poll until resolved
isPendingApproval(res) is a typed discriminator exported from the SDK. The gated methods — cards.create, cards.* (cardholder, top-up), domains.purchase, verification.start, formation.submit, connections.connect — resolve to either their normal result or a PendingApproval (HTTP 202 is success, not a thrown error). naive.agentTools() also exposes a naive_check_approvals tool and marks the sensitive tools as approval-gated, so an LLM agent can detect a pending status and ask the user to approve it. Which actions are gated is set per primitive on the Account Kit (requiresApproval). See Approvals.