Skip to main content
use provider: "vgs" when your cards already live in your own VGS vault and you want KERNEL browsers to pay with them. your vault stays the source of truth: you give KERNEL a read-only VGS service account, and each purchase carries the card’s aliases from your vault. neither your application, KERNEL’s api, the agent, nor the browser receives the card number or security code. at authorization, KERNEL reads your aliases through its own VGS outbound proxy, which replaces the revealed values with aliases in KERNEL’s VGS vault before they reach KERNEL. at checkout, KERNEL’s VGS proxy reveals the card to the merchant.
provider: "vgs" requires @onkernel/sdk 0.141.0 or later, or kernel 0.141.0 or later for Python. the CLI doesn’t support VGS provider configurations or cards yet.

How it works

  1. register your service account once. create a provider configuration with a VGS service account that can read aliases from your vault.
  2. create a wallet. the wallet binds that configuration and connects immediately. it holds no cards.
  3. create a card for each purchase. send the card’s PAN alias, a freshly collected CVC alias, the expiry, and the last four digits.
  4. authorize. KERNEL reveals both aliases from your vault through its VGS proxy and stores KERNEL-vault aliases. the card becomes ready with no further cardholder approval.
  5. fill and submit. fill types KERNEL’s aliases into the checkout. when the browser submits, KERNEL’s VGS proxy replaces them with the real card details on the way to the merchant.

Before you start

  • enable alias reveal on your vault. ask VGS to enable the aliases:read capability and alias reveal on your vault. it’s off by default.
  • create a read-only service account. in your VGS dashboard, create a service account with only the aliases:read scope. KERNEL uses it to reveal aliases; it doesn’t need write or card management scopes. you can revoke or rotate it at any time; once you do, KERNEL can’t authorize new cards from your vault.
  • store cards as aliases. store the card number as a persistent alias. any alias format works; KERNEL chooses the format of its own aliases.
  • collect a fresh CVC for each purchase. card networks don’t allow storing a security code after authorization, so collect it again for each purchase, for example with a VGS Collect CVC field. store it as a volatile alias and create the card item right after collection. the alias must still exist when you authorize.
create a project-scoped client and vault. the examples below use these kernel and vault variables.

Register your service account

register a provider configuration once for your organization. configurations are shared across projects, so authenticate this step with an organization-scoped api key. keep the service account credentials in your backend, outside the agent’s context.
vault_id is your VGS vault ID, and environment is sandbox or live to match it. before storing anything, KERNEL checks that the service account holds aliases:read and that it can reach vault_id in environment. if either check fails, creation returns 400 invalid_request and nothing is stored. the response returns client_id, vault_id, and environment. it never returns client_secret.
  • rotation: you can update client_secret only. KERNEL re-runs both checks against the same vault and environment, and refuses the update if either fails.
  • changing vaults: client_id, vault_id, and environment can’t change. to use another vault or service account, create a new configuration and new wallets.

Create a wallet

create the wallet with the project-scoped kernel client. provider_config is required, because there are no KERNEL-managed VGS credentials. pass the configuration’s name or id; responses return the resolved id.
the wallet’s state.status is connected on creation. it has no enrollment action and no payment methods. if it reports pending_authorization or degraded, creation didn’t finish; reading the wallet retries it. KERNEL checks whether the service account still works when you authorize a card, not when you read the wallet.

Make a purchase

  1. attach the vault when you create the browser.
  2. collect a fresh CVC from the cardholder and store it as a volatile alias in your vault.
  3. create a card item with the wallet, the merchant, amount, and currency, and the card’s aliases in spec.card.
  4. invoke authorize. it takes no parameters and returns the card ready, with no action for the cardholder.
  5. fill the checkout before expires_at, submit once, and verify the merchant’s order record. a completed fill isn’t proof of payment.
the examples create and authorize a card for 452.10 usd.
spec.card is write-only. KERNEL stores it encrypted and never returns it in the item, its events, or logs. a repeated PUT with the same key must send the same card, and card updates return 409; to change anything, delete the item and create a new one. once ready, the card supports fill on merchant_url’s origin until expires_at, five minutes after authorization by default. it then becomes expired, and you need a new card item with a freshly collected CVC. supported fill fields are number, cvc, exp_month, exp_year, and expiration; billing fields aren’t available for VGS cards. the item’s masks.last4 shows the card’s last four digits; the card brand isn’t reported. the recorded amount and merchant don’t restrict the payment requests the browser sends. expires_at isn’t a single-use guarantee.

Handle authorization failures

if authorize fails, KERNEL stores nothing from your vault. the card’s state.status and state.status_reason tell you what to do next:

What KERNEL stores

  • card number: KERNEL keeps an alias of the card number in its own VGS vault. it remains there after the card item expires or is deleted.
  • security code: KERNEL keeps a volatile alias of the security code, which VGS deletes automatically within an hour.
  • your aliases and credentials: your aliases and service account secret are encrypted at rest and never returned.
KERNEL never receives the card number or security code itself. to stop KERNEL from reading your vault, revoke the service account in VGS and delete the provider configuration. deletion returns 409 while any item still references it.

Reference