Skip to content

armgit / kwant

Public Imported from GitHub
0

Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.

12.8 KB
Raw Blame

Payments always ask

A tool call that looks like paying always shows an approval card, whatever the bot's approvals say: ask, smart or off. Oleks decided this on 2026-10-27 (Phase C D8): with approvals off, sending, deleting, publishing and signing in run without asking, but payments still ask. The same will hold at every Flight School tier.

  • "Ask only when risky" saying a payment is safe doesn't skip the card.
  • "Always this session" for the tool (e.g. all Bash) doesn't skip it.
  • "Always this session" on a payment's own card allows that one call; nothing is remembered, and the next payment asks again.
  • No setting turns this off. It costs the occasional card for something that wasn't a payment.
  • A card the person allowed after its turn ended (late Allow) runs that exact call once, as for any card.

The check is src/mcp/payment_floor.rs, a pure function of the tool's name, its arguments and, for kwnt's own browser, the address the browser itself reports. Nothing the bot writes, no "Ask only when risky" verdict and no task field can mark a call as "not a payment". The card's details.payment_reason says why it asked. It runs in BrokerApprover (claude's tools and every MCP tool, through claude's permission prompt and the MCP gateway), in SelfToolsApprover (kwnt's own browser_act), and for API drivers' execute_shell.

What counts as a payment

MCP and Composio tools (by tool name, server name, and the tool_slugs inside COMPOSIO_MULTI_EXECUTE_TOOL):

  • Every tool of a money-only app that doesn't start with a read verb (get, list, retrieve, search, …): Stripe, PayPal, Square, Wise, Coinbase, Braintree, Adyen, Revolut, Mollie, Paddle, Lemon Squeezy, Razorpay, GoCardless, Klarna, Venmo, Cash App, Chargebee, Recurly, Payoneer, Checkout.com, Authorize.net, Plaid, MoonPay, Kraken, Binance.

  • Paid generations (since 26h): a tool that spends the person's credits on an image and video app. The app is known by the server's name or its address, never by the tool name alone, so a shop's or a local model's generate_image doesn't ask.

    • Black Forest Labs (FLUX): a server named flux, bfl or black-forest-labs, or at mcp.bfl.ai or any other *.bfl.ai address. generate_image, generate_variations, vto, generate_video, enhance_video, upscale_video, edit_video, and any new tool there that doesn't start with a read verb.
    • Picsart: a server named picsart, or at api.picsart.com or any other *.picsart.com address. picsart_generate, picsart_remove_bg, picsart_change_bg, picsart_enhance, picsart_vectorize, picsart_media_contact_sheet and picsart_media_export. Its scene edits (picsart_media_apply_*) and drive cost nothing and don't ask.
    • Reads never ask: get_credits, get_history, get_result, list_skills, get_skill, request_upload_url; picsart_credits, picsart_job_status, picsart_list_models, picsart_model_catalog, picsart_model_params, picsart_preflight.

    The card says whose credits the call uses ("This uses your Black Forest Labs credits: generate_image", details.credits) and never shows a price: kwnt doesn't know it. A server someone renamed (say images at mcp.bfl.ai) is still known by its address, also when an agent CLI asks for the call (credit_floor looks the bot's server up).

  • Any other tool whose name has a pay word (pay, payment, payout, purchase, checkout or check_out, buy, charge, donate, …), a money move (send/transfer/withdraw with money, funds, cash, crypto, btc, usdc, usd, stablecoin, …), or an order step (place/submit/confirm with order, purchase, booking, subscription). token, coin and asset don't count in a name: move_asset, send_token_email or deposit_coin usually move files, logins or game items. A crypto send named that way asks by its arguments (next rule).

    A name only reads when its first action word is a read verb and so is the first word after each and/then: get_quote reads, estimate_and_send and check_then_transfer don't.

  • Any tool that doesn't start with a read verb whose arguments (top level, or one object down; any spelling: amountIn, amount-in) have both:

    • an amount: a number (5, "0.001", "1e18", "0x2386…", "5 USDC", "$5", "5€", "max") or an amount object with one ({value: "5", currency: "USDC"}, also units, quantity, raw, decimal) under amount, amount_in, amount_out, value, quantity, sum, any *_amount or any amount_* (amount_wei);
    • and a destination or asset: under to, recipient, destination, to_address, address, token, token_in, token_out, asset, currency or coin, a value that looks like an account address (EVM 0x + 40 or 64 hex, ENS *.eth, bech32 bc1…/cosmos1…, base58 such as Solana accounts and mints, or an IBAN with a valid check) or a crypto asset (USDC, ETH, BTC, SOL, … or token, coin, native). A swap pair (token_in with token_out, from_token/to_token, sell_token/buy_token, input_mint/output_mint) counts whatever the tokens are called, since wallets take any token there.

    The key names alone aren't enough, so convert {from: "km", to: "mi", value: 5}, update_cell {address: "A1", value: 5}, set_limit {token: "t", value: 100} or an http_request with body {amount: 5, to: "x"} don't ask. Pure-compute verbs (calculate, compute, format, translate, scroll) count as reads. convert doesn't: some wallets call their swap that, so convert {amount: 1, from: "USDC", to: "ETH"} asks and a unit or fiat conversion (to: "mi", to: "EUR") doesn't. Fiat codes are not crypto assets here. The same goes for each tool_slug Composio runs, by that slug's own arguments. The reason reads e.g. "send_transfer moves an amount to another account or asset".

    This is what catches a crypto wallet MCP such as Incentiv's (incentiv-mcp, src/wallet/tools.ts): send_transfer {token, to: "0x…40 hex", amount} and send_swap {token_in, token_out, amount_in, minimum_out, …} name no money app and no money noun, so before 0.7.1 they asked only in ask and smart (the server marks them destructive) and ran without a card with approvals off or after "always allow". Its reads (get_swap_quote, get_agent_wallet, get_agent_operation) still don't ask.

  • A browser-type MCP tool (name with click, tap, press, submit) whose arguments name a pay-type label, or one that types (type, fill, input, …) a card number.

  • A remote shell tool (bash, shell, exec, command…) whose command is a payment below.

