When to Use Sudo
Target contract is audited and trusted (Uniswap, Aave, Morpho)
No user funds at direct risk (game actions, governance votes)
You need simplicity over granular control
Combined with time limits or usage limits
When NOT to Use Sudo
Basic Usage
Agent Examples
Yield Optimizer Agent
Trust deposits/withdrawals on vetted protocols:Gaming Agent
Full access to game contract with usage limits:Governance Agent
Vote on proposals automatically:Security Checklist
Timeframe Policy configured
Only specific functions allowed (not entire contract)
Target contract is audited
Usage limit considered for high-risk actions
Gas spend capped (
maxPaymentAmount)Common Mistakes
When to Upgrade to Universal Action
Switch to Universal Action when you need:- Spending limits (per-action or total)
- Recipient whitelisting
- Parameter validation
- Cumulative caps