Rightshold™ Sign up

Answers · agent payments

How do I gate an agent wallet or card with per-task caps and an outside-agent spend record?

Last updated

TL;DR: Handing an agent a funded wallet or virtual card is incomplete without four controls the agent cannot rewrite: a per-task (and per-agent) spend cap, a human approval gate above a threshold, a one-call revoke path, and a spend record written outside the agent's editable session. Put hard limits on the instrument itself (Stripe Issuing spending_controls with per_authorization and period caps; a small dedicated wallet plus a signing policy such as Coinbase CDP Policy Engine), re-check each purchase in a real-time authorization or authorize_spend step, require request_human_approval when the task budget or a single charge exceeds policy, and append every allow/deny to a ledger or server DB the agent's tools cannot UPDATE. Caps in prompt text or session JSON are not a gate.

What should I check, step by step?

1. Give each agent its own card or wallet credential (one Stripe Issuing card or one crd_/wallet per agent). Never share a treasury key across agents.

  1. Set instrument-level caps first: per-authorization and daily/monthly limits, allowed merchant categories/countries, and (for wallets) a policy that rejects over-cap signing. Stripe applies a default 500 USD/day when you set no spending_limits, plus an unconfigurable 10,000 USD per-authorization ceiling.
  2. Add a per-task budget: when a task starts, mint task_id, remaining_minor, and expires_at in storage the agent cannot edit. Every charge decrements that budget; on zero or expiry, refuse further spend for that task.
  3. Above a threshold (or for new merchants), call request_human_approval bound to amount, payee/merchant, task_id, and currency; re-verify the hash immediately before capture or broadcast.
  4. On each purchase attempt, run an outside check (Stripe issuing_authorization.request within 2 seconds, or authorize_spend against set_spend_policy) and write the signed allow/deny where the agent cannot edit it.
  5. Wire revoke: cancel or deactivate the card, drain/freeze the wallet, and revoke_agent / revoke the credential so later checks fail closed. Test the path before you need it.
  6. Log allows, denies, timeouts, and revocations with agent_id, task_id, amount, merchant, decision, and receipt id. A missing deny is how silent retries rewrite history.
  7. Keep only a receipt id in the agent session — never approved=true, remaining budget, or card PAN/secret material the model can read or overwrite.

Instrument caps are necessary but not enough

Stripe Issuing for agents lets you set spending_controls at card creation (and update them later): spending_limits with intervals such as per_authorization and monthly, plus allowed_categories and country controls. Real-time authorization sends issuing_authorization.request so you can approve or decline from task context before the charge lands.

Per-task caps, approval, and a record the agent cannot edit

Per-agent daily caps stop one runaway bot; per-task caps stop one ticket from burning the whole daily budget. Key the budget row on (agent_id, task_id) and refuse charges that name a different or missing task_id.

What can go wrong?

One shared corporate card or hot wallet for every agent — a single compromise or prompt injection spends everyone's budget.

How do I ask Rightshold about this (free, no key)?

Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code, then ask: “Set a spending policy for this agent credential with a per-purchase and daily cap, then require my approval before any charge above the per-task threshold.”

One-click setup

{
  "tool": "set_spend_policy",
  "arguments": {
    "credential_id": "crd_…",
    "currency": "USD",
    "per_tx_max_minor": 2500,
    "daily_max_minor": 10000,
    "allowed_domains": [
      "api.vendor.example"
    ],
    "allowed_categories": [
      "saas"
    ],
    "expires_at": "2026-11-07T00:00:00Z"
  }
}

Rightshold records spending policies, spend authorizations and human approvals for agents that call it. It does not issue cards, hold balances, sign chain transactions, sit in your Stripe webhook, or stop an agent that never asks. Enforce caps on the card/wallet and in your authorization path too. Not legal advice.

What are the sources?

Related

Not legal advice. JSON · Markdown · All answers

Get a free API key in one call

No card and no email needed. 100 free credits; the license and policy checks stay free without a key.

curl -s -X POST https://www.rightshold.com/v1/accounts/signup -H "Content-Type: application/json" -d '{"accept_terms":true}'
export RIGHTSHOLD_API_KEY=rs_...   # the api_key from the reply (shown once)
curl -s https://www.rightshold.com/v1/licenses/check -H "Authorization: Bearer $RIGHTSHOLD_API_KEY" \
  -H "Content-Type: application/json" -d '{"license":"MIT","intended_use":{"commercial_use":true}}'