SETUP

Put a Security Researcher on Your Repo

Two real ways to have an AI read your entire codebase, rate every vulnerability, and hand you the patch. One is free and runs on your next pull request. Setup takes about ten minutes.

Two real ways to have an AI read your entire codebase, rate every vulnerability, and hand you the patch. One is free and runs on your next pull request. Setup takes about ten minutes.

Most small teams never get a real security review. A proper pentest runs into the thousands and takes weeks, so the code ships and everyone hopes for the best. That gap is the one attackers look for.

It is also the one you can close this week without hiring anyone. A single leaked customer record or one exposed API key can cost you more than a year of the tooling below. The math has never been this lopsided in your favor.

Claude reads a repository the way a security researcher does. It follows how data moves across your files, finds the vulnerabilities that actually matter, ranks each one by how exploitable it is in your code, and writes the fix. There are two ways to switch it on. This guide sets up both, and tells you which one to start with.

What Is Claude Security?

It is a repo scanner that reads your source code, not a linter that matches patterns. You point it at a repository, a directory, or a single branch. It runs on Claude Opus 4.7, reads the source, traces the data across files, and hunts for real vulnerabilities instead of surface-level style warnings. Anthropic put it into public beta on April 30, 2026.

Anthropic runs these tools on its own code. The security review has already caught real vulnerabilities inside Anthropic's own products, including Claude Code itself. That is the reason to trust the signal: it is not a demo, it is what they use.

Every finding comes back built to act on, not just read:

Part of a findingWhat you get
Title and detailsThe issue and why it matters
LocationFile path and line number, linked to the source
SeverityHIGH, MEDIUM, or LOW, ranked by how exploitable it is in your codebase
ReproductionOrdered steps to actually observe the issue
Recommended fixPatch guidance you can open straight in Claude Code
StatusOpen, Dismissed, or Resolved

Two Ways In, and Which to Start With

There are two doors. Most owners should walk through the free one first.

Claude Code Security ReviewClaude Security
CostThe price of an API callIncluded in Claude Enterprise
Who can run itAny developer, todayEnterprise now; Team and Max coming
Where it runsInside your project and on every pull requestclaude.ai/security or the Claude sidebar
Best forCatching a problem before it mergesScheduled sweeps of a whole repo

Start with the free review. It runs today, it costs almost nothing, and it catches the issue while the code is still a proposal instead of a live bug. Add the standalone scanner when you are on Enterprise and want a scheduled audit of the entire codebase.

Path One: The Free Review Any Developer Can Run

No Enterprise plan. No new subscription. If you have Claude Code, you already have this.

Inside your project, run the built-in command:

Copy the command

Copy this.

/security-review

Claude reads your pending changes, finds the vulnerabilities, and reports each one with a recommended fix. That is the whole first run.

Your First Real Run

Open a branch that has recent changes on it. Type /security-review. Read what comes back, pick the highest-severity finding, and apply or adapt the fix it hands you. You just ran a security review in the time it took to read this paragraph.

Work the first finding slowly. Open the file at the line it points to. Follow the reproduction steps until you can see the problem yourself. A finding you have reproduced is a finding you can fix with confidence. A finding you accepted on faith is a guess with a nicer font. Once one finding checks out, the rest go faster.

Make It Automatic on Every Pull Request

Running it by hand works. Running it on every pull request works better, because the reviewer never forgets and never gets busy. Anthropic ships an official GitHub Action for exactly this. Drop this file into .github/workflows/security.yml:

Copy the workflow

Copy this.

name: Security Review

permissions:
  pull-requests: write
  contents: read

on:
  pull_request:

jobs:
  security:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha || github.sha }}
          fetch-depth: 2
      - uses: anthropics/claude-code-security-review@main
        with:
          comment-pr: true
          claude-api-key: ${{ secrets.CLAUDE_API_KEY }}

Then add your Anthropic API key as a repository secret named CLAUDE_API_KEY. The key has to be enabled for Claude Code. From then on, every pull request gets scanned, and Claude comments inline with the concern and the fix.

The Mistake That Makes It Fail

Turning this on for a public repository without a guardrail. An outside contributor can open a pull request that smuggles instructions into the scan. So before you enable it on any public repo, go to your repository settings and turn on Require approval for all external contributors. Set that first, then wire in the action.

The Knobs Worth Knowing

You do not need these on day one. Keep them for when the defaults start getting noisy.

Done. The free review runs on your next pull request.

Path Two: Turn On Claude Security (Enterprise)

