# Claude Security GitHub Action: Scan Pull Requests Before Merge

> Source: <https://explainx.ai/blog/claude-security-github-action-pull-request-scan-december-2026?utm_source=rss&utm_medium=feed&utm_campaign=blog>
> Published: 2026-12-01 00:00:00+00:00

**Key takeaway:** Install the claude-security plugin's GitHub Actions workflow with `fail_on` set to `high` (the default) or `confident-high`, then make the job a required status check in branch protection to block merges on CRITICAL or HIGH findings.

**Anthropic's Claude Security plugin now ships a GitHub Actions workflow that scans pull request changes, posts a security review, and can block merges when findings exceed your threshold.** Official instructions live in [Scan your codebase for vulnerabilities](https://code.claude.com/docs/en/claude-security?ref=explainx) on Claude Code Docs and in [plugins/claude-security/CI.md](https://github.com/anthropics/claude-plugins-official/blob/main/plugins/claude-security/CI.md?ref=explainx) inside [anthropics/claude-plugins-official](https://github.com/anthropics/claude-plugins-official?ref=explainx).

This is **not** the standalone Claude Mythos enterprise monitoring product. It is the **open plugin** developers install with `/plugin install claude-security@claude-plugins-official` and can mirror in CI.

## TL;DR

| Question | Answer | 
|---|---|
| **Trigger** | `pull_request` types opened, synchronize, reopened, ready_for_review, edited | 
| **Runner** | `ubuntu-24.04` GitHub-hosted Linux | 
| **Credential** | `ANTHROPIC_API_KEY` repository secret | 
| **Action source** | `anthropics/claude-plugins-official/plugins/claude-security` | 
| **Fork PRs** | Fail by default | 
| **Merge block** | Set `fail_on` and make the job a required check | 
| **Billing** | API usage on the secret owner | 

Risk gauge illustrates severity gates for Claude Security pull request scans

*Image: Library illustration · security severity framing*

## What Anthropic added for CI

Claude Security already ran **multi-agent hunts** inside a **Claude Code session**. The **November 30 documentation refresh** (surfaced widely December 1, 2026) adds a **first-class GitHub Actions path** with:

- 
**Pull request review mode** — scans**only the PR diff** , posts review comments, optional**suggested patches** in a follow-up job when`suggest_patches: later` .
- 
**Scheduled full-repo scan** — optional second mode for**baseline hunts** ; PR mode is what most product teams adopt first.

Anthropic's docs emphasize **trust boundaries**: text on the PR branch can **steer** the scan, and the scan may **execute** code from the branch. **Anyone who can push** can also edit the workflow and spend the **API key**.

## Official workflow skeleton

Save `.github/workflows/claude-security.yml` per CI.md. Critical defaults:

```
name: Claude Security plugin

on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review, edited]

permissions:
  actions: read
  contents: read
  pull-requests: write

jobs:
  claude-security:
  # Anthropic recipe skips merge_group and some dependabot cases — keep upstream conditions.
    runs-on: ubuntu-24.04
    timeout-minutes: 240
    steps:
      - uses: actions/checkout@v5
        with:
          ref: ${{ github.event.pull_request.head.sha }}
          fetch-depth: 0
          persist-credentials: false

      - id: claude-security
        uses: anthropics/claude-plugins-official/plugins/claude-security
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          suggest_patches: later
```

**Concurrency** groups in the official file cancel overlapping runs on the same PR except when the base branch changes — copy the full block from CI.md when you ship.

## fail_on and merge gates

CI.md documents **`fail_on`** severity gates:

| Value | Behavior | 
|---|---|
| **high** (default) | Fails on any CRITICAL or HIGH | 
| **confident-high** | CRITICAL or HIGH with high confidence only | 
| **medium** | Includes MEDIUM | 
| **any** | Any finding fails | 
| **never** | Findings never fail the job | 

To **block merges**, turn the job into a **required status check** in GitHub branch protection after you trust the false-positive rate.

