Skip to main content
Policies define the rules that govern what your agent can and cannot do. They’re enforced on-chain by smart contracts—not by trust.

Available Policies

How Policies Work

When your agent tries to execute an action:
Agent calls usePermission() with instruction

MEE submits to blockchain

Smart contract checks:
  ✓ Is this contract/function allowed?
  ✓ Do parameters pass all policy rules?
  ✓ Is the session still valid (time)?
  ✓ Is usage limit not exceeded?

All checks pass → Execute
Any check fails → Revert

Combining Policies

Real agents typically combine multiple policies for defense in depth:
actions: [{
  chainId: base.id,
  actionTarget: UNISWAP_ROUTER,
  actionTargetSelector: swapSelector,
  
  // Time bounds
  validAfter: now,
  validUntil: now + 7 * DAY,
  
  // Usage limit
  usageLimit: 100n,
  
  // Parameter rules
  actionPolicies: [
    getUniversalActionPolicy({
      valueLimitPerUse: 0n,
      paramRules: { /* spending limits */ }
    })
  ]
}]

Policy Selection Guide

Your Agent NeedsUse This Policy
Full access to trusted protocolSudo
Spending limits per actionUniversal Action
Total spending capsUniversal Action (with isLimited: true)
Recipient whitelistingUniversal Action
Time-limited accessTime Range
Max number of actionsUsage Limit
Scheduled execution windowsTime Range

Quick Decision Tree

Is the target contract fully trusted?
├─ Yes: Consider Sudo + Time Range
└─ No: Use Universal Action

Does the agent handle user funds?
├─ Yes: Universal Action with spending limits
└─ No: Sudo may be acceptable

Need to limit total actions?
├─ Yes: Add Usage Limit
└─ No: Time Range may suffice

Security Layers

Always think in layers:
LayerControlExample
ContractWhich contracts can be calledOnly Uniswap, Morpho
FunctionWhich functions are allowedOnly swap(), not approve()
ParameterRules on argumentsMax $500 per trade
TimeWhen agent can actNext 7 days only
UsageHow many timesMax 50 trades
GasMax gas spend$20 USDC for gas

Next Steps