PolicyKit
PolicyKit is a decentralized policies-as-code SDK that enables composable, enforceable policies for smart account transactions. It supports both on-chain and off-chain evaluation, giving developers a powerful framework to define and enforce transaction rules.Why PolicyKit?
Smart accounts and AI agents need guardrails. Whether you’re building a DeFi application, a DAO treasury, or an AI-powered wallet, you need a way to enforce rules on transactions before they execute. PolicyKit provides:Policies as Code
Define policies programmatically using a fluent TypeScript API. Version control, test, and deploy policies like any other code.
Three-Tier Evaluation
On-chain stateless rules, on-chain stateful rules, and off-chain rules via Lit Protocol for maximum flexibility.
Non-Custodial
Account owners maintain full control. Policies are enforced without requiring custody of private keys.
ERC-7579 Compatible
Integrates seamlessly with the smart account module standard for broad wallet compatibility.
How It Works
- Define policies using the
PolicyBuilderfluent API - Store policies on IPFS for decentralized, tamper-proof storage
- Deploy on-chain rules to the
PolicyEnginesmart contract - Evaluate transactions against your policy — on-chain and off-chain
- Enforce rules automatically before transactions execute
Quick Example
Packages
| Package | Description |
|---|---|
@policykit/sdk | Core TypeScript SDK with PolicyBuilder, clients, and utilities |
@policykit/cli | Command-line tool for policy management |
@policykit/contracts | Solidity smart contracts for on-chain enforcement |
@policykit/lit-actions | Lit Protocol actions for off-chain evaluation |