← Alle Playbooks
Playbook· setup

Security-guidance plugin for Claude Code, automatic security review while you build

How to install and enable the official security-guidance plugin and feed it your own project rules, so Claude checks its own code changes for vulnerabilities and fixes them in the same session.

When Claude Code writes code for you, it sometimes writes holes in too. A forgotten auth check, a string that travels unfiltered into a SQL query, a secret that lands in the log. Since the Opus 4.8 release there is an official antidote for that, the security-guidance plugin. It checks every change Claude makes for common vulnerabilities and instructs Claude to fix what it finds in the same session. I will show you in 15 minutes how to set it up and sharpen it with your own rules.

Step 1, understand what the plugin actually does

The security-guidance plugin is not a pentest and not an external scanner. It hooks into Claude's writing process and works on three levels. A fast pattern check on every single edit. A model review at the end of every turn. And a deeper agentic review on commit or push.

The point of it is the speed of the first level. The pattern check costs almost no time and catches the obvious things immediately. The heavier review only runs when it counts, namely before code leaves your repo. That way the plugin does not slow you down day to day, but is there when you need it.

Step 2, make sure the official marketplace is present

The plugin lives in the official Anthropic marketplace, which is called claude-plugins-official and is available automatically as soon as you start Claude Code. Normally you do not have to add it separately.

If Claude Code later reports that the plugin cannot be found in any marketplace, your marketplace is outdated or missing. Then /plugin marketplace update claude-plugins-official helps to refresh it, or /plugin marketplace add anthropics/claude-plugins-official if you never added it. After that, try the install again.

Step 3, install the plugin

One command, done.

/plugin install security-guidance@claude-plugins-official

That installs into user scope by default, so for you across all projects. If you want your whole team to get the review right away, read step 8 about scopes first, that way you decide it more deliberately.

Step 4, activate it without a restart

Freshly installed plugins are not active yet. You do not have to restart Claude Code, one command is enough.

/reload-plugins

Claude Code reloads all active plugins and shows you counts for plugins, skills, agents, hooks and MCP servers. If security-guidance shows up there, it is running. A small note on cost: reloading adds a token surcharge to the next request, because the newly loaded components announce themselves in the conversation. That is a one-off and no reason to worry.

Step 5, test it with deliberately unsafe code

Only trust a security tool once you have triggered it. In a scratch project, ask Claude to write a small function that puts user input straight into a query, or that logs a password in plain text. If the plugin is working, it reports the vulnerability and Claude fixes it in the same turn.

Really do this once actively, not just in theory. I initially assumed the plugin was already running when in fact I had forgotten /reload-plugins and it was not active at all. A deliberate test with a known hole is the only honest proof.

Step 6, give the plugin your own project rules

The default checks cover the usual suspects, but every project has its own taboos. Maybe a certain internal endpoint must never ship without a token check at your place, or you have a house rule about logging and PII. You put rules like that in the file .claude/claude-security-guidance.md in your project.

Write concretely what applies at your place, in plain language. The plugin pulls those rules into its review. That turns a generic scanner into a tool that knows your specific mistakes, and that is exactly the difference between noise and real value.

Step 7, be clear about what it checks and what it does not

The plugin looks for common vulnerability patterns in the code Claude writes during the session. It is a safety net for the moment of writing, not an audit of your entire codebase. Old code already sitting in the repo that Claude does not touch is not scanned automatically.

Keep that boundary in mind. The plugin reduces the chance of new holes getting in, it does not replace a proper security review before a release and no external pentest. See it as the fast first line of defence, not the last.

Step 8, pick the right scope so the team comes along

When installing, you decide who the plugin applies to. User scope is just for you, across all projects. Project scope installs it for everyone working on this repo and lands in .claude/settings.json. Local scope is just for you in exactly this repo.

If you want consistency in the team, project scope is the way. Then everyone who trusts the repo gets the same security review, and the rules from .claude/claude-security-guidance.md travel with it, because they live in the project. You pick the scope most cleanly through the interactive interface, so /plugin, tab to Discover, enter on the plugin.

Step 9, be careful about what else you install

One thing the security plugin does not cover is the marketplace itself. Plugins can execute arbitrary code with your permissions. Anthropic curates the official marketplace, but as soon as you add third-party marketplaces or pull community plugins, you are responsible for that trust yourself.

The rule of thumb: only install from sources you trust, and before installing, look in the Discover view at everything a plugin brings along. The detail view shows you commands, skills, agents, hooks and MCP servers before you agree. Ironically, good plugin hygiene is the single most important security step of all, and no plugin takes it off your hands.

Step 10, combine it with your other safety nets

The security-guidance plugin is one layer, not the whole defence. It pairs well with two things you already know from the Academy. Hooks that fire on every tool call, and a deliberate audit of your tool permissions.

Next I would point you at the playbook Confused deputy audit for Claude Code, which covers the permissions side the plugin does not touch. If you prefer wiring security checks yourself as a hook, look into Hooks against hallucinations, the principle is the same. And if you want to understand how plugins, skills and MCP servers interact in general, the lesson Hooks and skills is the right entry point.

Source

The commands and the three-level mechanism in this playbook come from the official Claude Code documentation, as of June 2026. The plugin is listed on the page Discover and install prebuilt plugins under "Automatic security review", details on checks and project rules are on Catch security issues as Claude writes code. The plugin release is documented in the Claude Code release notes.

Security-guidance plugin for Claude Code, automatic security review while you build — StudioMeyer Academy