Guides AgentCard

Give an AI Agent a Credit Card (Safely)

In this guide, you will learn how to give an AI agent a real payment method without handing over your main credit card.

intermediate 7 steps

Introduction

In this guide, you will learn how to give an AI agent a real payment method without handing over your main credit card. The workflow uses AgentCard to create prepaid or single-use virtual cards, then lets an agent such as Codex attempt a supervised checkout.

Start with a prepaid, single-use, low-limit card and keep a human approval step before the agent places the order.

Step-by-step 7 steps

Instructions

  1. Step 1 of 7

    Set The Safety Rules First

    Before you install anything, decide what the agent is allowed to do. The card details are real payment credentials, so treat them like secrets.

    • Use a card or bank product where you can set a low limit, lock the card, or let it expire quickly.
    • Pick a tiny first purchase. In the video, Billy used a $50 test card.
    • Keep your billing card, phone number, ID, and home address off-screen if you are recording or sharing the workflow.
    • Tell the agent to stop before placing the order unless you explicitly approve the final screen.
    • Do not save card numbers, CVVs, or personal addresses in project files, prompts, screenshots, or logs.
    Use a prepaid or tightly limited card for testing. The point is to make the agent useful without giving it access to your real financial blast radius.
  2. Step 2 of 7

    Install AgentCard

    Open a terminal in a scratch folder. Keeping this in a playground directory makes it easier to clean up if you are just experimenting.

    Prompt
    mkdir agent-card-playground
    cd agent-card-playground
    npm install -g agentcard

    Confirm the CLI is available:

    Prompt
    agentcard --help

    The current CLI uses the package name agentcard and exposes commands such as signup, setup, request, details, balance, and agentic.

  3. Step 3 of 7

    Sign In And Set Up Your Payment Method

    Sign in with your email address. AgentCard sends a magic link, so keep your email open.

    Prompt
    agentcard signup --email you@example.com

    After you click the magic link, run setup. This is where you add your profile, phone number, payment method, and any required verification.

    Prompt
    agentcard setup

    If AgentCard asks for identity verification, complete it through the provider flow. The video showed Stripe-hosted payment and identity screens, but you should still do your own review before submitting personal information.

  4. Step 4 of 7

    Create A Small Single-Use Card

    Once setup is finished, request a small card amount for your test purchase. The current CLI uses request new for single-use virtual cards.

    Prompt
    agentcard request new --amount 50

    If you need to re-fetch the card details later, use:

    Prompt
    agentcard request get <request-id>

    Only reveal card details in the moment you need them. If you paste them into an agent chat, assume they are now part of that conversation history.

  5. Step 5 of 7

    Give The Agent A Narrow Checkout Task

    Give the agent a specific, low-risk task. Separate billing information from shipping information, and make the approval rule explicit.

    Prompt
    Try buying this item with AgentCard: <product URL>
    
    Budget: $50 maximum, including shipping and taxes.
    Payment: use the AgentCard virtual card only.
    Shipping: use the shipping address I provide in this chat.
    Rules:
    - do not buy substitutions
    - do not save payment details to the store account
    - stop at the final review screen
    - ask me before clicking Place Order
    - if a page asks for login, a queue, 3DS, or identity verification, stop and ask me

    Watch the browser while the agent works. In the video, Codex eventually completed an NBA Store checkout, but it struggled with form controls and payment-method dropdowns before the order went through.

  6. Step 6 of 7

    Expect Checkout Friction

    Agents can still get stuck on checkout pages. Anti-bot protection, limited inventory, payment widgets, and browser handoffs can all confuse them.

    • If the agent cannot add an item to cart, add it yourself and let the agent continue from checkout.
    • If the agent keeps clearing a payment form, pause and manually inspect the selected payment method.
    • If the site uses 3DS, queues, login, or identity checks, keep those steps manual.
    • For a first test, use a simpler merchant before trying a site with limited drops or heavy anti-bot rules.

    After the order, check AgentCard and the merchant confirmation to make sure the charge amount, merchant, and shipping details are correct.

  7. Step 7 of 7

    Add MCP Or Agentic Checkout Later

    Once the basic CLI flow works, you can expose AgentCard through MCP so compatible agents can request setup instructions or create cards through tools.

    Prompt
    {
      "mcpServers": {
        "agentcard": {
          "command": "npx",
          "args": ["-y", "agentcard-mcp"]
        }
      }
    }

    AgentCard also exposes experimental agentic checkout commands. Use these only after you understand the basic card request flow and have a clear approval process.

    Prompt
    agentcard agentic connect
    agentcard agentic buy --merchant "Example" --url https://example.com --item "Test item" --amount 10 --checkout

You're done

That's the whole workflow

Mark it complete to save your progress. Background and answers to common questions follow below.

Keep going

Keep learning with Rundown Pro

A guide shows you one workflow. Pro opens the full course library, so you can learn the whole system behind it.

  • Every on-demand course
  • Certifications on completion
  • Group office hours and member perks

$29/mo, cancel anytime

Overview Back to the steps

Background and context

Who This Is Useful For

  • People who want an AI agent to buy a low-risk item online while they supervise the final checkout.
  • Builders testing agent commerce, browser automation, and checkout workflows.
  • Teams that need a safer alternative to pasting a real company card into an agent chat.
  • ChatGPT, Codex, Claude Code, Cursor, or other MCP users who want payment controls before experimenting.

What You Will Build

You will build a controlled agent purchasing workflow: install AgentCard, sign in, attach a low-risk funding source, issue a small card, and give the agent a checkout task with strict spend and approval rules.

The safe version is not fully autonomous. The agent can help navigate checkout, but you should keep the spending limit small, watch the browser, and require a human approval before the order is placed.

What You Need

  • Node.js 18 or newer and npm.
  • A terminal you are comfortable using, preferably inside a throwaway playground folder.
  • An AgentCard account and access to email for the magic link login.
  • A low-limit payment method or temporary card. Do not start with your primary checking debit card or main company card.
  • A small test purchase and a merchant site you are comfortable using.
  • Codex, Claude Code, ChatGPT with an MCP server, or another agent that can use a browser or terminal tools.

Going Further

Agent commerce is still early. Some stores have anti-bot flows, confusing checkout forms, 3DS checks, or payment widgets that agents handle poorly. Start on a simple, low-stakes purchase before trying a merchant with queues, limited inventory, or complex shipping rules.

AgentCard also publishes an MCP server and experimental agentic checkout commands. Those are useful when you want the agent to request card details through tools instead of relying on copied text, but you should still keep approval and spend limits in place.