cli: Command for Claude Code

.claude/commands/security-scan.md

security-scan is a command for Claude Code from nylas/cli. It costs 17 tokens per session (780 once invoked), scanned A, original, MIT.

A command that checks a codebase for exposed secrets, unsafe files, known problems in dependencies, and other security issues.

In plain words
What is it for?
Use it to scan all or part of a repository, look for API keys and passwords, inspect sensitive files, and review Go module dependencies for known vulnerabilities.
Why use it?
It helps find credentials accidentally stored in code or Git history and highlights common security risks before they cause harm.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

This is nylas/cli's own configuration. It tells Claude Code how to work on cli itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cli configures →

Reuse

Borrowing it

Nothing to install: this file belongs to nylas/cli. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/nylas/cli/main/.claude/commands/security-scan.md
Clone the repo
git clone --depth 1 https://github.com/nylas/cli

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for security-scan

README.md
[![agentmods](https://agentmods.dev/badge/commands/nylas/cli/security-scan/github.svg)](https://agentmods.dev/commands/nylas/cli/security-scan)
Your own site
<a href="https://agentmods.dev/commands/nylas/cli/security-scan"><img src="https://agentmods.dev/badge/commands/nylas/cli/security-scan/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for security-scan

Your own site · 80×15
<a href="https://agentmods.dev/commands/nylas/cli/security-scan"><img src="https://agentmods.dev/badge/commands/nylas/cli/security-scan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 780 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00017 $0.00780
Opus 5.5 $0.00007 $0.00312
Sonnet 5.5 $0.00003 $0.00156
Haiku 4.5 $0.00002 $0.00078

Measured 1mo ago against content hash c2e00435dc87, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

security-scan 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 1mo 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.

.claude/commands/security-scan.md · 110 lines

How it starts

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

Security Scan

Perform a comprehensive security analysis of the codebase.

Target: $ARGUMENTS (leave empty for full scan)


Threat Model

This CLI:

  • Stores API credentials (should use system keyring)
  • Makes HTTP requests to Nylas API
  • Reads/writes local files
  • Executes based on user input

Instructions

1. Secret Detection

# Check for hardcoded API keys
grep -rE "nyk_v0[a-zA-Z0-9_]{20,}" --include="*.go" . | grep -v "_test.go"

# Check for credential patterns
grep -rE "(api_key|password|secret|token)\s*[=:]\s*\"[^\"]+\"" --include="*.go" . | grep -v "_test.go" | grep -v "mock.go"

# Check for potential credential logging
grep -rE "fmt\.(Print|Fprint|Sprint|Log).*([Aa]pi[Kk]ey|[Pp]assword|[Ss]ecret|[Tt]oken)" --include="*.go" .

2. Sensitive File Check

# Check for sensitive files in repo
find . -name "*.env*" -o -name "*.pem" -o -name "*.key" -o -name "*credential*" -o -name "*secret*" 2>/dev/null | grep -v ".git"

# Check git history for sensitive files
git log --all --name-only --pretty=format: | grep -E "\.(env|pem|key|p12)$" | sort -u

3. Dependency Vulnerabilities

# Check for known vulnerabilities in Go modules
go list -m all
# Review any outdated or suspicious dependencies

4. Code Security Review

Check for these vulnerabilities:

Category What to Look For
Command Injection User input in exec.Command(), os/exec
Path Traversal User input in file paths without sanitization
Insecure HTTP http:// instead of https:// for APIs
Weak Crypto MD5, SHA1 for security purposes
Error Exposure Stack traces or internal errors exposed to users

5. Authentication & Authorization

  • API keys stored securely (keyring, not plaintext)
  • No credentials in command-line arguments (visible in ps)
  • Tokens not logged or printed
  • Secure credential input (no echo)

6. Run Automated Scans

# Run project security scan
make security

# Run Go security linter (if available)
golangci-lint run --enable gosec

Read the full file on GitHub · 110 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. 1mo ago First seen · 110 lines · 17 tokens per session scan A c2e00435dc87

Subscribe to this mod's changes

security-scan is a command published in the GitHub repository nylas/cli (76 stars, last pushed 12d ago), licensed MIT. It adds 17 tokens to every session and 780 once invoked, about $0.0001 per session on Opus 5.5. 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.