What this thread does
Do first: in the Claude Console create an API key in a standalone workspace with a monthly spend limit, select that workspace in the key form, and save the key as the repository secret ANTHROPIC_API_KEY. CI guide
Short answer
The Claude Security plugin reviews eligible pull requests in GitHub Actions; the default workflow skips some drafts and internal Dependabot runs, and rejects fork branches. The scan posts a comment review; with suggest_patches: later, a second job posts fixes in another review. The job can block the merge when it is a required status check; a second workflow can scan the whole repository on a schedule. Plugin docs CI guide It cannot sign in with a paid plan, so it needs Anthropic API access or a third-party provider, and its cost lands on the account that owns the job's credential. Plugin docs
Choose / don't choose
| Route | Choose it when | Not for |
|---|---|---|
| Action on pull requests | You trust everyone who can push and want findings before merge | Public repositories where a review could disclose a live vulnerability, or repositories open to outside contributors by default |
| Scheduled whole-repository scan | You want to find flaws in code that merged before the action existed | Small time limits or tight budgets: a whole-repository scan can take hours and cost much more than a review |
Scan in your own session (/claude-security) | You want findings kept private or want to scan a branch, pull request or commit locally | Blocking merges automatically |
Settings that matter
| Setting | Behavior | Source |
|---|---|---|
fail_on | Which findings fail the job: confident-high, high (the default), medium, any or never; blocks a merge only if the job is a required status check | CI guide |
suggest_patches: later | A second job posts suggested fixes after the first review, about 9 to 13 minutes later on a small pull request | CI guide |
scan_drafts | Drafts normally skip scanning; scan_drafts: "true" enables it, and missing author write-access confirmation can trigger a scan or failure. | CI guide |
dangerously_scan_external_branches | By default a pull request from a fork fails the job; turning this on lets every such branch run, which the guide does not encourage | CI guide |
| Runner | GitHub-hosted Linux runners on GitHub.com only; GHE.com and GitHub Enterprise Server are not supported; merge queue and push events are not supported | CI guide |
| Action pin | Pin a full commit after @, never a branch, because the action runs with sudo; nothing warns you about newer releases | CI guide |
Order of operations
1. Create the workspace-scoped API key and save it as ANTHROPIC_API_KEY; if your organization allows only listed actions, also allow anthropics/claude-code-action, oven-sh/setup-bun and actions/upload-artifact. The guide recommends workload identity federation instead of a stored key where you can set it up. CI guide 2. Save the sample as .github/workflows/claude-security.yml and replace the action reference with a full commit pinned after the @; the plugin docs give the commit for 0.13.0. CI guide Plugin docs 3. Open a non-draft pull request that adds the file, and watch for one comment review (never an approval or a request for changes). CI guide 4. To block merges, make the claude-security job a required status check only after reading "Blocking the merge" in the guide. CI guide 5. Add the scheduled workflow as a separate file with a differently named job, and keep schedule: and workflow_dispatch: there. CI guide 6. Review every suggested fix before committing it; the guide says AI agents write them. CI guide
Known failures and fixes
- Fork pull request fails: that is the default; have a maintainer review the change and open a branch inside your repository instead. CI guide
- A required check turns green on a commit whose scan failed: re-runs, manual runs or another pull request with the same head can do this; keep the scheduled job in its own workflow with another job name and do not skip the job for external branches. CI guide
- Drafts normally skip scanning;
scan_drafts: "true"enables it, and missing author write-access confirmation can trigger a scan or failure. The sample skips Dependabot runs on internal branches; fork branches fail by default. Review skipped changes yourself. CI guide Plugin docs - HTTP 400 on authentication: the guide says an unscoped API key is not limited to one workspace and fails this job; scope the key. CI guide
- The scan cannot see local Claude Code settings, hooks, skills, MCP servers or
CLAUDE.md; pass deny rules throughclaude_args. CI guide
Missing
- The pages give no price per scan; cost depends on pull request size, effort and model.
- A clean review is not proof of absence, as the guide itself says.
- Which other CI systems are supported is not stated; the guide covers GitHub.com runners only.
Evidence
Claude Code docs "Scan your codebase for vulnerabilities" and the plugin's CI guide at commit 1da4bcb (dated 2026-11-24), both read 2026-12-03. 0 trials in this draft; not tried by WhatWorks.
Checked
2026-12-03; both pages were read as served on that date.
Started from a post by @Anthropic, packaged by the editor. Original post