lockstep
3 min readNaman Jain

Claude Code security: scanning, security review, and safe setup

Claude Code security: finding vulnerabilities with the Claude Security plugin, /security-review, and security guidance, and running Claude Code safely.

"Claude Code security" means two things to different people. A security engineer wants to know how to use Claude Code to find vulnerabilities. A CISO wants to know whether running an agent on developer laptops is safe. Both have good answers in Anthropic's docs; they're just on different pages.

This guide covers both, from Anthropic's Claude Security plugin docs, security guidance plugin docs, and security overview, checked on 16 November 2026.

Part 1: finding vulnerabilities

Claude Code has four layers, each at a different point:

ToolWhen it runsWhat it does
Security guidance pluginWhile Claude writes codeClaude reviews its own changes for issues such as injection, unsafe deserialization, and unsafe DOM APIs, and fixes them in the same session
/security-reviewOn demandA single pass over your branch
Claude Security pluginOn demandA deep multi-agent scan of a repository or a set of changes, with verified findings and suggested patches
Code ReviewOn pull requestsMulti-agent review of each PR on GitHub, for Team and Enterprise

Security guidance plugin

Install with /plugin install security-guidance@claude-plugins-official. It runs automatically, with nothing to invoke. Anthropic positions it as the in-session companion to Code Review: it reduces what reaches the pull request. To turn it on for teammates' local sessions, declare it in the project's .claude/settings.json.

Claude Security plugin

Install with /plugin install claude-security@claude-plugins-official, then run /claude-security. It offers three jobs: scan the codebase, scan a set of changes, and suggest patches.

  • Full scans map your architecture, build a threat model, hunt for vulnerabilities, and verify findings.
  • Change scans check a branch's diff, a pull request, or a single commit before merging.
  • Scan effort can be low, medium, or high, as in /claude-security scan my branch at high. Findings get the same independent verification at every level.

It runs locally in your session on your session's model, makes no model calls of its own, and counts toward your usage. It needs Python 3.9 or later and uses dynamic workflows, which Pro users turn on in /config.

Code Review

For pull requests, see AI code review best practices.

Part 2: running Claude Code safely

From Anthropic's security page:

  • Permissions: auto mode uses a classifier to block actions it judges unsafe; Manual mode asks before edits and commands. See plan mode vs auto mode vs accept edits.
  • Sandboxed Bash: filesystem and network isolation via /sandbox. See Claude Code sandbox.
  • Working directory boundary: in Manual mode, file tools ask before reading or writing outside the starting folder.
  • Prompt injection safeguards: network-fetching commands like curl aren't auto-approved by default.
  • Your responsibility: review proposed code and commands before approving them.

Best practices from Anthropic

For sensitive code:

  • Review all suggested changes before approval
  • Use project-specific permission settings for sensitive repositories
  • Run Claude Code inside a sandbox runtime or dev container for more isolation
  • Audit permission settings regularly with /permissions

For teams:

  • Enforce standards with managed settings
  • Share approved permission configurations through version control
  • Monitor usage with OpenTelemetry
  • Audit or block settings changes with ConfigChange hooks

Report vulnerabilities in Claude Code itself privately, through Anthropic's HackerOne program.

Security decisions are team decisions

"All migrations run concurrently," "no secrets in CI logs," "webhooks verify signatures": security rules are often decided in an incident review or a Slack thread. A scanner finds known vulnerability patterns; it doesn't know your team's specific rules unless they're written where the agent reads them.

Where Lockstep fits

Lockstep captures decisions like these from PRDs, Slack, and pull requests, routes each to its owner for approval, and briefs Claude Code sessions on the ones that apply before code is written. Its checks are advisory: they flag likely conflicts for a person to review.

See how it works.

Sources checked 16 November 2026

For enterprise controls, see Claude Code for enterprise. For MCP risks, see MCP security.

Frequently asked questions

What is Claude Security in Claude Code?
A plugin that runs a multi-agent vulnerability scan of your codebase inside a Claude Code session. It can scan a whole repository or only a set of changes, verifies findings, and turns the ones you choose into patches you review and apply yourself.
How do I install the Claude Security plugin?
In a terminal session, run /plugin install claude-security@claude-plugins-official. It needs a paid plan, Anthropic API access, or a supported third-party provider, Python 3.9 or later, and git for change scans and patches. Then run /claude-security.
What is the difference between /security-review and the Claude Security plugin?
Per Anthropic's docs, /security-review runs a single pass over your branch, while the Claude Security plugin runs a deeper multi-agent scan with independent verification and patch suggestions. The security guidance plugin reviews code as Claude writes it, and Code Review checks pull requests.
Is Claude Code safe to use?
Anthropic's docs describe a permission-based design, auto mode's classifier, a sandboxed Bash tool, a working-directory boundary, and prompt injection safeguards. You're still responsible for reviewing proposed code and commands before approving them.
How do teams secure Claude Code?
Anthropic's team recommendations: enforce standards with managed settings, share approved permission configurations in version control, train the team, monitor usage with OpenTelemetry, and audit or block settings changes with ConfigChange hooks.

Keep reading