Skip to content
AI Primer
release

Claude Security adds GitHub Actions that can block vulnerable pull requests

Claude Security now scans pull requests, suggests fixes and can block merges through a GitHub Action. The Action does not support subscription tokens, and scans can consume many tokens.

5 min read
Claude Security adds GitHub Actions that can block vulnerable pull requests
Claude Security adds GitHub Actions that can block vulnerable pull requests

TL;DR

  • Claude Security now reviews pull requests through GitHub Actions, suggests fixes and can block merges, according to ClaudeDevs. Blocking requires a required status check.
  • Existing scanner results get a second pass: ClaudeDevs says SARIF triage returns validated findings in fix order, while attack-surface analysis proposes ways to reduce exposed code.
  • The Action does not support subscription sign-in, and ClaudeDevs warns that scans can consume substantial tokens. CI usage goes against the account supplying the model credential.

Suggested fixes can arrive about 9 to 13 minutes after the first review on a small PR because the sample workflow puts patch generation in a second job. Local reports also carry a revision stamp recording the scanned commit, effort level and verification status.

Pull-request reviews

The plugin supports two CI workflows:

  • Pull-request review: scans the proposed changes, posts findings and suggests fixes. Documented runtime is minutes to tens of minutes, depending on PR size.
  • Scheduled scan: examines the whole repository, including code predating the Action, and writes a report to the job summary. Runtime ranges from minutes to hours, depending on repository size and model.

Each PR scan posts a comment review, never an approval or a request for changes. The sample workflow grants contents: read and pull-requests: write permissions.

Merge thresholds

A finding blocks merging only when the scan job is a required status check. Anthropic's merge-gating documentation defines five fail_on settings:

  • confident-high: CRITICAL or HIGH findings with high confidence.
  • high: any CRITICAL or HIGH finding, the default.
  • medium: any CRITICAL, HIGH or MEDIUM finding.
  • any: any finding.
  • never: findings alone do not fail the job.

never does not suppress operational failures: an incomplete report or a scan running outside auto mode can still fail the job. Agents assign severity and confidence, and both can change between runs.

Passing checks also have coverage exceptions:

  • Draft PRs pass without scanning unless scan_drafts is enabled.
  • Merge-queue scans are unsupported; the sample skips those jobs, and skipped jobs count as passing.
  • A sparse checkout or a scan that skipped a top-level folder can still pass.

The sharpest caveat: Anthropic documents cases where a required check can turn green on a commit whose scan failed, including reruns or another PR sharing the same head commit.

SARIF triage

Vulnerability Triage accepts a SARIF 2.1.0 file from another scanner or the output directory from an earlier Claude scan. The documented command is:

It writes FINDINGS-TRIAGE.md plus FINDINGS-TRIAGE.sarif, which contains the original list with verdicts added. Rejected findings appear under Not validated; Anthropic warns that terse descriptions make real findings more likely to be rejected.

Validated findings can enter the patch-generation flow. Committing, pulling or switching branches between triage and patching requires a new triage.

Attack-surface analysis

The separate attack-surface analysis command examines reachable code and proposes changes to reduce exposure:

Its targets are:

  • Code reached by the default configuration but unused by any default feature.
  • Sensitive code reachable before login or without user action.
  • Combinations of options that silently disable a security feature.

The output contains a report and, when patches are produced, notes in attack-surface-patches/PATCHES.md. Anthropic describes the resulting findings and patches as untested pending developer checks.

Live scan view

The terminal view opens by default during a scan and requires Claude Code v2.1.292 or later.

  • Ctrl+X X shrinks the pane to a band; repeating it hides the band.
  • /claude-security-view reopens the view while the scan runs.
  • /plugin configure claude-security contains the Live scan view setting.
  • /workflows exposes the scan's stages separately.

Credentials and token costs

The beta plugin supports paid plans, Anthropic API access and cloud providers. A scan inside Claude Code uses the session's access; GitHub Actions requires its own supported authentication.

Anthropic's CI setup specifies several deployment constraints:

  • Authentication: Anthropic API keys, workload identity federation, or supported credentials for Amazon Bedrock, Google Cloud's Agent Platform and Microsoft Foundry.
  • API-key scope: the key must be workspace-scoped. An unscoped key fails the job with HTTP 400.
  • Runners: GitHub-hosted Linux on GitHub.com. GitHub Enterprise Server and GHE.com data-residency deployments are unsupported.

Token use grows with repository size, scan effort and model choice. Whole-repository CI scans can run past their timeout and leave no report, even on a small repository.

Trusted pushes and public findings

Anthropic's security policy explicitly trusts the scanned code and everyone who can push. PR text can steer the scan, and the scan can execute the PR's code.

A contributor with push access can also edit the workflow, use its model credential and pass the check. The policy describes agent command-blocking hooks as protection against slips, with no security-boundary guarantee.

Fork PRs fail the job by default. The dangerously_scan_external_branches: true option permits scanning them despite the risk that an external author could steer execution and spend the model credential.

Public repositories add a disclosure hazard: a PR review or job summary can publish a live vulnerability before a fix exists.

Share on X