Teams already running **[parallel Claude Code QA agents](https://explainx.ai/blog/mobile-agent-testers-claude-code-github-actions-parallel-qa-november-2026)** can stack this job **after** unit tests but **before** human security review.

## Limits and warnings you must read

Anthropic lists hard limits in CI.md and the security doc page:

- 
**No merge queue support** — uncomment merge_group skip; queued merges count as pass when skipped.
- 
**No push-event scans** in the PR workflow — use scheduled scan mode for default-branch baselines.
- 
**Prompt injection** — the older[claude-code-security-review](https://github.com/anthropics/claude-code-security-review?ref=explainx) README states the action is**not hardened** against injection; only scan**trusted PRs** .
- 
**Public repo disclosure** — job summaries may leak**actionable vulns** ; run locally for zero-disclosure needs.
- 
**Draft PRs** — pass with**no scan** until marked ready; Dependabot PRs may also skip per sample workflow comments.

These constraints align with **[Anthropic siren honeypot lessons](https://explainx.ai/blog/anthropic-siren-honeypot-agent-sandbox-escape-november-2026)**: agents follow **plausible malicious context** unless your **harness** contains them.

Jailbreak lock pick motif highlights untrusted pull request prompt-injection risk

*Image: Library illustration · exploit review metaphor*

## How this fits other Claude security layers

Anthropic documents **three layers**:

1. 
**Security guidance plugin** — nudges while Claude writes code.
2. 
**Code Review** — human-oriented PR commentary inside Claude Code.
3. 
**Claude Security** — multi-agent vuln hunt with**independent verification** before reporting.

This GitHub Action is **layer three in CI**, not a replacement for **[MCP server hardening](https://explainx.ai/blog/what-is-mcp-model-context-protocol-guide)** or **[AgentBeam-style agent monitoring](https://agentbeam.com/blog/ai-agent-security-monitoring-coding-agents?ref=explainx)** when agents touch production.

Compare with **[OpenAI Codex security open sourcing](https://explainx.ai/blog/openai-codex-security-cli-sdk-open-source-july-2026)** for a different vendor pattern: OpenAI shipped CLI tooling; Anthropic ships a **marketplace plugin** with **Actions glue**.

## Setup checklist for platform teams

1. 
**Create a dedicated API key** with spend caps for CI — not a developer laptop key.
2. 
**Pin the marketplace commit** CI.md references when you need reproducibility (`d0d514288960e7a78e1a76e4a3ec694416458726` appears in docs for v0.13.0 migrations).
3. 
**Require approval for outside contributors** on public repos so fork PRs never hit the scanner with untrusted payloads.
4. 
**Start with `fail_on: never`** for two weeks; collect precision metrics, then tighten.
5. 
**Log findings** to your SIEM; GitHub comments alone do not satisfy**[SOC-style retention](https://explainx.ai/blog/nist-nsa-cisa-ten-practices-si-control-incident-rogue-agents-evidence-no-retention-clock-2026)** requirements.
6. 
Pair with **[stacked PR workflows](https://explainx.ai/blog/github-stacked-pull-requests-public-preview-july-2026)** carefully — each stack layer triggers another scan; use concurrency rules.

## Cost and performance expectations

Docs quote **minutes to tens of minutes** per PR depending on diff size, and **hours** for full-repo scheduled scans. `timeout-minutes: 240` in the sample workflow is intentional.

API spend scales with:

- 
**Diff size** (more files, more agent rounds).
- 
**`change_scan_effort: high`** optional input for deeper search.
- 
**Patch suggestion second job** when enabled.

Finance leads should treat this like **another CI bot**, not a **seat on Claude Max**.

## Threat model for AI-on-AI reviews

Attackers may embed **prompt injection** in:

- 
Source comments newly added in the PR.
- 
Test fixtures interpreted as instructions.
- 
Malicious **build scripts** executed if the scan runs them.

Mitigations from Anthropic plus standard AppSec hygiene:

- 
**Restrict who can trigger workflows** on forks.
- 
**Run in isolated runners** without production secrets.
- 
**Never** mount cloud credentials into Claude Security jobs on external contributor PRs.

Our **[Railway engineer agent probe story](https://explainx.ai/blog/railway-engineer-ai-agents-primcloud-port-scan-secrets-request-claimed-vs-verified-2026)** shows how quickly **agent tools** jump from **lint** to **recon** when prompts go off-script.

## Enterprise vs consumer paths

Anthropic notes that **managed Claude Security on Mythos** targets **Enterprise** buyers who want **vendor-operated monitoring**, while the **plugin plus GitHub Action** targets **teams that already run Claude Code** and own their **API billing**.

If your organization standardizes on **Microsoft Copilot Studio** for low-code automation but lets engineering use **Claude Code**, place this Action **only on application repos**, not on workflow repos business users edit without security review.

Legal should also read **[Anthropic commercial terms](https://www.anthropic.com/legal/commercial-terms?ref=explainx)** for **data retention** on API calls triggered by CI. Session scans and Actions scans may fall under **different subprocessors** than **Chat consumer** accounts.

## Scheduled scans vs pull request scans

CI.md contrasts modes:

| Mode | Scope | Output | 
|---|---|---|
| **Pull request review** | Diff only | PR review comments plus optional patches | 
| **Scheduled scan** | Whole repository | Job summary report | 

Most teams start with **PR mode** to catch **regressions** before merge, then add **weekly scheduled** jobs on **main** to find **legacy debt**. Scheduled jobs take **longer** and cost more tokens because agents **map architecture** from scratch.

When you adopt both, **deduplicate findings** in your tracker so developers do not ignore **duplicate comments** across modes.

## Second job for suggested patches

When `suggest_patches: later`, the workflow can spawn a **follow-up job** that consumes the **report artifact** from the first job and posts **patch proposals**. Anthropic separates jobs so you can **fail fast** on discovery without waiting for **patch generation**.

Platform tip: store the **report JSON** as an artifact even if you disable patch suggestions, so security engineers can **replay** findings after incidents.

## When not to use the Action

Skip or delay CI deployment when:

- 
You cannot **trust every pusher** (open source with drive-by PRs).
- 
**Disclosure** of a finding in a public Actions log is**unacceptable** .
- 
You are on **GitHub Enterprise Server** — unsupported.
- 
You need **merge queue** scanning — not supported yet.

Local `/security-review` inside Claude Code remains the **private** path docs recommend for **embargoed** fixes.

## Permissions block in the sample workflow

Anthropic keeps **permissions** narrow on purpose:

- 
`pull-requests: write` lets the job**post review comments** .
- 
`contents: read` avoids granting**write** unless a patch job needs it.
- 
`actions: read` supports**artifact** retrieval between jobs.

Do **not** widen to `contents: write` on the discovery job; patch application should stay **human-approved** or in a **separate hardened job** with **CODEOWNERS** gates.

## Pairing with Claude Code locally

Teams often run **three passes** on risky features:

1. 
**Security guidance plugin** while authoring.
2. 
**Local `/security-review`** before pushing.
3. 
**GitHub Action** on the PR.

Document that sequence in your **contributing.md** so junior developers know **which step blocks merge**. Link your internal runbook to Anthropic's [support article on automated security reviews](https://support.claude.com/en/articles/11932705-automated-security-reviews-in-claude-code?ref=explainx).

## Version migration note

Docs mention pinning **`anthropics/claude-plugins-official`** at commit **` d0d514288960e7a78e1a76e4a3ec694416458726`** when moving to plugin **0.13.0**. Platform teams should **bump intentionally**: each marketplace update can change **default graders** inside the plugin.

After upgrades, replay a **known vulnerable test branch** to confirm **fail_on** still triggers.

## Draft pull requests and ready_for_review

Anthropic includes **`ready_for_review`** in the trigger list so **draft PRs** do not burn tokens until authors mark them ready. Product teams using **draft-first** culture should document that **security scans start only after ready**, avoiding noisy comments on WIP branches.

If you use **GitHub's converted-to-draft** flow during incident response, expect **another scan** when the PR returns to ready — budget API spend accordingly.

Security champions should paste the official **warning block** from CI.md into internal docs so contractors know **fork PRs fail by design**, not because the pipeline is broken.

## Related reading on explainx.ai

*Workflow fields, version pins, and trust warnings reflect Anthropic documentation checked December 1, 2026.*
