The Claude Security GitHub Action Can Block Your Merge. Start It Where You Trust Everyone Who Can Push
The Claude Security GitHub Action can block a merge, but anyone who can push can steer its scan, edit its workflow and pass its check. Start it on a private repository with its own capped API key.
On November 30, Anthropic announced that its Claude Security plugin for Claude Code now runs as a GitHub Action. The Action reviews pull requests for vulnerabilities, suggests fixes, and "can block the merge."
The first instruction in the Action's own setup guide comes before a single line of setup. Use it "only where you trust everyone who can push."
The Claude Security GitHub Action is a workflow job that scans each pull request's changes with Claude agents, posts a review with suggested fixes, and fails the check when findings cross a severity you choose. Running it takes an Anthropic API key or a cloud provider, not a Claude plan sign-in.
Its verdict is only as trustworthy as whoever can push to the repository.
If you ship through pull requests and plan to make this Action a required check, ask who gets to shape what the check says.
The answer decides where to switch it on first. Start with a private repository where you trust every pusher. Give it its own API key under a monthly spending cap.
What does the merge block actually check?
The Action blocks nothing by itself.
Anthropic's guide says "a failed job blocks the merge only if it is a required status check," so the block exists only once you add the job to your branch rules. The sample names that job claude-security.
Until then a failing scan is a red mark. Anyone can merge past it.
A single input, fail_on, decides whether the job fails. It picks the findings that count. The sample workflow lists five values.
Table: What each fail_on value fails on
fail_on | The job fails on |
|---|---|
confident-high | A CRITICAL or HIGH finding of high confidence |
high (default) | Any CRITICAL or HIGH finding |
medium | Any CRITICAL, HIGH or MEDIUM finding |
any | Any finding |
never | No finding |
Values as listed in the comments of the sample workflow in Anthropic's CI guide, read 2026-12-04.
The severity and confidence behind those values are judgments. Each run makes them fresh.
"AI agents set each severity and confidence, and both can change between runs," the guide says.
The guide also warns that confident-high "passes a real CRITICAL or HIGH finding of medium or low confidence." Anthropic's plugin documentation adds that "two scans of the same code can surface different findings."
So the gate is a policy you set on top of a model's changing judgment.
A policy like that is workable. You only need to know what a green check does and does not tell you.
A green check means this run did not fail
Several things turn the check green with no scan of your code.
Under GitHub's status check rules, a skipped job reports "Success" and "will not prevent a pull request from merging, even if it is a required check." The sample workflow skips draft pull requests until they are marked ready. The plugin page says a pull request from Dependabot "passes with no scan too, so review its changes yourself."
The guide is blunter about the rest. "A required check can turn green on a commit whose scan failed, for example by a manual run, a re-run, or another pull request with the same head." A scan that skipped a top-level folder can still pass. Flaws the agents judge older than the pull request do not fail the job by themselves.
The guide sums it up in one line: "A clean review is not proof of absence."
A green check still means something. One run, under one configuration, did not fail.
Who controls the run
"Text in a pull request can steer the scan, and the scan can run the pull request's code. Anyone who can push can also edit the workflow, use its model credential and pass the check," the guide's opening warning says.
The scan reads the pull request. An agent cannot reliably tell a code comment or a PR description apart from an instruction. Someone who can push to a branch in your repository can also change .github/workflows/claude-security.yml on that branch. The run uses the branch's version.
The plugin's security policy states the assumption under all of it. The policy says "The code you scan is trusted," and the Action "trusts everyone who can push in the same way."
The scan reads the pull request's text, code and workflow file, all of which anyone with push access can change.A merge gate is meant to protect your main branch from bad changes, and this one protects it from bad changes made by people you already trust. Such protection is still worth having, because the people you trust can still ship a vulnerability by accident.
The gate cannot protect you from someone who controls what it reads.
AI reviewers in GitHub Actions have been steered before
Two independent research teams have shown AI agents in GitHub Actions doing what text in a pull request or issue told them to.
Aonan Guan published the first as Comment and Control, with Zhengyu Liu and Gavin Zhong of Johns Hopkins. Anthropic's earlier claude-code-security-review Action pasted a pull request title straight into its prompt. The title told Claude to run commands. Claude then posted the repository's ANTHROPIC_API_KEY and GITHUB_TOKEN back as a "security finding" comment.
Anthropic rated it Critical, at CVSS 9.4. On 2026-04-20 it changed the severity to None, Guan reports. The action "is not designed to be hardened against prompt injection," Anthropic replied, as Guan quotes it, but added a rule blocking the ps command.
The same pattern worked against Google's Gemini CLI Action and GitHub's Copilot agent.
A second team, RyotaK of GMO Flatt Security, showed that a different Anthropic workflow, claude-code-action, trusted any actor whose name ended in [bot]. A malicious GitHub App could open an issue, steer Claude into reading the runner's environment, and walk away with credentials for a write token. Anthropic fixed it in claude-code-action v1.0.94. RyotaK notes that variants of the misconfiguration "were actively exploited in the wild" before he published.
Neither incident involved the new Action.
Both show the mechanism its guide warns about: an AI reviewer reads text written by the person whose change it is reviewing.
Is the Claude Security GitHub Action safe on a public repository?
The new Action's defaults answer those attacks. That is the strongest case for running it anywhere.
Per the guide, "the scan runs in a sandbox: no network, no sudo, not the job's token. It can spend the model credential but does not hold it."
Pull requests from forks fail the job by default. The guide gives the reason. A fork's author "needs no push rights, yet could steer the scan to run the branch's code and spend your model credential."
Those defaults close the theft path the earlier research used.
They leave several things open.
Table: What the sandbox and fork default stop, and what they leave
| Stopped by the defaults | Still possible |
|---|---|
| The scan reading the GitHub token | PR text steering the verdict |
| The scan holding the API key | Spending the API key |
| Network calls out of the scan | Data leaving "by a model request or the review" |
| Fork PRs running the scan | A pusher editing the workflow or passing the check |
Drawn from the "What to expect", "Before you start" and "External branches" sections of Anthropic's CI guide, read 2026-12-04.
A public repository adds a problem the sandbox cannot touch.
The guide warns that "a review or job summary can disclose a live vulnerability," and suggests scanning locally if that matters to you. It also says that masking a credential found in your code is "a model's best effort."
On a public repository those comments are readable by anyone.
Public repositories also get most outside contributions as forks. Forks fail the job. To scan them you would set dangerously_scan_external_branches: true, which the guide marks "We do not encourage."
The guide prefers a different path. A trusted person reads the change and reopens it from a branch of your own repository.
So the sandbox narrows what an attacker can take, and the trust boundary stays where it was.
How much does a Claude Security scan cost?
Searches of builder forums, GitHub and X found no posted bill as of December 4, four days after launch. Anthropic does say how cost moves.
The cost "grows with the size of the repository, the scan effort, and the model," the plugin page says. A run in GitHub Actions bills the account that owns the job's model credential.
Two settings push the cost higher. Per the guide, fast_mode runs at "about twice the price per token," and a high change_scan_effort "costs more."
For the scheduled whole-repository sample, the guide switches to Opus. "Fable, the default model, costs several times as much as Opus here," it explains.
The guide also warns that such a scan "can take hours and cost much more than a review, even on a small repository."
For pull request scans the guide recommends Fable, says Sonnet 5.5 or Opus 5.5 "also performs well on smaller pull-request scans," and suggests a final Fable scan before merging.
Its first-run advice is plain. "Check the first run's time and cost."
So a spending cap is the only reliable upper bound.
Anthropic's guide recommends creating the key "in a standalone workspace for this job alone, with a monthly spend limit, rather than in the Default Workspace."
When a workspace reaches its limit, the Claude API returns an HTTP 400. "You have reached your specified workspace API usage limits," the error says. The scan stops before the bill grows.
That protects the budget, at a price. A failed scan fails the job. Once the cap is reached, every scan fails. The job is a required check, so no pull request can merge until the limit resets or you raise it.
Set it up on a private repository first
The steps below follow Anthropic's CI guide. They assume a private repository on GitHub.com where you trust everyone with push access. Scanning in a merge queue or on push events is not supported, so a repository that merges through a merge queue needs another control there.
For background on branches and pull requests, Build to Launch's GitHub for non-programmers covers the basics.
- Create a workspace and a capped key. In the Claude Console, make a workspace for this job alone and set a monthly spend limit on it. Create an API key scoped to that workspace, since unscoped keys "fail this job (HTTP 400)." If you can, use workload identity federation instead. There, GitHub's own sign-in token for the workflow stands in for a stored key, and the guide recommends it "because it keeps no secret in the repository."
- Save the key as a repository secret named
ANTHROPIC_API_KEYunder Settings → Secrets and variables → Actions. - Add the workflow file. Copy the sample from the guide into
.github/workflows/claude-security.yml. - Open a test pull request that adds the file. The guide suggests adding an obvious flaw to code your product runs, such as a shell command built from a request parameter, to watch the check fail; remove it before merging.
- Read the first run's cost in the workspace's usage before turning anything on, and run it on a few ordinary pull requests to see the range.
- Make
claude-securitya required status check in your branch rules, and choosefail_onon purpose. The defaulthighis a reasonable start;mediumblocks more merges. - Keep scheduled scans in a second workflow with a different job name, so a manual or scheduled run can never satisfy the pull request check.
- Leave fork settings off. In Settings → Actions, keep "Send write tokens to workflows from pull requests" and "Send secrets to workflows from pull requests" disabled, as the guide asks.
From the guide's sample, look at these lines: the trigger, the narrow permissions, the GitHub-hosted runner, and the key.
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
steps:
- uses: anthropics/claude-plugins-official/plugins/claude-security@d0d514288960e7a78e1a76e4a3ec694416458726
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
suggest_patches: later
The full sample also checks out the pull request's head commit with persist-credentials: false. The sample adds a receipt step and a second job for suggested fixes. It also skips Dependabot runs.
Copy it whole. Do not rebuild it from this excerpt.
The pinned commit above is the one the plugin page listed for version 0.13.0 on December 4. The guide says to pin a full commit "never a branch: the action runs with sudo," so check that page for a newer one.
Two layers are at work. The action itself changes the runner. It runs with sudo. The scan it starts runs in the sandbox with none. The outer layer is why the pin matters.
The scan also starts clean. It loads none of the repository's Claude Code settings, hooks, skills or MCP servers. Your deny rules are skipped too. To keep the scan out of a secrets folder, pass the rule in the job's claude_args input. Better still, keep secrets out of the repository.
Each scan posts a comment review, "never an approval or a request for changes." With the sample's suggest_patches: later, a second review with suggested fixes follows. It arrives "about 9 to 13 minutes after the first review, on a small pull request."
The line under the review's heading says whether the check passed and why.
Agents wrote each fix. Read it before you commit it.
Where the gate earns its place
On a repository where you already trust every pusher, the Action does what its announcement says. A second reader looks at every change for security flaws. The Action can stop the ones it is confident about.
Pair it with the habits in Build to Launch's 8 vibe coding mistakes that break production, and read a green check as one more signal from that reader, never as a security sign-off.
FAQ
Can I use my Claude subscription for the Claude Security GitHub Action?
No. The Actions job "can't sign in with a paid plan," the plugin page says.
The job needs Anthropic API access or a third-party provider such as Amazon Bedrock. Usage bills the account that owns the job's model credential.
Does the Claude Security GitHub Action scan pull requests from forks?
Not by default. Anthropic's CI guide fails the job for a branch in another repository, because its author could steer the scan and spend your credential.
The dangerously_scan_external_branches input turns that off. The guide does not encourage it.
Are draft and Dependabot pull requests scanned?
Not with the sample workflow. A draft passes with no scan until it is marked ready for review.
A Dependabot pull request also passes with no scan, according to the plugin page. A skipped job counts as passing under GitHub's rules. So review those changes yourself.
What is the difference between a pull request review and a scheduled scan?
A pull request review scans only that pull request's changes and takes "minutes to tens of minutes."
A scheduled scan reads the whole repository. It writes its report to the job summary, with no suggested fixes. Such a scan takes "minutes to hours," per Anthropic's CI guide.
Sources
- Anthropic, ClaudeDevs announcement on X, 2026-11-30: https://x.com/ClaudeDevs/status/2127487260300079139
- Anthropic, Claude Security plugin CI guide (CI.md): https://github.com/anthropics/claude-plugins-official/blob/main/plugins/claude-security/CI.md
- Anthropic, Scan your codebase for vulnerabilities (Claude Code Docs): https://code.claude.com/docs/en/claude-security
- Anthropic, Claude Security plugin SECURITY.md: https://github.com/anthropics/claude-plugins-official/blob/main/plugins/claude-security/SECURITY.md
- Anthropic, Claude Platform Docs, Rate limits: https://platform.claude.com/docs/en/api/rate-limits
- GitHub Docs, About status checks: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks
- GitHub Docs, Managing GitHub Actions settings for a repository: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository
- Aonan Guan, Zhengyu Liu and Gavin Zhong, Comment and Control: https://oddguan.com/blog/comment-and-control-prompt-injection-credential-theft-claude-code-gemini-cli-github-copilot
- RyotaK (GMO Flatt Security), Poisoning Claude Code: One GitHub Issue to Break the Supply Chain: https://flatt.tech/research/posts/poisoning-claude-code-one-github-issue-to-break-the-supply-chain
- Build to Launch, GitHub for non-programmers: https://buildtolaunch.substack.com/p/github-for-non-programmers
- Build to Launch, 8 vibe coding mistakes that break production: https://buildtolaunch.substack.com/p/8-vibe-coding-mistakes-that-break-production
Links
- Anthropic, ClaudeDevs announcement on X (documentation)
- Anthropic, Claude Security plugin CI guide (CI.md) (documentation)
- Anthropic, Scan your codebase for vulnerabilities (Claude Code Docs) (documentation)
- Anthropic, Claude Security plugin SECURITY.md (documentation)
- Claude Platform Docs, Rate limits (documentation)
- GitHub Docs, About status checks (documentation)
- GitHub Docs, Managing GitHub Actions settings for a repository (documentation)
- Aonan Guan, Zhengyu Liu and Gavin Zhong, Comment and Control (article)
- RyotaK (GMO Flatt Security), Poisoning Claude Code (article)
- Build to Launch, GitHub for Non-Programmers (article)
- Build to Launch, 8 Vibe Coding Mistakes That Break Apps After You Ship (article)
Every Friday: what builders launched this week, and one guide to help you ship yours.
More guides
gemini-2.5-pro Now Answers as 3.8 Flash, With No Error: Check the Model That Replied
Since December 1, 2026, the Gemini API answers gemini-2.5-pro calls with gemini-3.8-flash, billed at its rates, and nothing errors. A pinned model ID no longer fixes the model; comparing the model each response reports with the one you asked for does.
Parallel Claude Code Agents Cost Most Before You Know What You Want: $634 vs $81
Most of a parallel agent bill pays for agents building and rereading guesses while the direction is still open. Explore with one agent until you can write down what is wrong, then fan out against that note.
An AI Rewrite Passed 98% of Its Tests and Matched a Quarter of Real Requests: Verify Yours Against Recorded Inputs
Before a coding agent ports working code, record what the old code does on real inputs, lock that recording where the agent can't edit it, and call the port done only when the new code matches it. Anthropic's Rust rewrite shows why green tests are not enough.