← All posts

Claude Security GitHub Action: how to set it up

2026-12-01 · 4 min read

The Claude Security GitHub Action runs Anthropic's Claude Security plugin on every pull request. It looks for vulnerabilities in the change, suggests fixes, and can fail the check so the code doesn't merge. Setup is one workflow file plus an Anthropic API key (or Bedrock, Google Cloud or Microsoft Foundry credentials), because a Pro or Max subscription login won't authenticate it.

What @ClaudeDevs posted

The announcement came from @ClaudeDevs on Monday afternoon: "You can now run the Claude Security plugin for Claude Code as a GitHub Action." The post says it reviews pull requests for vulnerabilities, suggests fixes you can commit and can block the merge. The same plugin also triages findings from other scanners, trims your attack surface and lets you watch scans live. It had about 7,700 likes by Tuesday.

Don't confuse it with Claude Code Review, Anthropic's general pull request reviewer; this tool looks only for security bugs. It's also separate from the managed Claude Security product, which watches connected repositories for you and, per Anthropic's docs, needs the Enterprise plan. We mentioned that one when we covered the free Anthropic OSS Scanner.

What the plugin can do

Everything the Action does, you can run by hand in Claude Code too. From the Claude Security docs:

Task How to run it
Scan the whole repo /claude-security, then "Scan codebase"
Scan your branch or one commit /claude-security scan my branch
Check another scanner's results /claude-security triage results.sarif
Find code reachable before login /claude-security:attack-surface-analysis
Write a threat model /claude-security:threat-model
Watch a scan run /claude-security-view (Claude Code 2.1.292+)

Each finding gets a CWE label, a severity from CRITICAL to LOW and a confidence rating. Suggested fixes land in a patches/ folder as files like F1.patch and are never applied automatically. The docs call it a multi-agent scan, and AlphaSignal's write-up adds that separate verifier agents confirm each finding before it reaches the report.

How to set up the Claude Security GitHub Action

  1. Try it locally first. In Claude Code, run /plugin install claude-security@claude-plugins-official, then /reload-plugins. You need Python 3.9 or later, and Pro users have to turn on Dynamic workflows in /config. New to plugins? Our Claude plugins guide covers the basics.
  2. Add a repository secret called ANTHROPIC_API_KEY. The key must be scoped to a workspace; the CI guide says unscoped keys fail with an HTTP 400. Anthropic recommends workload identity federation over a stored key if you can set it up.
  3. Add .github/workflows/claude-security.yml. Here's a trimmed version of Anthropic's sample:
on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review, edited]
permissions:
  actions: read
  contents: read
  pull-requests: write
jobs:
  claude-security:
    runs-on: ubuntu-24.04
    timeout-minutes: 240
    steps:
      - uses: actions/checkout@v5
        with:
          persist-credentials: false
      - id: claude-security
        uses: anthropics/claude-plugins-official/plugins/claude-security@<full-commit-sha>
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          fail_on: high

The full sample in the plugin's CI guide adds a second job that drafts suggested fixes, and the guide includes a separate weekly scheduled scan. Replace the placeholder with a full commit hash; the docs page lists the current one.

  1. Make claude-security a required status check on your protected branch. This is the part that blocks the merge.

fail_on sets the bar: confident-high, high (the default), medium, any or never. The Action only runs on GitHub-hosted Linux runners on GitHub.com, it skips draft pull requests by default, and pull requests from forks fail unless you flip an option Anthropic itself discourages.

What it costs

There's no separate price. Scans bill to whichever account owns the key, and the docs warn that a codebase scan "can cost a lot of tokens," more so with bigger repos, higher effort and pricier models. The default model is Fable, which the CI guide says costs several times as much as Opus, so adding model: opus is the first cost lever I'd pull.

My read

It's useful, with caveats Anthropic spells out itself. On a public repo, the report can disclose a live vulnerability to anyone reading it. A green check doesn't prove the code is safe. And the CI guide warns that a required check can turn green on a commit whose scan failed, for example after a manual re-run. I'd run it with fail_on: never for a couple of weeks, look at the bill and the false positives, then switch on blocking.

For a small business, a decent security pass on every code change no longer requires a security hire. Someone still has to decide which checks gate a release and who reads the reports. If you want help working out where checks like this belong in your own processes, start with New Face Design's free process audit.

08 / Start here

Which of this can you use today?

Tell us what you use today and we'll reply within one business day with what it would take. Free, 20 minutes, no pitch deck.

Email

pgorski@newfacedesign.com

Phone

+1 (773) 627-2176

Based in

Chicago area

Working with clients everywhere

Skip the form: grab a 20 minute slot.

Open the calendar →