security-scan

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

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/security-scan
Clone the repo
git clone --depth 1 https://github.com/nylas/cli

Made for: Claude Code.

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. 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.00017 $0.00780
Opus 5 $0.00009 $0.00390
Sonnet 5 $0.00003 $0.00156
Haiku 4.5 $0.00002 $0.00078

Measured yesterday against content hash c2e00435dc87, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

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. yesterday 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 (68 stars, last pushed 13d ago), licensed MIT. It adds 17 tokens to every session and 780 once invoked, about $0.0001 per session on Opus 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.