To let an AI agent spend money safely, enforce the limit in the payment system and keep it out of the prompt. The model must not be able to give itself permission to spend. Stripe and Replit both work this way. Stripe stops sensitive actions until a person confirms them or a designated reviewer approves them. Replit's agent stops at checkout until the owner approves the final total.
Why a prompt cannot hold a spending limit
More agents can now move money. Stripe says that agents can now send money to other people with Stripe Treasury (Stripe). Replit Agent can now buy supplies for a business through Link, Stripe's consumer network, which has more than 300 million users (Replit). AWS built a payments feature into Bedrock AgentCore so that agents can pay for APIs, MCP servers, and content (AWS).
A system prompt is an instruction to the model. It is not a control. A model can misread a rule, and text from a web page or a customer message can manipulate it. If the only rule is "do not refund more than $500", one bad input can cause a large refund. Our post on AI agent guardrails explains this gap in general terms.
AWS describes the usual situation: "developers typically build governance frameworks and budget controls from scratch to prevent runaway spending" (AWS). Payment platforms now supply these controls themselves, so you do not have to build them. The rest of this post compares how they work and helps you select one.
Two identity modes: the agent acts for a person, or as itself
The first decision is whose identity the agent uses. Stripe gives two answers, and each answer has a different control.
On-behalf access (OAuth). OAuth is a standard way to let an application act with your account access after you log in. The agent then acts as you. Stripe says: "If your agent makes a refund or payout in live mode, Stripe requires you to confirm the action before money leaves your account." After you confirm, you tell the agent to try again (Stripe). This check applies "even if you've disabled your client from asking for permission before making tool calls to Stripe."
Independent identity (agent-tagged API key). An agent that runs on its own has a problem with OAuth. Stripe explains: "OAuth doesn't work here, because it's tied to your login session, and every confirmation routes to you personally." The agent gets an agent-tagged API key instead. Each key has its own permissions, rotation, and expiration. Stripe's Approval rules treat the agent "as an independent actor and require approval by designated reviewers for sensitive actions."
Use this rule to select a mode:
- If a person works with the agent in real time (for example, a developer in a coding assistant), use on-behalf access. That person confirms each sensitive action.
- If the agent runs unattended (for example, a support agent that handles refund tickets at night), give it its own identity. Approval rules then send each sensitive action to a reviewer.
An agent with its own identity also gets its own audit trail and its own permissions. Our post on agent identity management covers how to issue and rotate such credentials.
How Stripe approval rules work for an agent key
An approval rule is a condition in Stripe that pauses a matching action until a reviewer approves it. Stripe sets up default rules for agent-tagged keys. They cover "refunds, payouts, and outbound transfers - so there's a baseline of oversight in place the moment you create the key" (Stripe).
When a rule matches, the action does not run. Instead, "the API returns an approval_required error instead of completing the action, and Stripe automatically submits an approval request for review." The agent can add a reason to the request with the update endpoint, for example a support ticket number. If a reviewer approves, Stripe tries the captured action itself, and the request ends as succeeded or failed. If a reviewer rejects it, the action does not run.
Two defaults are important for security:
- No self-approval. "No single actor (human or agent) can approve their own request by default."
- Expiry. "Requests that haven't been approved within 14 days expire automatically."
To create a rule, go to Settings > Approvals > Create rule in the Stripe Dashboard. Then set these parts:
- Select a trigger action, for example "Refund is created".
- Add a condition, for example "Amount > $500".
- Optionally, limit the rule to agent-tagged API keys. By default, a rule applies to all team members and agent keys.
- Name the reviewers, for example users with the Support Specialist role.
- Select the control: require approval, or block the action.
The rules apply "to team members and agent keys alike, whether the action comes through the Dashboard or the API." Thus one policy covers people and agents.
How Replit stops at checkout
Replit solves a different problem. Its agent buys goods from many merchants, and each merchant has its own site. Replit Agent "coordinates the purchase while a browser subagent navigates the merchant's site, prepares checkout, and returns the purchase details to Agent for your approval" (Replit). The browser comes from Browserbase, so Replit does not need an integration with each store.
Replit lists three controls:
- A stop at checkout. "The browser session is isolated, and Agent stops at the checkout for approval. It never gets open-ended permission to spend."
- Approval of the final total. The owner selects a saved payment method in Link and approves the total. The agent cannot change the amount after approval, because "Link facilitates the transaction scoped to the approved purchase."
- Fewer tools during payment. "During payment, shell access and general browsing are disabled, and approval checks are enforced in code, not left to the model."
Visa supplies the payment infrastructure. In the Replit announcement, Visa's Rubail Birwadker says Visa helps "ensure agents transact within the boundaries people set." The feature is for Core and Pro users, starts in the US, and is limited to one-time purchases.
Side-by-side comparison
| Replit Agent | Stripe OAuth (on your behalf) | Stripe agent-tagged key | |
|---|---|---|---|
| Identity | Acts for the business owner | The user's login session | Independent actor |
| What triggers a stop | Every purchase, at checkout | Live-mode refunds and payouts ("certain write actions") | Approval rule conditions. Defaults cover refunds, payouts, outbound transfers |
| Who approves | The owner approves the final total | The user personally | Designated reviewers. No self-approval by default |
| Expiry of a pending request | - | - | 14 days |
| Tool restrictions during payment | Shell access and general browsing off | - | Key permissions are scoped |
| Current scope | Core and Pro users, US, one-time purchases | Live mode | - |
| Best fit | Purchases with a total that changes per order | A person who works with the agent | An agent that runs unattended |
Other controls: budgets, microtransaction guardrails, and edge checks
Approval for each payment is one control among several. Other companies use different controls for different kinds of spend.
- Budgets. Replit's Google Ads feature uses a budget, for example "I'm willing to spend $40 a day for 30 days." The user reviews and approves the campaign once (Replit).
- Microtransaction guardrails. AWS AgentCore payments handles payments that "are typically microtransactions (often under $1 or fractions of a cent)". It uses stablecoins, the x402 protocol, and "configurable guardrails to help control agent spending" (AWS). If a person had to approve each payment of a fraction of a cent, the feature would be useless.
- Checks at the edge. Fastly separates machine-to-machine payments from agentic commerce. It says the network edge must answer: "Is this a trusted agent? Is the request consistent with the user's mandate?" (Fastly).
Use this table to select a control for each kind of spend:
| Kind of spend | Example | Recommended control |
|---|---|---|
| Many very small, metered payments | Paid API calls, content access | Budget and per-call guardrails, no per-payment approval |
| A recurring budget | Ad spend per day | Approve the budget once, then let the agent spend inside it |
| One-time purchases with a changing total | Supplies from a merchant site | Stop at checkout, owner approves the final total |
| Refunds, payouts, and transfers from your account | Support refunds | Approval rules with thresholds and designated reviewers |
Set thresholds that reviewers will read
If every action needs approval, reviewers stop reading the requests. Our post on approval fatigue shows how fast human review fails at high volume. Thresholds keep the queue short.
Stripe gives an example: "refunds under $50 go through automatically, while refunds over $500 need sign-off" (Stripe). This example is not a default setting. It also leaves refunds from $50 to $500 without a rule. Decide what happens in that band before launch. Do not let a gap set the policy.
A hypothetical three-tier refund policy can look like this:
| Refund amount | Control | Reviewer |
|---|---|---|
| Under $50 | Runs automatically | None. Log the refund |
| $50 to $500 | Requires approval | Support specialist |
| Over $500 | Requires approval | Finance lead |
| Any amount to a new bank account | Block | Not allowed for the agent |
Write the policy in your allowed actions document first. Then set it up as rules in the payment system. Stripe's post shows one rule with one condition and one reviewer group. It does not say whether you can set several rules with different reviewers for the same trigger, or which conditions a rule accepts. Check this in your Dashboard before you rely on a multi-tier design. Review the thresholds each month against real volumes. If the queue grows past what reviewers can read each day, raise the lowest threshold or add reviewers.
Worked example: a $720 refund (hypothetical)
This is a composite example. It uses the Stripe controls described above.
- A customer asks the support agent for a $720 refund.
- The agent calls the refund API with its agent-tagged key.
- The rule "Refund is created, Amount > $500" matches. The API returns
approval_required, and Stripe submits an approval request. - The agent adds the reason "Refund requested via support ticket #4821" with the update endpoint.
- The agent tells the customer that the refund is in review. The agent does not need to send the call again, because Stripe runs the captured action after approval.
- A finance lead opens Settings > Approvals > Requests and approves the request.
- Stripe runs the refund. The agent receives
v2.core.approval_request.succeededand closes the ticket. - If nobody approves within 14 days, the request expires. The agent receives the expired event and sends the ticket to a person.
Remove tools during the payment step
Replit turns off shell access and general browsing during payment. Copy this control. At checkout, the agent holds payment context and reads a merchant page that it does not control. If you remove the shell and general browsing at that step, the agent has fewer ways to act on instructions injected into that page.
Use these steps for any payment step that you build:
- Start the payment step in a new session that has only the tools that the payment needs.
- Turn off shell, file, and general web tools for that session.
- Show the person the final total and the merchant before you charge.
- Check the approval in code before the charge call. Do not ask the model whether approval exists.
- Scope the payment credential to the approved amount and merchant.
What to log for every agent payment
Approval controls are useful only if you can reconstruct each decision later. Stripe sends webhook events for each state of an approval request: created, approved, rejected, canceled, expired, succeeded, and failed, each with the prefix v2.core.approval_request. (Stripe).
For each payment, record these items:
- The agent identity and key that started the action.
- The reason, with a link to the ticket or order.
- The rule that matched, and the reviewer who decided.
- The time of each state change, from the webhooks.
- The final result: succeeded, failed, rejected, or expired.
Two agents can also act on the same order. If one agent retries while another agent issues the same refund, you can pay twice. Our post on idempotency keys and optimistic locking shows how to prevent this. Our post on AI agent audit trails covers what regulated teams must keep.
When this pattern is the wrong choice
Approval for each payment does not fit every case.
- Microtransactions. If an agent pays fractions of a cent per API call, use a budget with guardrails, as AWS AgentCore does.
- Very high volume of small refunds. If most refunds are small and easy to reverse, approval for each refund adds delay and gives no extra safety. Use automatic refunds under a threshold and a daily cap.
- Actions that must never happen. Do not ask a reviewer to approve a payout to an unknown account. Block the action.
- Time-critical payments. A request that waits up to 14 days does not suit a payment that must clear in minutes. Use a smaller scope with automatic approval, or keep a person in the loop in real time.
Steps to start this week
- List each action in which your agents can move money: refunds, payouts, transfers, purchases, and metered usage.
- For each action, decide whether the agent acts for a person or as itself.
- Give each unattended agent its own scoped key. Do not share a human's credentials.
- Write the threshold table and the blocked actions. Then set them up as rules in the payment system.
- Turn off shell and browsing tools during payment steps.
- Connect the approval webhooks to your logs and your ticket system.
- Test each path in test mode: auto-approve, approve, reject, and expire.
Give your agents a payment budget that your finance team approves
Refund and purchase agents save time only if your finance and security teams agree to let them run. OpenNash puts forward-deployed engineers on your team and works with Fortune 2000 companies. A typical engagement on agent payments follows these steps:
- Map every action in which an agent can move money, and the system of record for each action.
- Write the allowed-actions policy, the thresholds, and the reviewer roles with your finance team.
- Build evals that test approve, reject, expire, and prompt-injection cases before launch.
- Ship the agent with scoped identities, approval rules, payment-step tool limits, and full audit logs.
- Train the reviewers and set a monthly threshold review.
At the end, you own the agents, the policies, the evals, and the logs.
Book a call with an OpenNash forward-deployed engineer or email us at hello@opennash.com. In the first session, we review your top AI use cases and data, and show which deliver the highest business value and the fastest ROI.