Code review
Automated code review inspects GitHub pull requests before they merge and leaves inline findings directly on the diff. Each enabled Guardian runs a focused review charter to catch bugs, regressions, and security issues on every push.
Repository settings
In Settings → Reviews, an organization owner or admin chooses which connected GitHub repositories receive automated reviews and when they run:
| Setting | Behavior |
|---|---|
| Auto | Reviews when a PR is ready for review and again after each new push. |
| When ready | Reviews once when a PR opens ready for review or leaves draft. |
| Off | No automated review runs for that repository. |
If your organization requires subscription-backed models, the reviewing account needs a connected subscription it can use.
Guardians
A Guardian is a review charter that defines what automated reviews look for and which file paths they cover. Two built-in Guardians ship with every workspace:
- Review (enabled by default): Flags correctness bugs, regressions, and edge cases.
- Security (off by default): Flags security-sensitive regressions on GitHub pull requests.
You can toggle and configure built-in Guardians, or create custom charters for team-specific invariants such as migration safety, API compatibility, or missing regression tests.
Create a custom Guardian
Open Guardians
In Settings → Reviews, find Guardians and select New guardian.
Define what to flag
Name the charter and describe concrete failure conditions in What to flag, including the evidence each finding should cite (file, line, and breaking behavior).
Scope paths and model
Add up to 20 path patterns (one per line) in Scope, or leave it empty to cover the whole repository. Optionally override the organization's default review model, then save.
Tune charters
Test a new charter on a few real pull requests before broadening it. If a Guardian reports style noise instead of real defects, list what to ignore in What to flag; if it misses an invariant, add a concrete example or narrow Scope. Keep independent concerns in separate Guardians so you can enable, tune, or pause each one on its own.
Security review
Turn on the built-in Security Guardian in Settings → Reviews, or add a custom security charter tailored to your architecture:
| Risk area | What to flag |
|---|---|
| Secrets and credentials | Hardcoded secrets or code paths that log, return, or serialize secret values (cite the location without quoting the value). |
| Authentication and authorization | Routes or handlers missing identity, role, or tenant authorization checks. |
| Injection and untrusted input | Unvalidated or unescaped input reaching queries, shell commands, or rendered HTML. |
| Data flow | Sensitive data crossing trust boundaries or leaking into logs, responses, or client bundles. |
| Dependencies | Dependency changes introducing unnecessary privileges or removing existing protections. |
Guardians review pull request diffs—they complement, rather than replace, dependency scanning, secret scanning, runtime tests, and GitHub branch protection. If a review flags a committed credential, rotate or revoke it immediately; removing it from the diff is not enough.
Inline findings and merge checks
- Inline threads: Findings appear on the GitHub diff with line anchors. After pushing a verified fix, reply in the thread with what changed and the verification you ran, and leave unresolved findings open.
- Merge gates: Guardian reviews do not submit a GitHub Request changes review. Verify the current PR head along with GitHub's separate required checks, approvals, and branch protection rules before merging.