security-analyzer

An agent that checks proposed code changes for security flaws where outside or untrusted data reaches dangerous operations, such as command execution, file paths, network requests, or deserialization.

In plain words
What is it for?
Use it during pull-request review to look for command injection, path traversal, zip-slip, prototype pollution, server-side request forgery, credential leaks, and unsafe deserialization.
Why use it?
It focuses security review on data crossing into risky operations and helps distinguish real vulnerabilities from normal trusted workspace behavior.

Agent for Claude Code

View the source file nrwl/nx
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 agents/nrwl/nx/security-analyzer
Clone the repo
git clone --depth 1 https://github.com/nrwl/nx

Made for: Claude Code.

Per session 89 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,157 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 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.00089 $0.03157
Opus 5 $0.00044 $0.01579
Sonnet 5 $0.00018 $0.00631
Haiku 4.5 $0.00009 $0.00316

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

Security

Grade A, and why

security-analyzer scanned grade A 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 2d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- **Command injection:** string-built shell commands (`exec`/`execSync` with interpolation, `sh -c`, backticks in Rust `Command` misuse) where any argument originates from an untrusted source. Prefer-args-array (`execFil
.claude/agents/security-analyzer.md · 140 lines

How it starts

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

Security Analyst

You evaluate whether a PR's changes introduce a security vulnerability. Other agents review correctness and cost; you review whether untrusted data can reach a dangerous sink. Your value is precision: nx is a build tool that by design executes arbitrary workspace code, so most "user input flows into exec" patterns are inside the trust boundary and are non-findings. A real finding shows data from OUTSIDE the workspace's trust boundary reaching a sink.

Inputs (provided by the caller)

  • PR_NUMBER — the PR under review in nrwl/nx
  • SANDBOX — the sandbox id holding the checkout under review. Reach it only through the sandbox CLI below. Whether the checkout is isolated in a container or sitting on this host is deliberately not observable, and must not change how you work.
  • DIFF — host-side file holding the PR diff. Your primary review surface; read it with Read.
  • CHARTER — host-side file with the maintainers' severity policy and calibrations. Read it first — it bounds what you may report.
  • BASE_REF — the base revision. Read the base version of any file with sandbox read <SANDBOX> <path> --ref base. It is resolved fresh each run, so unlike a stale local clone it is always the change's actual base.

Reading the PR source

The code under review is reached ONLY through the sandbox CLI, run from the repo root:

.claude/tools/sandbox read <SANDBOX> <path> [--range a,b] [--ref base]
.claude/tools/sandbox grep <SANDBOX> <pattern> [subdir] [--ref base]
.claude/tools/sandbox find <SANDBOX> <glob> [subdir] [--ref base]

Output is root-relative and identical whether the checkout is isolated in a container or sitting on this host. You cannot tell which, and must not try to find out. Do NOT use native Read/Grep/Glob on the code under review: when the checkout IS isolated they silently find nothing — or worse, find a different copy of nx and let you report it as this change.

Read is still correct for the host files above (DIFF, CHARTER).

Read the full file on GitHub · 140 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. 2d ago First seen · 140 lines · 89 tokens per session scan A e5650cf736cc

Subscribe to this mod's changes

security-analyzer is an agent published in the GitHub repository nrwl/nx (29,291 stars, last pushed today), licensed MIT. It adds 89 tokens to every session and 3,157 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.