Architecture
PolicyKit is designed as a layered system where each component has a clear responsibility. This page explains how the pieces fit together.System Overview

PolicyKit architecture: policy deployment and transaction evaluation flow
Component Responsibilities
SDK Layer
The SDK provides the developer-facing API:Smart Contract Layer
The on-chain contracts enforce policies at the transaction level:Off-Chain Layer
Lit Protocol handles rules that require external data or complex computation:Data Flow
Policy Deployment
- Developer builds a policy with
PolicyBuilder - Full policy JSON is pinned to IPFS via
IPFSClient - On-chain rules are encoded via
PolicyEncoder PolicyEngine.setPolicySet()is called with:- Policy CID (as
bytes32) - PKP address (for attestation verification)
- Encoded on-chain rules
- Fail mode and attestation requirements
- Policy CID (as
Transaction Evaluation
- A transaction is submitted to the smart account
PolicyGuardorPolicyKit7579Moduleintercepts it- On-chain rules (Tier 1 and 2) are evaluated by the
PolicyEngine - If off-chain rules exist, a Lit Action is triggered
- The Lit Action fetches the policy from IPFS using the CID
- Off-chain rules (Tier 3) are evaluated
- If all rules pass, the Lit network threshold-signs an EIP-712 attestation
- The attestation is verified on-chain by
AttestationVerifier - Transaction proceeds only if all checks pass
Security Model
Trust Assumptions
- On-chain rules: Fully trustless — evaluated by the EVM
- Off-chain rules: Trust the Lit Protocol network’s decentralized TEE infrastructure
- IPFS storage: Content-addressed — CID ensures policy integrity
- Attestations: EIP-712 typed signatures verified on-chain
Attack Surface
PolicyKit minimizes the attack surface by:- Keeping critical rules on-chain where possible
- Using threshold cryptography (no single point of failure for attestations)
- Content-addressing policies on IPFS (tamper-evident)
- Supporting “closed” fail mode for high-security deployments

