Command

nylas agent policy create

Create an Agent Account policy.

Written by Qasim Muhammad Staff SRE

What does nylas agent policy create do?

The nylas agent policy create command creates a policy object for Agent Accounts. Policies group rules that can block, archive, mark, or route messages before an AI agent or automation reads them. Use --name for a simple policy or --data-file when you need to supply the full JSON payload.

Usage

nylas agent policy create --name NAME [--json]

Flags

FlagDescription
--jsonOutput as JSON
--no-colorDisable color output
--verbose(-v)Enable verbose output
--configCustom config file path
--help(-h)Show help for the command
--limitLimit results (most list commands)
--yes(-y)Skip confirmations
--namePolicy name
--dataInline JSON policy data
--data-filePath to a JSON file containing policy data

Examples

Create a policy

nylas agent policy create --name openclaw-email-policy --json

Create from JSON

nylas agent policy create --data-file policy.json --json

Example output

✓ Policy created (policy_abc123)
  Name:  Strict Policy
  Rules: 1

Attach it with: nylas workspace update <workspace-id> --policy-id policy_abc123

Troubleshooting

Policy payload rejected

Validate JSON before passing --data or --data-file. Start with --name when you only need an empty policy container.

Recommended guides

Run nylas agent policy create --help for full help output.