Nullify

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Claude Code for Security: How to Set It Up and Where It Stops

A developer asks Claude Code to add an export endpoint. Before the turn ends, a second Claude call reads the diff, flags an insecure direct object reference, and the first one fixes it. Nobody on the security team saw any of it.

That's Claude Code for security today. Anthropic now ships four review layers inside it: a plugin that checks Claude's own edits as it writes, a /security-review command for your branch, a deeper Claude Security plugin that scans a whole repository and writes patches, and a GitHub Action that reviews pull requests. Set them up in that order, then lock down the agent itself with permissions, sandboxing and hooks.

They all share one limit. They read source code. They don't prove a finding against a running system, and they don't run your security program. This guide covers the setup first, then where it stops.

What can Claude Code do for security?

Claude Code is Anthropic's coding agent. It reads your repository, runs commands, and edits files. Its security tooling uses the same agent to look for vulnerabilities in the code, at four points in the development loop.

LayerWhen it runsWhat it coversHow you start it
Security guidance pluginWhile Claude writes codePattern checks on each edit, a model review of each turn's diff, and a deeper review on each commit Claude makes/plugin install security-guidance@claude-plugins-official
/security-reviewOn demand, before you pushOne security pass over the changes on your current branchType /security-review in a session
Claude Security pluginOn demand, for deep scansMulti-agent scan of a repository, a branch diff, a PR or a commit, with verified findings and reviewed patches/plugin install claude-security@claude-plugins-official, then /claude-security
Security review GitHub ActionOn every pull requestReviews changed files and comments findings on the PRanthropics/claude-code-security-review in a workflow

Anthropic's security guidance plugin docs describe this as defense in depth and say plainly that it doesn't replace your existing static analysis and dependency scanners. There's also a managed Claude Security product on the Enterprise plan that monitors connected repositories.

How to set up Claude Code for security reviews

Work from the inside out: catch issues while the code is written, then before it's pushed, then on the pull request.

1. Install the security guidance plugin and give it your rules

The security guidance plugin runs on its own once installed. It checks Claude's work at three points:

  • On each file edit: a fast pattern match for risky calls such as eval(, pickle, dangerouslySetInnerHTML and edits under .github/workflows/. No model call, no cost.
  • At the end of each turn: a separate Claude call reviews the turn's git diff for issues a string match can't see, such as authorization bypass, SSRF and weak cryptography. If it finds something, Claude is re-prompted to fix it.
  • On each commit or push Claude makes: a deeper agentic review reads callers and sanitizers before it reports a finding.

To turn it on for the whole team, add it to the checked-in .claude/settings.json:

{
  "enabledPlugins": {
    "security-guidance@claude-plugins-official": true
  }
}

Then write down your threat model in .claude/claude-security-guidance.md. The model-backed reviews read this file as extra context:

- All routes under /admin must call require_role("admin") before any database read.
- Never log customer_id or account_number at INFO level or above.
- Compare tokens with a constant-time function, never ===.

Two details matter here. First, the commit review only fires on commits Claude makes through its own Bash tool, not on commits you run from your shell. Second, none of the layers block a write or a commit. Findings go back to Claude as instructions.

2. Run /security-review before you push

/security-review runs a single security pass over the changes on your current branch. Use it as a pre-push habit on anything that touches authentication, payments, file handling or tenant boundaries.

You can customize the prompt. The Action's README says to copy its security-review.md into your project's .claude/commands/ folder and edit it there.

3. Add the security review Action to pull requests

The Claude Code Security Reviewer is a GitHub Action from Anthropic. It reviews only the changed files in a PR, comments its findings inline, and filters out low-impact noise such as denial of service and rate-limiting findings by default.

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 }}

Read the warning in that README before you ship it. It says the Action is "not hardened against prompt injection attacks," so it should only review trusted PRs. On any repository that takes outside contributions, turn on GitHub's setting that requires approval before workflows run for external contributors.

You can tune it with exclude-directories, a custom scan instructions file, and a custom false-positive filtering file. Team and Enterprise plans also get Code Review, a multi-agent PR review that covers correctness as well as security.

4. Run a deep scan with the Claude Security plugin

For code you already have, rather than code Claude is writing, use the Claude Security plugin. Run /claude-security and pick a full scan, a branch diff, an open PR or a single commit.

On a full scan, its agents map your architecture, build a threat model, hunt for vulnerabilities, and pass each finding to independent verifier agents before it reaches the report. Results land in a CLAUDE-SECURITY-<timestamp>/ folder as Markdown, JSONL and SARIF, so you can load them into GitHub code scanning.

Ask it for patches and each one is drafted in a scratch copy of the repository, then reviewed by a separate agent that runs your tests when the code has them. Patches are never applied for you. You apply each one with git apply in its own pull request.

Two practical notes from the docs. Scans are nondeterministic, so two runs on the same code can surface different findings. And on a large repository, scan one area at a time, such as your API layer or auth code, and use high scan effort if you expect more than you got.

5. Lock down the agent itself

