Skip to main content
Session limits define the maximum authority an app-held key can exercise. Choose the narrowest scope that supports the workflow, then pass it to the session grant.

Contract and function scope

definePermissions() binds each entry to one contract address and the selectors derived from its ABI. Listing one function does not authorize other functions on that contract. Examples on this page use @rhinestone/1auth. vault and vaultAbi are your own contract’s address and ABI.
An empty function configuration leaves that function’s parameters unconstrained. Add explicit rules for recipients, spenders, asset addresses, and amounts that must not vary.

Parameter and value limits

Use parameter names from the ABI. This example fixes the vault receiver and caps each deposit:
For payable functions, cap the native token sent with each call:
Parameter rules are calldata constraints. They do not infer business meaning from an ABI. For a token workflow, constrain every relevant leg—for example, both the spender and amount on approve, then the receiver and amount on deposit.

Chain scope

Pass every destination execution chain explicitly in targetChains:
The same reviewed permission is installed on each listed target chain. Embedded wallets return chainIds and permissionIdsByChain in the session handle; use the entry for the chain that executes each operation. Do not treat a chain’s presence in a wallet, quote, or token request as session authority. Only the session-key configuration installed for that chain can authorize the session signer there.

Time and usage limits

Set limits in the grant or on individual function configurations. Grant-level values are copied onto every listed function that does not override them. They do not create one shared session-wide counter.
Use seconds, not JavaScript milliseconds. Expiry applies to every function receiving the default. Usage exhaustion is narrower: exhausting one function’s counter on one chain blocks that function on that chain, while other function and chain counters can remain usable. Treat the whole grant as exhausted only after checking every installed policy that matters to your workflow.

Source-chain claim authority

A destination selector does not authorize a settlement layer to claim assets on a funding chain. For a crosschain intent, configure both:
  • targetChains and normal permissions for calls on the destination chain.
  • sourceChains and crossChainPermits for Permit2 claim signatures on funding chains.
The source-chain configuration authorizes only the structured claim. Selector permissions are not copied onto a source-only chain. The claim binds the source token and cap, destination token and recipient, time window, and allowed settlement layer. Omitting sourceChains and crossChainPermits grants no Permit2 claim authority. Adding only sourceAssets to prepareIntent() can constrain route selection, but it does not create onchain session authority.

Review checklist

Before opening the grant dialog, confirm:
  • every contract address belongs to the intended chain;
  • every function has only the parameter freedom the workflow needs;
  • approvals bind a spender and amount;
  • recipients are fixed where possible;
  • time windows and use counts have finite bounds;
  • each funding chain has a matching crosschain permit;
  • app-supplied names and ABI metadata are treated as display hints, not verified policy.