privy policies rules create
Add a rule to an unowned policy and verify it by reading the policy.
privy policies rules create [options] <policy-id>Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
policy-id |
— |
Options
Section titled “Options”| Option | Description |
|---|---|
--dry-run |
Validate and print the API request without network access or credentials. |
--yes |
Confirm this mutation or export. |
--body <json> |
JSON body, or - to read stdin. |
--file <path> |
JSON body file, or - to read stdin. |
--name <string> |
Policy or rule display name (1–50 characters). |
--method <string> |
Policy method, e.g. eth_sendTransaction, or * for all methods. Privy validates compatibility with the policy chain. |
--action <string> |
Action when the conditions match: ALLOW or DENY. |
--conditions <json> |
Complete condition array as JSON (replaces existing conditions). Uses the Privy policy language; nested condition semantics are validated by Privy, not fully modeled locally. |
--allow-production |
Explicitly allow this production mutation; also requires --yes. |
Global options such as --app, --account and --profile also apply. See the command reference overview.
Examples
Section titled “Examples”privy policies rules create <policy-id> --file rule.json --dry-runprivy policies rules create <policy-id> --file rule.json --yesBehavior
Section titled “Behavior”- Changes data: yes. Preview with
--dry-run, then run with--yesand any required confirmations. - Scope: app
- Before it runs: Read app environment; existing policies must have owner_id: null. Policy deletion also requires exact name and deletable: true.
- Production apps: Requires
--allow-productionin addition to--yes. - Verification: Fresh policy read and field comparison; deletion requires verified absence.
- Retries: None.
Related guides
Section titled “Related guides”Inspect the full contract locally with privy schema policies rules create.
Privy CLI is an unofficial, community project by Samarth Saxena. Not affiliated with or endorsed by Privy. The Privy name and wordmark belong to Privy. It uses undocumented dashboard APIs that can change.