encryption

A command-line method for encrypting outgoing email with GPG or PGP, standards that protect message contents so only the intended recipient can read them. It uses the recipient’s public key and can work with keys in a local keyring or public key servers.

In plain words
What is it for?
Use it to encrypt email before sending, look up a recipient’s public key, and combine encryption with a digital signature when both privacy and sender verification are needed.
Why use it?
It prevents other people from reading an email while it travels from the sender to the recipient. It separates encryption, which hides content, from signing, which helps verify who sent it.

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/encryption
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 2,846 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.02846
Opus 5 $0.00000 $0.01423
Sonnet 5 $0.00000 $0.00569
Haiku 4.5 $0.00000 $0.00285

Measured yesterday against content hash 40378aeac8d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

encryption scanned grade B with 1 finding 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 yesterday.

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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo apt install gnupg
docs/commands/encryption.md · 504 lines

How it starts

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

GPG Email Encryption

Encrypt outgoing emails with GPG/PGP so only the intended recipient can read them.


Overview

The Nylas CLI supports encrypting emails with GPG (GNU Privacy Guard) using the OpenPGP standard (RFC 3156). Encrypted emails provide:

  • Confidentiality: Only the recipient can decrypt and read the message
  • End-to-end security: Content is encrypted before leaving your device

Encryption vs Signing:

Feature Signing Encryption
Purpose Verify sender identity Hide content from others
Key used Your private key Recipient's public key
Who can read Anyone Only recipient
Verifiable Yes (authenticity) No (confidentiality)

Best Practice: Use both signing AND encryption for maximum security.


Prerequisites

1. Install GPG

Linux (Debian/Ubuntu):

sudo apt install gnupg

macOS:

brew install gnupg

Windows: Download from: https://gnupg.org/download/

2. Have Recipient's Public Key

To encrypt for someone, you need their public key. The CLI can:

  • Use keys already in your keyring
  • Auto-fetch keys from public key servers

Supported key servers:

  • keys.openpgp.org (primary)
  • keyserver.ubuntu.com
  • pgp.mit.edu
  • keys.gnupg.net

Sending Encrypted Email

Basic Encryption

Encrypt an email to a recipient (auto-fetches their public key if needed):

nylas email send \
  --to [email protected] \
  --subject "Confidential Information" \
  --body "This message is encrypted and only you can read it." \
  --encrypt

What happens:

  1. CLI looks up recipient's public key in your local keyring
  2. If not found, searches key servers automatically
  3. Encrypts the message with their public key
  4. Sends as PGP/MIME encrypted email

Encrypt with Specific Key

If you have multiple keys for a recipient or want to specify exactly which key:

nylas email send \
  --to [email protected] \
  --subject "Secret Project" \
  --body "Here are the project details..." \
  --encrypt \
  --recipient-key ABCD1234EFGH5678

Read the full file on GitHub · 504 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. yesterday First seen · 504 lines · 0 tokens per session scan B 40378aeac8d0

Subscribe to this mod's changes

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