Skip to content
02 / 08

Margin

A GitHub App that reviews pull requests for leaked secrets, vulnerable dependencies, risky Google Cloud Terraform and unsafe GitHub Actions workflows, and comments on the lines that bring them in, each finding with its fix.

Developers and maintainers · 2026 · Go, Cloud Run, Cloud Tasks

Live since November 2026

Margin’s own page: what it checks, how it works and where its limits are.
Problem
Fieldwork’s own pipeline already runs scanners. What they don’t give a developer is a review: one that speaks only about what this pull request introduces, beside the lines it changed, in words someone who is not a security specialist can act on.
Built
A review on the lines a pull request changes, new findings only · Leaked secrets in every commit, including ones a later commit removed · New or upgraded Go, npm and Python packages, looked up in the OSV database · Terraform on Google Cloud · GitHub Actions workflows · A check that fails while a High finding is open · Findings accepted with a label · A public rule catalog
Stack
Go (gitleaks’ rules, HashiCorp HCL, golang.org/x/mod) · Two Google Cloud Run services and Cloud Tasks behind the load balancer · Secret Manager · Terraform · GitHub Actions, keyless through Workload Identity Federation · Sigstore signing and an SPDX SBOM
Status
Live, the second program of Fieldwork. It reviews pull requests on Fieldwork’s own repository and on margin-demo, a public repository where anyone can open a pull request to try it.

The problem

Fieldwork’s own pipeline already runs scanners, so Margin was never meant as one more. What a scanner’s report doesn’t give a developer is a review: one that speaks only about what this pull request introduces, beside the lines it changed, in words someone who is not a security specialist can act on, and with nothing to set up in the repository first.

What I built

Margin is a GitHub App. When a pull request is opened or updated it compares the changed files at the pull request’s starting point and at its newest commit, and comments on what is new: a leaked secret, a dependency with a known vulnerability, a risky Terraform change on Google Cloud, an unsafe GitHub Actions workflow. It reads every commit, so a key that was added and then “removed” in a later commit is still caught, because it stays in the history. Every message comes from a fixed, reviewed rule catalog, never from a language model, so the same input always gives the same review. Its check fails while a High finding is open; a maintainer can accept one with a label.

It is split in two services on purpose. The part the internet can reach holds only the webhook secret: it checks each delivery’s signature and queues a review. The part that holds the app’s private key cannot be reached from the internet at all. Margin never checks out, builds or runs the code it reviews, and it never repeats a secret it finds. The demo repository accepts pull requests from anyone, so guests get their own queue and much smaller budgets, and a review that cannot be finished fails the check rather than passing quietly.

Limits

Margin’s own page states them. It doesn’t check whether your code reaches the vulnerable function of a dependency, it doesn’t follow Terraform modules, and it judges only the literal values written in a file. It comments and sets its check; people decide what to merge.

Fieldwork

Margin is the second program of Fieldwork, after Survey, and runs on the same hardened Google Cloud platform: keyless CI/CD, least-privilege identities, signed images and security gates on every change. The design, the threat model and the rule catalog are public.

The interface

Margin — The rule catalog: the same text appears in Margin’s comments, with the details of the finding.
The rule catalog: the same text appears in Margin’s comments, with the details of the finding.
Margin — Terraform on Google Cloud: each rule with its severity, what it means and the fix.
Terraform on Google Cloud: each rule with its severity, what it means and the fix.
Margin — GitHub Actions workflows, in the same catalog.
GitHub Actions workflows, in the same catalog.

Next case study

BloomOps →