Security-focused review of pull requests
A GitHub Action asks an agent to read each PR diff for injection, auth and data exposure problems and comment on the risky lines.
The use case
Small teams rarely have a security engineer looking at every pull request. Anthropic publishes a GitHub Action that runs Claude over a PR diff with a security brief: look for injection, broken authorization, unsafe deserialization, secrets and similar issues, and filter out low-confidence noise. Findings come back as PR comments tied to specific lines with an explanation and a suggested fix. It works alongside, not instead of, static analysis. A developer with security knowledge still decides whether each finding is real, and the action should not be allowed to block merges until the team trusts its false-positive rate.
Example workflow
- Add the action to the repository workflow with an API key secret
- Action runs on new or updated pull requests
- Agent reviews the diff and posts findings as comments
- Developer confirms or dismisses each finding
- Track confirmed findings to tune the instructions
Tools
- Claude Code
- GitHub Actions
Risks and guardrails
- Running on PRs from forks can expose secrets or allow prompt injection; restrict triggers
- False negatives happen; keep SAST and dependency scanning
- Do not auto-block merges on unreviewed findings
Sources
Written by Agents Lookup. Credits and official pages for the tools this use case names:
- Anthropic on GitHub: claude-code-security-review: github.com/anthropics/claude-code-security-review