Skip to main content

Spending limits & smart wallet

When you give an agent a wallet, you want a hard ceiling on what it can spend. XDC AI enforces that ceiling on-chain, not just in our code, using a smart wallet with a scoped session key.

note

This is a newer, opt-in feature. You turn it on by setting a spending limit; until then your wallet works as a normal custodial wallet with no on-chain cap.

How it works

  • Your smart wallet is a Safe smart contract account on XDC mainnet, owned by your custodial wallet.
  • It holds a USDC allowance module that enforces a spend cap per period (per minute, hour, day, week, or month).
  • A session key is a separate delegate key that your agent signs with. It can spend from the smart wallet only up to the allowance, and the Safe contract rejects anything over the cap. Even a fully compromised or prompt-injected agent cannot exceed the limit you set.
  • Everything is gasless for you: a platform relayer submits the transactions and pays XDC gas.

Think of it as: your money sits in the smart wallet, the agent holds a key that can only draw down a metered allowance, and the chain enforces the meter.

Set a limit

  1. Go to xdcai.tech/account and open the Spending limits tab.
  2. Enter a USDC cap and a reset period (minute, hour, day, week, or month).
  3. Save. The first time, this deploys your smart wallet, enables the allowance module, and registers the session key. After that, saving just updates the cap.

You can see how much has been spent in the current period at any time, and lower or raise the cap whenever you want (a browser login is required, so an agent can never raise its own limit).

Move funds into the smart wallet

If your USDC is still in the plain custodial wallet, the dashboard offers a one-click, gasless Migrate to smart wallet that moves your USDC into the Safe so the on-chain cap applies to it.

Current scope

  • The cap is enforced for USDC per time period.
  • Per-token native XDC caps and per-transaction caps are on the roadmap.
  • To pause an agent, set its limit to 0.