Claude Code plugin to catch security vulnerabilities during coding
Anthropic released the security-guidance plugin for Claude Code to review code changes for common vulnerabilities and fix them in the same session.
Anthropic has introduced the security-guidance plugin for Claude Code, designed to catch common vulnerabilities as the AI writes code and resolve them within the same session. This tool acts as an initial screening layer to reduce the volume of security-related issues that reach human reviewers during pull requests. Internal testing at Anthropic showed a 30–40% decrease in security-related comments in PRs created with the plugin.
Three levels of vulnerability scanning
The plugin uses hooks to monitor code changes at different depths. On every file edit, it performs a fast pattern match for risky calls, such as eval(), os.system, or dangerouslySetInnerHTML. This stage uses deterministic string matching and does not incur model usage costs.
At the end of each turn, the plugin computes a git diff of all changes made by Claude, including Bash commands and subagents. A separate Claude instance reviews this diff in the background for complex issues like authorization bypass, server-side request forgery, and weak cryptography.
When Claude executes a git commit or git push via the Bash tool, the plugin performs a deeper agentic review. This process analyzes surrounding code, including sanitizers and callers, to verify if a potential vulnerability is real in the specific codebase context.
Customizing security policies
Organizations can define their own rules in a claude-security-guidance.md file. This Markdown file allows teams to describe their threat model and checklists in plain language, which the model-backed reviews use as additional context.
For the per-edit layer, users can create a .claude/security-patterns.yaml file to add regex or substring rules. These rules can include specific reminders for the AI, such as warnings about hardcoded API key prefixes or requirements to filter multi-tenant queries by org_id.
These files can be placed in the project repository or distributed via MDM to the user scope at ~/.claude/. The plugin concatenates these rules with built-in checks, though built-in checks cannot be individually removed.
Installation and environment requirements
The plugin is available for all Claude Code users via the official marketplace. To install it in a terminal session, use the following command:
/plugin install security-guidance@claude-plugins-officialThe system requires Python 3.7 or later, though Python 3.10 or later is necessary for agentic commit reviews and third-party providers like Amazon Bedrock. It also requires a git repository to perform end-of-turn and commit reviews.
Once installed, the plugin runs automatically without requiring separate commands. Users can manage their Claude Code sessions more effectively by configuring the plugin in .claude/settings.json to enable it for entire teams.
The end-of-turn and commit reviews use additional model usage, defaulting to the Claude Opus model. Users can change this by setting the SECURITY_REVIEW_MODEL and SG_AGENTIC_MODEL environment variables. This tool is intended as one layer of defense and should be paired with system checkups and CI scanning for full security enforcement.
Sources
Catch security issues as Claude writes code - Claude Code Docs
Related news
Claude CodeClaude Code /code-review Adds Depth Levels and New Review StrategiesClaude Code redesigns /code-review with depth levels from low to ultra, balancing token cost, speed, recall, and fewer false positives for PRs.·shared tag: Code Review
Open SourceIntroducing deepsec: Vercel open-sources security harness for codebasesVercel releases deepsec, an open-source security framework that uses coding agents to find vulnerabilities in large repositories, running locally with your existing AI subscriptions.·mentions Security
Claude CodeAuto mode becomes default for Claude Code Pro, Max, and TeamAnthropic is making auto mode the default for Claude Code users on Pro, Max, and Team plans to improve safety and enable longer autonomous agent tasks.·shared tag: Claude Code
AI AgentsAnthropic Shares Six Habits for Maximizing Claude Code SessionsAnthropic's new guide explains how prompt caching, model selection, and context hygiene change the real cost of every coding task — and why the same six habits apply to Codex and other agents.·shared tag: Anthropic
- AnthropicAnthropic releases official claude-code-setup plugin for Claude Code automationThe new plugin analyzes projects and recommends automation configurations including hooks, skills, MCP servers, and subagents with step-by-step setup guidance.·shared tag: Anthropic
Claude CodeAnthropic Adds /checkup Command to Claude Code for Auto CleanupNew /checkup command in Claude Code automatically removes unused skills, splits CLAUDE.md files, enables Auto-mode, and pre-approves safe commands to reduce context bloat.·shared tag: Claude Code
Comments
Weekly digest
The best of vibe coding, AI agents and open source — once a week, no spam.