Skip to main content
Wallet policies are rules stored in the wallet’s on-chain state that the smart contract evaluates before executing any transaction. A valid passkey signature is necessary to authorize a transaction, but it is not sufficient — every active policy must also pass. Policies give you fine-grained control over what an authorized user can do, adding a programmable safety layer that protects users from accidental overspending, interaction with unapproved contracts, or other undesirable wallet behavior.

Why Policies Exist

A traditional wallet has no concept of policy: a valid signature equals execution. SocketFi smart wallets separate the authorization question (who is signing?) from the policy question (should this be allowed?):
This means even a fully authenticated user can be protected by wallet-level rules they or your application configured. Policies are enforced by the on-chain contract, so they cannot be bypassed at the application layer.

Policy Categories

SocketFi wallets support five categories of policy:

Spending Limits

Restrict the total value that can leave the wallet over a rolling time window. Spending limits can be applied globally or per-asset.

Contract Restrictions

Maintain an allowlist of Soroban contract addresses the wallet may interact with. Any invocation targeting a contract not on the list is rejected before execution.

Authorization Rules

Introduce additional authorization requirements for specific operation types. For example, you might require extra verification for transfers above a high-value threshold, or restrict which wallet operations are available to a specific session type.

Recovery Controls

Govern when and how account recovery may proceed. Examples include mandatory waiting periods between a recovery request and execution, approval thresholds, or restrictions on who may initiate recovery.

Fee Controls

Limit the maximum fee a transaction may consume, restrict which assets may be used to pay fees, or cap deferred fee balances. Transactions that would exceed fee policy are rejected before submission.

Policy Evaluation Order

Policies are evaluated after authorization passes but before any execution occurs. The evaluation order is:
Every policy must pass. If any single policy fails, execution stops immediately and the wallet state is not changed.

Multiple Policies

Wallets can have multiple active policies of the same or different categories. All must pass for a transaction to execute:
Any single policy failure stops execution immediately. The remaining policies in the evaluation chain are not checked. Design your policy set with this in mind — a policy that fires frequently for legitimate transactions will block those transactions entirely.

Wallet Policy Profiles

Different applications call for different policy configurations. Here are three common profiles to use as starting points:
Focused on protecting everyday users from accidental large transfers and phishing.
This profile lets users do everything they need for normal app usage while capping potential loss from a compromised session.
Locked to the game’s own contract ecosystem to prevent assets from being moved outside the game environment.
Players can trade within the game freely, but no external contract can drain the wallet.
Designed for high-value transactions with additional controls on large transfers and fee exposure.
Routine transactions proceed normally. High-value transfers trigger additional authorization steps.

Updating Policies

Policy updates are themselves protected wallet operations. They require a valid authorization from the wallet’s bound credential — just like any other state-changing operation.
Because policy updates require wallet authorization, a compromised session cannot silently remove safety policies. The passkey holder must explicitly approve any policy change.

Policy Failure Reasons