> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rhinestone.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Spending limit

You can limit the amount of ERC20 tokens transferable through a session function. Attach the policy at the function level — it caps the cumulative amount across all uses of that function.

```ts {13-16} theme={null}
const session = toSession({
  chain: base,
  owners: {
    type: 'ecdsa',
    accounts: [sessionOwnerAccount],
  },
  permissions: [
    {
      abi: erc20Abi,
      address: usdcAddress,
      functions: {
        transfer: {
          spendingLimit: {
            token: usdcAddress,
            amount: parseUnits('10', 6),
          },
        },
      },
    },
  ],
})
```

This caps total USDC transfers within the session to 10 USDC.
