Integrate

AI agents & MCP

Agent budgets (mandates), scoped tokens, the MCP server and the agent API.

Agentic commerce needs a way to let software spend money without handing it a card. Kept's answer is the agent budget (a mandate): a verified policy, a budget held on PayPal, and scoped tokens your agents use instead of payment details.

Create a budget

Describe it in a sentence (Claude drafts the policy) or fill in the fields yourself on Agents → New agent budget. A policy has:

FieldExample
PurposeRestock office supplies for a five-person team
Budget$200 total
Per purchaseat most $50
Approval thresholdask me above $30 (or never)
Purchasesat most 10, at most 5 per hour
Merchants@supplies.example.com, orders@coffee.example.com
Expiry168 hours (at most 28 days, inside PayPal's authorization window)

Before you can fund it, Kept proves the caps hold (the budget can't be exceeded, no purchase can bypass a limit) and runs thousands of simulated hostile purchase attempts as a check.

How a purchase is decided

  1. The agent requests a spend with an idempotency key.
  2. A deterministic guard checks it against the policy: status, expiry, merchant, amount, totals, counts, velocity. Spends still waiting count toward the limits, so an agent can't queue past them.
  3. Within limits and under the threshold: an AI screener checks the purchase fits the stated purpose. It can only escalate, never approve something the guard blocks.
  4. Approved spends are captured from the hold and paid to the merchant on PayPal. Above-threshold spends wait for you. Screening that doesn't finish in 10 minutes escalates to you.

Connect an agent

Issue a token on the budget's page. It starts with mt_ and is shown once.

Remote MCP (no install)

bash
claude mcp add --transport http kept https://befitting-mosquito-713.convex.site/mcp --header "Authorization: Bearer mt_..."

Local MCP server

bash
claude mcp add kept -e KEPT_API_URL=https://befitting-mosquito-713.convex.site -e KEPT_MANDATE_TOKEN=mt_... -- npx -y @kept/mcp

For Claude Desktop or Cursor:

json
{
  "mcpServers": {
    "kept": {
      "command": "npx",
      "args": ["-y", "@kept/mcp"],
      "env": { "KEPT_API_URL": "https://befitting-mosquito-713.convex.site", "KEPT_MANDATE_TOKEN": "mt_..." }
    }
  }
}

Tools

ToolWhat it doesNeeds
verify_contract, explain_contract, contract_language, example_contractsWrite and prove payment contractsnothing (offline)
verify_mandate, check_spendCheck a policy or a purchase against onenothing (offline)
verify_proof_packIndependently audit a settled promisenothing (offline)
get_mandate, find_products, request_spend, get_spendFind and buy inside a budgeta mandate token
list_contracts, get_contract, create_contract, compile_contract, approve_contract, contract_proofWork with promisesan API key

Agent API (REST)

MethodPathBody
GEThttps://befitting-mosquito-713.convex.site/agent/v1/mandateWhat the agent may do right now
POSThttps://befitting-mosquito-713.convex.site/agent/v1/spends{ merchantEmail, merchantName?, amountCents, currency?, description, idempotencyKey }
GEThttps://befitting-mosquito-713.convex.site/agent/v1/spends/{id}One spend's status
POSThttps://befitting-mosquito-713.convex.site/agent/v1/products/search{ query, limit? }: only offers the budget allows

Authenticate with Authorization: Bearer mt_.... A denied answer is final; don't retry it with a new key.

Shopping inside a budget

find_products searches real products through Channel3. The budget isn't just checked after the search, it shapes the search:

  1. The policy becomes the filters. The price ceiling is the per-purchase limit or what's left of the budget, whichever is lower. The retailers are the merchant allowlist. Only in-stock, new items.
  2. Every offer meets the purchase guard. Each retailer offer is checked exactly as a purchase would be: budget, per-purchase cap, allowlist, purchases left, hourly rate, expiry.
  3. The agent sees only what it may buy. Allowed offers (and ones that would need your approval) come back with a ready-made purchase object to pass to request_spend. Blocked offers are hidden and only counted, by reason.

The owner's budget page has a preview of the same search that also shows the hidden offers and why. The decision is checked again when the agent calls request_spend, so a price change between search and purchase can't slip through. In sandbox, Kept pays the retailer's PayPal stand-in address (an allowlisted PayPal email on the retailer's domain wins).

Safety notes

  • Tokens are stored as SHA-256 hashes, scoped to one budget, expire, and can be revoked instantly.
  • Merchant names and descriptions from agents are treated as untrusted text in every AI prompt.
  • Closing a budget cancels pending requests and releases the unused hold.
Improve this page on GitHub