explainx.ai350K+ learn from us
TrendingAI News TodayExplainx for Business
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

follow on google

Add explainx.ai as a preferred source

corporate training

support@explainx.ai

get started

Find your pathTake Free Evaluation

community

Join the community

learn

mind: share how you thinkpathways — start freeworkshopsbootcampscoursescompare Explainxcertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcpestacktoolsmdx readeragentsllmsdesignsdictionarypeopleagi trackerfelony benchranks

company

aboutvisionmissionteaminstructorsteach on explainxpartnershipscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource libraryfor LLMsexplainx.ai kids

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportcontactprivacytermsdata rightshow we create contentsubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

explainx.ai

On this page

  • TL;DR
  • What Anthropic added for CI
  • Official workflow skeleton
  • fail_on and merge gates
  • Limits and warnings you must read
  • How this fits other Claude security layers
  • Setup checklist for platform teams
  • Cost and performance expectations
  • Threat model for AI-on-AI reviews
  • Enterprise vs consumer paths
  • Scheduled scans vs pull request scans
  • Second job for suggested patches
  • When not to use the Action
  • Permissions block in the sample workflow
  • Pairing with Claude Code locally
  • Version migration note
  • Draft pull requests and ready_for_review
  • Related reading on explainx.ai
← Back to blog

explainx / blog

Claude Security GitHub Action: Scan Pull Requests Before Merge

Claude Code, Anthropic, GitHub Actions, AI Security, DevSecOps

Part of Claude Code

Anthropic's Claude Security plugin runs in GitHub Actions to scan pull request diffs, post reviews, suggest patches, and block merges. Setup, limits, and trust rules from official docs.

Dec 1, 2026·8 min read·Yash Thakker
add explainx.ai
go deep
Claude Security GitHub Action: Scan Pull Requests Before Merge

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 on Claude Code Docs and in plugins/claude-security/CI.md inside anthropics/claude-plugins-official.

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.

Daily briefFrom Yash · 350K+ students taught

Catch up on AI

One AI story explained in plain English, plus one thing to try. Every day, free. Unsubscribe anytime.

TL;DR

table · 2 cols
QuestionAnswer
Triggerpull_request types opened, synchronize, reopened, ready_for_review, edited
Runnerubuntu-24.04 GitHub-hosted Linux
CredentialANTHROPIC_API_KEY repository secret
Action sourceanthropics/claude-plugins-official/plugins/claude-security
Fork PRsFail by default
Merge blockSet fail_on and make the job a required check
BillingAPI usage on the secret owner

Risk gauge illustrates severity gates for Claude Security pull request scansRisk 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:

yaml
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:

table · 2 cols
ValueBehavior
high (default)Fails on any CRITICAL or HIGH
confident-highCRITICAL or HIGH with high confidence only
mediumIncludes MEDIUM
anyAny finding fails
neverFindings 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 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 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: agents follow plausible malicious context unless your harness contains them.

Jailbreak lock pick motif highlights untrusted pull request prompt-injection riskJailbreak 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 or AgentBeam-style agent monitoring when agents touch production.

Compare with OpenAI Codex security open sourcing 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 requirements.

  6. Pair with stacked PR workflows 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 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 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:

table · 3 cols
ModeScopeOutput
Pull request reviewDiff onlyPR review comments plus optional patches
Scheduled scanWhole repositoryJob 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.

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

  • Claude Mythos 5 security scans and Defender fund
  • Mobile agent testers with GitHub Actions
  • Anthropic MCP download milestones
  • Anthropic siren honeypot sandbox escape
  • Cognition acquires Corridor for agent-written code guardrails
  • Claude Code commands reference

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

Spotted something out of date? Let us know.
Daily briefFrom Yash · 350K+ students taught

Catch up on AI

One AI story explained in plain English, plus one thing to try. Every day, free. Unsubscribe anytime.

  • ✓ Free
  • ✓ One email a day, no spam
  • ✓ Unsubscribe anytime
Yash Thakker

Written by

Yash Thakker

Yash is an AI expert with over 300K learners. Join his workshops →

View Yash Thakker in People in AI →

Related posts

Nov 10, 2026

Claude Code's Hidden ip_reminder: What the Reports Show, What Is Unconfirmed, and Why the Concealment Matters

Users report that Claude Code sessions receive an ip_reminder block the model is told not to mention. Two GitHub issues, a leaked claude.ai prompt page and a screenshot of a model's own reasoning are the evidence so far. Here is what is confirmed, what is not, and what builders should do about hidden instructions.

Nov 30, 2026

HD Moore Says an AI Provider Rerouted Claude Requests to DeepSeek: Claimed vs Verified

On November 29, 2026 security researcher HD Moore posted that fingerprinting tokenizers and quiz cards showed a popular AI provider re-routed requests for Anthropic models to DeepSeek on two occasions. The public report redacts the provider name. Here is what is claimed, what is verified, the earlier canary study it builds on, and how to test your own routes.

Nov 29, 2026

Why Claude Has a Five-Hour Session Limit (And a Weekly Cap)

A November 29, 2026 Hacker News thread asked why Claude keeps a short session limit on top of weekly usage caps. Anthropic's November help-center text describes a rolling five-hour window on Pro and Max, shared across Claude and Claude Code, plus optional wrap-up time when a reply is already in flight.