summaryrefslogtreecommitdiff
path: root/plugins/security-guidance/README.md
diff options
context:
space:
mode:
authorMohamed Hegazy <mhegazy@anthropic.com>2026-10-20 17:19:54 +0000
committerClaude <noreply@anthropic.com>2026-10-20 17:19:54 +0000
commit0f6be178f21e3966272328322e6291b2f47c4727 (patch)
tree355d693a59ba39f5fdde016e3541edf2b011b5f9 /plugins/security-guidance/README.md
parent6d375ed2062b0c34e8a18885439cd992ad2d834a (diff)
parente68e375d22866ba36c1eb0b4cc46db96c65f6a4e (diff)
Merge main into mhegazy/sg-stop-diff-memorymhegazy/sg-stop-diff-memory
Conflict in get_git_diff: main added IGNORE_SUBMODULES to the diff command on the line where this branch resets its read counters. Both are kept.
Diffstat (limited to 'plugins/security-guidance/README.md')
-rw-r--r--plugins/security-guidance/README.md14
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/security-guidance/README.md b/plugins/security-guidance/README.md
index b8a67ed4..f4806fca 100644
--- a/plugins/security-guidance/README.md
+++ b/plugins/security-guidance/README.md
@@ -20,7 +20,7 @@ Marketplace ships enabled by default in Claude Code — no setup beyond having t
- Claude Code CLI ≥ v2.1.144
- Python 3.8+ on `PATH` (`python3`, `python`, or `py -3` — the plugin picks the first that works)
-- A working API path (subscription, API key, or 3P provider config)
+- Credentials for the LLM reviews: your Claude Code sign-in, an API key, or 3P provider config (see [Credentials](#credentials))
## Configuration
@@ -48,6 +48,16 @@ SECURITY_REVIEW_MODEL=claude-opus-5-5
`SECURITY_REVIEW_MODEL` controls the LLM diff review. `SG_AGENTIC_MODEL` (same syntax) controls the agentic commit reviewer.
+### Credentials
+
+The pattern warnings need no credentials. The LLM reviews (the diff review on Stop and the commit/push reviewer) use the first of these that applies:
+
+- **A cloud provider (Bedrock, Vertex, Foundry)** — if Claude Code is configured for one, reviews run through your installed Claude Code with that provider config.
+- **`ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` in the environment** — used as is, against `ANTHROPIC_BASE_URL` if you set one.
+- **Signed in to Claude Code (`/login`)** — Claude Code passes your sign-in to the plugin's hooks, and reviews use that account.
+
+Claude Code does not pass your sign-in to plugins in a session started with `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, `DISABLE_TELEMETRY`, or `DO_NOT_TRACK` set. If no credentials reach the plugin, for that or any other reason, the LLM reviews are skipped and only the pattern warnings run. The plugin tells you so when Claude edits a file in a git repo, at most once a week. Set `ENABLE_CODE_SECURITY_REVIEW=0` if that is what you want; it also hides the notice.
+
### Enabling/disabling layers
| Variable | Default | What it does |
@@ -131,7 +141,7 @@ This is a best-effort assistive tool, not a guarantee. Treat findings as suggest
**Plugin doesn't seem to fire** — check that `~/.claude/claude-security-guidance.md` (or hook activity) shows in debug logs. Run Claude Code with `--debug-file /tmp/claude/debug.txt` and grep for `security_reminder_hook`. The plugin also writes its own log to `~/.claude/security/log.txt`.
-**Review never finds anything** — verify your API path works. When a commit or push review gets no usable answer from the model, Claude is told once per session for each kind of review and failure (for example "Commit security review did not complete: …"), and the reason is logged. If a commit whose review failed is pushed later from Claude Code, the push review checks it. On 3P providers, if you set `SECURITY_REVIEW_MODEL`, check it is a provider-specific id your account can invoke. On LLM gateways, check the gateway's logs for `POST /v1/messages` traffic from the plugin.
+**Review never finds anything** — verify your API path works, and that credentials reach the plugin (see [Credentials](#credentials)): `~/.claude/security/log.txt` says `no API credentials` when they don't. When a commit or push review gets no usable answer from the model, Claude is told once per session for each kind of review and failure (for example "Commit security review did not complete: …"), and the reason is logged. If a commit whose review failed is pushed later from Claude Code, the push review checks it. On 3P providers, if you set `SECURITY_REVIEW_MODEL`, check it is a provider-specific id your account can invoke. On LLM gateways, check the gateway's logs for `POST /v1/messages` traffic from the plugin.
**Too many false positives** — set `SECURITY_REVIEW_MODEL` to a cheaper model (`claude-sonnet-5-5`) and re-evaluate; if precision is the priority, stay on the default.