A security reviewer for pull requests
Catch the mistake before it merges
Margin is a GitHub App that reads every pull request and comments on the lines that bring in a leaked secret, a vulnerable dependency, a risky Google Cloud Terraform change or an unsafe GitHub Actions workflow.
It reports only what the pull request introduced, explains each finding in plain words with a fix, and fails its check while a High finding is open.
What it checks
- Leaked secrets
- Keys and tokens added by any commit of the pull request, including ones a later commit removed, because they stay in the history.
- Vulnerable dependencies
- New or upgraded packages in
go.mod,package-lock.jsonandrequirements.txt, looked up in the OSV database. - Terraform on Google Cloud
- Public buckets and IAM, open admin ports, databases open to the internet, secrets written into the code and over-broad roles.
- GitHub Actions workflows
- Pull request code run with secrets, script injection, write-all tokens, unpinned actions and long-lived cloud keys.
How it works
GitHub sends Margin an event when a pull request is opened or updated. Margin compares the changed files at the pull request's starting point and at its newest commit, so a problem that was already there isn't blamed on the author. New findings get one comment each, on the line that causes them; the check summary lists them all.
A review Margin can't finish, because the pull request is too large or a file can't be read, fails the check rather than passing it quietly. A maintainer who decides a finding is wrong or already handled adds the margin-accepted label, which accepts exactly the High findings listed at that moment.
Limits
Margin reports known vulnerabilities in the versions you install; it doesn't check whether your code reaches the vulnerable function. Terraform rules judge only values written literally in the file, and modules aren't followed. Every rule and its fix is on the rules page.
Try it
Open a pull request on the public margin-demo repository: add a public bucket, pin an old version of a package or paste a fake token, and Margin will review it within a minute or two.