Writing Effective Policies
Limits
Resource
Limit
How the compiler reads your text
Policy structure
# Good
1. If the transfer amount exceeds 1000 USDC, then the transfer is not permitted.
2. If the recipient address is not in the approved registry, then the transfer is not permitted.
3. If more than 3 transfers have occurred within the last 60 seconds, then the transfer is not permitted.
# Harder to formalize
1. Large transfers to unknown wallets are generally not permitted unless
pre-approved, and the agent should also be careful about frequency.One outcome per statement
Consistent terminology is enforcement
Common mistakes
Relative terms without definitions
Bundling multiple constraints
Process language instead of constraint language
Conflicting rules
Implicit exceptions
Bare assertions
Missing boundary conditions
Boolean variables with only one state defined
Enumerated values in a single rule
Formalizing social engineering defenses
Testing before deploying
Policy versioning
Last updated

