agent-policy

Application-level settings for Nylas agent accounts, defining rules, limits, options, and spam detection. They are attached to workspaces to control how agent accounts behave.

In plain words
What is it for?
List, create, read, update, and delete Nylas agent policies from the command line, including their exact JSON data for automation.
Why use it?
They provide one place to inspect and change the settings applied to a workspace. This avoids editing policy data manually through the API.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/nylas/cli/agent-policy
Clone the repo
git clone --depth 1 https://github.com/nylas/cli
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,064 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01064
Opus 5 $0.00000 $0.00532
Sonnet 5 $0.00000 $0.00213
Haiku 4.5 $0.00000 $0.00106

Measured 3d ago against content hash cbe56ba42445, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agent-policy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/agent-policy.md · 168 lines

How it starts

The opening of the file, as written. The whole thing — 168 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Policies

Detailed reference for nylas agent policy.

Policies are application-level resources backed by /v3/policies. They attach to workspaces via policy_id.

Commands

nylas agent policy list
nylas agent policy create --name "Strict Policy"
nylas agent policy create --data-file policy.json
nylas agent policy get <policy-id>
nylas agent policy read <policy-id>
nylas agent policy update <policy-id> --name "Updated Policy"
nylas agent policy update <policy-id> --data-file update.json
nylas agent policy delete <policy-id> --yes

Listing Policies

nylas agent policy list
nylas agent policy list --json

Lists all policies from /v3/policies. Text output shows which workspace has each policy attached.

Reading Policies

nylas agent policy get <policy-id>
nylas agent policy read <policy-id>
nylas agent policy read <policy-id> --json

Notes:

  • get and read are aliases
  • text output expands the policy into readable sections for:
    • rules
    • limits
    • options
    • spam detection
  • --json returns the raw API payload

Use --json when you need the exact field names for automation or a follow-up update.

Creating Policies

Simple Create

nylas agent policy create --name "Strict Policy"
nylas agent policy create --name "Strict Policy" --json

This is the fastest path when you only need a named policy object and will add rules or settings later.

Full JSON Create

nylas agent policy create --data-file policy.json
nylas agent policy create --data '{"name":"Strict Policy","rules":["rule-123"]}'

Every limit is optional: omitted limits default to your billing plan's maximum, and values above the plan maximum are rejected by the API.

Example payload:

{
  "name": "Strict Policy",
  "rules": ["rule-123"],
  "limits": {
    "limit_attachment_size_limit": 50480000,
    "limit_attachment_count_limit": 10,
    "limit_count_daily_message_per_grant": 500,
    "limit_inbox_retention_period": 30,
    "limit_spam_retention_period": 7
  },
  "spam_detection": {
    "use_list_dnsbl": false,
    "use_header_anomaly_detection": false,
    "spam_sensitivity": 1
  }
}

Read the full file on GitHub · 168 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 168 lines · 0 tokens per session scan A cbe56ba42445

Subscribe to this mod's changes

agent-policy is a command published in the GitHub repository nylas/cli (68 stars, last pushed 15d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,064 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.