An agent that can read your code and run commands is also an attack surface. The Claude Code security docs list the controls:

  • Permissions: set allow and deny rules per project, and audit them with /permissions. Commands that fetch from the web, such as curl and wget, aren't auto-approved by default. Add them to permissions.deny if Claude should never run them.
  • Sandboxing: turn on /sandbox to give Bash commands filesystem and network isolation at the operating-system level. A deny rule matches the command as written. The sandbox doesn't depend on the command text.
  • MCP servers: review .mcp.json, but know that it doesn't show every server a session can load. Plugins and user-scope configs can add more. Use managed MCP configuration to control what runs across your organization.
  • Managed settings: enforce the baseline for every developer through managed settings, and monitor usage with OpenTelemetry metrics.
  • Untrusted content: don't pipe untrusted content straight into Claude, and use a VM or dev container when the work touches external services.

6. Turn hard rules into hooks, not prompts

Your guidance file is advice to a reviewer. Anthropic's docs say it doesn't block writes or guarantee every violation is caught. If a rule must never be broken, such as "never edit the auth middleware without review" or "never touch production Terraform," enforce it with a hook that blocks the edit, or with a CI check.

Where Claude Code stops for security

Everything above runs on the same input: the source code in your checkout. That's a strong place to find bugs. It leaves four gaps that most teams hit within a quarter.

It reasons about code, it doesn't prove exploits

The docs say the review "reads the source code in your checkout," not a running site or deployed service. A finding says an IDOR is likely. It doesn't show a request that returns another tenant's data. Someone still has to decide whether each finding is real, and that decision is where most AppSec hours go.

Results depend on the harness, not only the model

The same model can score very differently depending on the agent harness around it. In the CVE-Factory paper, Claude Opus 4.5 fixed 42.33% of real CVE tasks inside the Terminus-2 agent but 27.78% inside Claude Code. The authors put part of the gap down to testing. When the harness required running tests, models were less likely to stop early on a fix that didn't work.

The practical rule is to make Claude run the tests. Put the test command in your project instructions and tell it a fix isn't done until the vulnerability test and the functional tests pass.

A finding isn't a fix that merges

The plugin hands you patches to apply. Someone still has to open the PR, get it through CI, find the right reviewer, and handle the failure when CI goes red. Across a backlog of hundreds of findings, that's the work that stalls.

There's no program layer

Claude Code reviews code. It doesn't own a backlog. Nothing in it deduplicates findings across your other scanners, routes each one to the code owner, tracks SLAs, escalates the critical that's been open for three weeks, or reports MTTR to your CISO. A task isn't a system: you can script some of this yourself, but then you're maintaining a security platform.

Claude Code security checklist

  • Security guidance plugin enabled in the checked-in .claude/settings.json
  • .claude/claude-security-guidance.md lists your auth rules, data rules and tenant boundaries
  • /security-review is a pre-push habit for sensitive changes
  • Security review Action on PRs, with approval required for outside contributors' workflows
  • Claude Security plugin scans run on a schedule, one area at a time on large repos
  • SARIF results loaded into GitHub code scanning
  • Deny rules for network commands, sandboxing on, managed settings for the baseline
  • .mcp.json and plugin sources reviewed, with managed MCP configuration where needed
  • Hard rules enforced with hooks or CI, not prompts
  • Project instructions require tests to pass before a fix is called done

How Nullify works alongside Claude Code

Nullify doesn't replace Claude Code. Your developers keep writing code with it. Nullify picks up where it stops: on the findings themselves, across every repository.

For REST and GraphQL APIs, Nullify's pentest agent attacks the running service, and exploit validation proves each vulnerability before it reaches a human, with request and response pairs, screenshots and video, plus an independent re-review of each exploit. Code findings are triaged on reachability, exploitability and business context. Each fix is a minimal root-cause change, checked against your builds and tests before the PR opens. Nullify then works the PR through review, reads CI output and fixes failures, and routes it to the commit author or code owner. Across customers, 89% of fix PRs merge without a developer rewriting them. Nullify never merges anything itself.

Frequently asked questions

Is Claude Code good for security?

Yes, for finding vulnerabilities in code as it's written and reviewed. Anthropic ships a security guidance plugin, a /security-review command, a Claude Security plugin for deep scans and patches, and a PR review Action. Anthropic's own docs position these as one layer of defense in depth, alongside your existing static analysis and dependency scanners.

What's the difference between /security-review and the Claude Security plugin?

/security-review runs one security pass over the changes on your current branch. The Claude Security plugin is a deeper, multi-agent scan of a whole repository, a diff, a PR or a commit. It builds a threat model, verifies each finding with independent agents, and can write reviewed patches that you apply yourself.

Is the Claude Code security review GitHub Action safe for public repositories?

Use it with care. Its README warns that the Action isn't hardened against prompt injection, so a malicious pull request could try to steer the review. Run it only on trusted PRs, and on public repositories require maintainer approval before workflows run for outside contributors.

Can Claude Code replace a SAST tool?

Not on its own. Anthropic's documentation says to run its security tools alongside static analysis, dependency scanning and code review, not instead of them. Claude Code reasons about code like a researcher would. Deterministic scanners give you consistent rules and policy enforcement, and its scans can return different findings from run to run.

How do I stop Claude Code from running dangerous commands?

Use deny rules in your permission settings, turn on /sandbox for filesystem and network isolation of Bash commands, and enforce settings across the team with managed settings. For rules that must never be broken, add a hook that blocks the action, because prompt-based guidance can't guarantee it.