Shell commands (claude's Bash, API drivers' execute_shell, MCP shell tools):

  • A request that writes (-X POST/PUT/PATCH/DELETE, -d, --data*, --json, -F, --form, wget --post-*, httpie's method word, or code calling .post() to a payment host: stripe.com, paypal.com, squareup.com, wise.com, coinbase.com, adyen.com, … (the list in PAYMENT_HOSTS). A GET doesn't count.
  • stripe CLI commands that change something (post, create, update, delete, capture, confirm, refund, trigger, …).
  • Crypto wallet sends: cast send, bitcoin-cli sendtoaddress/sendmany/send…, solana transfer, spl-token transfer, electrum payto, lncli sendpayment/payinvoice/sendcoins, lightning-cli pay/withdraw, monero-wallet-cli transfer, cardano-cli … submit, and others in WALLETS.

kwnt's own browser (browser_act):

  • Clicking a pay-type label: Pay, Buy, Purchase, Checkout/Check out, Subscribe, Upgrade, Donate, Place order, Confirm order, Complete payment, Book now, Top up, … or any label with a price on it ($12.99, 12,99 €, USD 10).
  • Any click, Enter or Space on a checkout page: a payment host (checkout.stripe.com, paypal.com, pay.google.com, …), a host starting checkout./pay./payment./billing., or a path segment like /checkout, /payment, /pay, /billing, /buy, /subscribe. The address comes from the browser, not the bot.
  • Typing anything that looks like a card number: 13–19 digits (spaces or dashes allowed) that pass the Luhn check.

Before the click or key, kwnt also reads the page itself (BrowserController::payment_signals, rules in payment_floor::page_reason), so the bot's own words never decide:

  • The element the click would really hit (the control a ref points to, or the same match click_text makes) has a pay-type label: the bot wrote "order", the button is "Place order".
  • A button on a page with card fields: a card number or CVC field (autocomplete="cc-number", cc-csc, cc-exp, or a name/id/placeholder like cardnumber, cvc, cvv), in open shadow roots and same-origin frames too, or a payment provider's card frame (js.stripe.com, Braintree, Adyen, Square, PayPal, … or a frame titled like "Secure card payment input frame"). "Continue", "Next", "Finish" and "Submit" ask there; buttons starting "Cancel", "Back", "Edit", "Apply", "Add", … and clicks into the fields don't.
  • A submit button whose form posts to a checkout address (action or formaction).
  • Enter or Space in a card field, in a form with card fields, in a form that posts to a checkout address, or anywhere on a page with a payment provider's card frame. Either key on a focused button or link presses it, so the click rules above apply to it, by the text it shows.

The shell bots' browser API (POST /api/sandbox/:id/bot/:kwant_id/chat/:chat_id/act, the address in each bot's prompt; the older /bot/:kwant_id/act and the person's plain /api/sandbox/:id/act behave the same here) can't show a card, so it doesn't do an action that looks like a payment: the page comes back with error ("Not done: this looks like a payment …") and payment (why), and the bot is told to leave that step to the person in the live browser panel. Clicks by position (/api/sandbox/:id/interact) are the person's live view only.

WebFetch never pays (it only reads). kwnt's own other tools don't pay, and self_tools_have_no_money_words fails if one is added with a money word in its name until it is classified here.

What it doesn't catch

  • A plain "Continue", "Next" or "Confirm" button on a checkout page whose address doesn't look like one and that shows no card fields or payment frame (e.g. a review step with a saved card).
  • A card the website already has saved, one-click buying, and Apple Pay or Google Pay sheets.
  • A payment frame from a provider missing from the lists, with no card-like title.
  • A page kwnt can't read before the click (the browser didn't answer): only the label and address rules count then.
  • A card number typed in pieces (one field for each group of 4 digits).
  • Shell commands that hide the host or method: variables ($URL), scripts, config files, other languages' HTTP libraries without .post(, and SDKs (stripe.Charge.create(...) in Python).
  • Payment services, MCP tools and wallets missing from the lists, and tools whose names don't say what they do and whose arguments don't carry an amount and a destination or asset in reach (e.g. {order: {lines: [{amount, to}]}}, two levels down, or an amount under another key name such as units outside an amount object).
  • A send whose destination is a name or handle rather than an address (to: "bob"), with a token missing from the list, or a fiat send to an account number that isn't an IBAN, unless its name says it pays (send_money, transfer_funds) or its app is a money app. A send_tokens or withdraw_coins with such arguments doesn't ask either: token and coin in a name aren't enough on their own.
  • Codex's own shell, which kwnt never sees. Its sandbox has no network, so it can't reach a payment service.
  • Someone else's browser tools the bot drives through an MCP server, unless the tool's label or typed text matches the rules above.

It also asks for some things that aren't payments, e.g. an "Upgrade" link in docs, any click on a /billing page, a git tool named checkout/check_out (git_checkout, check_out_branch), a wallet's unsigned build_transfer/build_swap (no key moves), or an ordinary write that happens to hold a number and an address-shaped value (e.g. a key-value store's set_limit {token: "<32-character base58 key>", value: 100}). That's accepted: an extra card costs a tap, a missed payment costs money.

Tests

cargo test --test payment_floor_test, cargo test --test mcp_media_test (paid generations on an offline FLUX-shaped server), cargo test --test browser_pay_gate_test (a real Chrome on local card pages; -- --ignored also walks saucedemo.com to "Finish") and the tables in src/mcp/payment_floor.rs (cargo test --lib payment_floor).