Skip to main content

CLI Commands

init

Initialize a new policy file from a template.
policykit init [options]

Options

FlagDescriptionDefault
--template <name>Template to usebasic
--output <path>Output file path./policy.json
--name <name>Policy name/IDPrompted

Templates

TemplateDescription
basicMinimal policy with target allowlist and value limit
smart-accountERC-7579 smart account with comprehensive rules
agent-walletAI agent wallet with strict guardrails
dao-guardDAO treasury execution guard

Example

policykit init --template smart-account --output ./my-policy.json

deploy

Deploy a policy to IPFS and register it on-chain.
policykit deploy [options]

Options

FlagDescriptionDefault
--policy <path>Path to policy JSON fileRequired
--chain <chain>Target chainbase-sepolia
--engine <address>PolicyEngine contract addressFrom env
--pkp <address>PKP address for attestationsAuto-provisioned

Example

policykit deploy \
  --policy ./my-policy.json \
  --chain base-sepolia \
  --engine 0x1234...5678

Output

Pinning policy to IPFS...
  CID: QmXyz123...

Encoding on-chain rules...
  Tier 1 rules: 3
  Tier 2 rules: 2
  Encoded size: 256 bytes

Deploying to PolicyEngine...
  Tx hash: 0xabc...def
  Block: 12345678

Policy deployed successfully.

simulate

Simulate a transaction against a policy locally.
policykit simulate [options]

Options

FlagDescriptionDefault
--policy <path>Path to policy JSON fileRequired
--target <address>Transaction target addressRequired
--value <ether>ETH value (in ether)0
--data <hex>Transaction calldata0x
--verboseShow detailed per-rule resultsfalse

Example

policykit simulate \
  --policy ./my-policy.json \
  --target 0xUniswapRouter \
  --value 0.5 \
  --data 0x38ed1739... \
  --verbose

Output

Evaluating policy: my-first-policy

Tier 1 (Stateless On-Chain):
  ✅ ALLOW_TARGETS — 0xUniswapRouter is allowed
  ✅ MAX_VALUE — 0.5 ETH ≤ 10 ETH

Tier 2 (Stateful On-Chain):
  ✅ SPEND_LIMIT — 0 / 50,000 USDC used
  ✅ COOLDOWN — No previous transaction

Tier 3 (Off-Chain):
  ⚠️  MAX_SLIPPAGE_BPS — Skipped (simulation mode)
  ⚠️  REQUIRE_SIMULATION — Skipped (simulation mode)

Result: ✅ ALLOWED (Tier 3 rules skipped in simulation)

inspect

Inspect the active policy for an account.
policykit inspect [options]

Options

FlagDescriptionDefault
--account <address>Smart account addressRequired
--chain <chain>Target chainbase-sepolia
--engine <address>PolicyEngine contract addressFrom env
--fullFetch and display the full policy from IPFSfalse

Example

policykit inspect \
  --account 0xMySmartAccount \
  --chain base-sepolia \
  --full

Output

Policy for 0xMySmartAccount:

  CID:          QmXyz123...
  PKP Address:  0xPKP...
  Fail Mode:    closed
  Attestation:  required

On-Chain Rules:
  ALLOW_TARGETS: [0xUniswapRouter, 0xAavePool]
  MAX_VALUE: 10 ETH
  SPEND_LIMIT: 50,000 USDC / 24h
  COOLDOWN: 300s

Off-Chain Rules:
  MAX_SLIPPAGE_BPS: 50 (0.5%)
  REQUIRE_SIMULATION: true

remove

Remove the active policy from an account.
policykit remove [options]

Options

FlagDescriptionDefault
--chain <chain>Target chainbase-sepolia
--engine <address>PolicyEngine contract addressFrom env
--confirmSkip confirmation promptfalse

Example

policykit remove --chain base-sepolia --confirm
Removing a policy immediately stops enforcement. Transactions will no longer be checked against any rules.