This is the standalone scanner. You reach it from the sidebar in Claude.ai or straight at claude.ai/security. It is in public beta for Claude Enterprise now, with Team and Max plans coming. Six steps take it from off to first scan.

  1. Enable it. An organization owner opens Organization settings, then Claude Security, and toggles Turn on for your organization.
  2. Connect GitHub. Link a GitHub account inside your org. Only GitHub-hosted repos are supported for now. If your GitHub org uses SSO, authorize the Claude app separately.
  3. Clear the network path. If your org restricts GitHub App traffic by IP, add the range 160.79.104.0/21 to your allowlist.
  4. Start a scan. Open Claude Security, pick a repository, a directory, or a branch, and run it. Scan time grows with repo size.
  5. Work the findings. Read each one, confirm the reproduction steps, and apply or adapt the recommended fix. Mark each Open, Dismissed, or Resolved as you go.
  6. Wire it into your flow. Export findings as CSV or Markdown, or push them to your own tools through per-project webhooks.

Set It and Forget It

The point of the scanner is not the one-off audit. Configure a scheduled scan and Claude reviews on a regular cadence instead. It runs in the background and surfaces what is wrong before it ships. One repo and one weekly scan is enough to start.

Which Repo to Point It At First

If you have more than one codebase, do not start with the marketing site. Start where a breach would hurt most. Rank your repos by blast radius, then scan from the top down.

The order that works for most businesses:

  1. Anything that handles money. The payment service, the billing logic, the checkout flow.
  2. Anything that handles identity. Login, sessions, password resets, permission checks.
  3. Anything that handles customer data. The database layer, the export endpoints, the admin tools.
  4. Everything else.

Point the scanner at the first repo on that list, fix what it finds, and only then move down. You get the biggest reduction in real risk for the least effort, and you learn to read the findings on the code that matters before you touch the rest.

What It Actually Looks For

Real vulnerability classes, not a generic checklist.

CategoryExamples it flags
InjectionSQL, command, NoSQL, LDAP, XXE
Auth and accessBroken auth, privilege escalation, insecure direct object references
Data exposureHardcoded secrets, PII leaks, sensitive data in logs
CryptoWeak algorithms, poor key management, insecure randomness
Business logicRace conditions, time-of-check to time-of-use flaws
Supply chainVulnerable dependencies, typosquatting risk
Code executionUnsafe deserialization, eval injection, remote code execution
WebReflected, stored, and DOM-based XSS; permissive CORS

It deliberately drops the noise. Pure denial-of-service reports and unproven input-validation nags do not make the cut. And before it shows you anything, Claude runs an adversarial self-check where it challenges its own findings. That means fewer false alarms and more of your time spent on issues that are real.

Plug It Into the Stack You Already Run

If you have a security team, they do not have to leave their tools to use this. Six vendors now embed Claude Opus 4.7 in their platforms: CrowdStrike, Microsoft Security, Palo Alto Networks, SentinelOne, Wiz, and TrendAI.

The pattern they share is the useful part. An alert fires in your monitoring. Instead of stopping at "something looks wrong," the tool asks Claude to inspect the relevant code, point to the exact offending lines, and return a candidate patch. Your monitoring stops describing the problem and starts handing you the fix.

Do I Need to Be a Developer to Turn This On?

Not for most of it. The free review is a single command inside a project, so whoever writes your code can run it this afternoon. The Enterprise scanner is an organization-owner toggle plus a GitHub link, which is closer to an admin task than a coding one. The vendor integrations assume you already run a security team with a monitoring stack. If you have one developer, you have everything you need for the free path today.

The Limits You Should Know

A scanner this good still needs a human on the trigger. Four rules keep it honest.

A patch is a proposal, not a merge. Read it, test it, then ship it. The AI does not push to production for you, and it should not.

Severity is scored against your code, not a generic scale. Trust the ranking, but confirm the exploit is real before you panic over a HIGH or wave off a LOW.

Keep a human on the sensitive paths. Anything touching authentication, payments, or personal data gets a real review on top of the scan.

Start small. One repo, one scheduled weekly scan. Expand once you trust the signal, not before.

If You Only Do One Thing This Week

Turn on the free Claude Code review and let it run on your next pull request. One command, one guardrail if the repo is public, and you have a reviewer sitting on every change.

If you are on Enterprise, add the second move: schedule a weekly Claude Security scan on your most important repo.

Either way, the code stops shipping on hope. You spent ten minutes, and you now have a security researcher that never sleeps.

This guide is one system.
The map tells you which comes first.

The guides show you the systems. The map shows you which one your business needs first.

Get your free map →
Take this with you Grab the file version → Watch the original video ↗ Download as PDF ↓

Prefer to browse with company? The free community has the full skill library.