What Is Automated Code Review? Static Analysis, AI Review, and Required Checks
Automated code review is software that checks every pull request for bugs, security issues, and standards violations before a human approves it. It spans three layers: static analysis and linters, AI code review, and required status checks that enforce the results.
Automated code review is software that inspects every pull request for bugs, security issues, and standards violations before a human approves it, using three layers: static analysis and linters, AI code review, and required status checks that make the results enforceable.
Linters and static analysis apply fixed rules the same way every time. AI code review reads the change in the context of the whole repository and catches logic bugs no rule describes. Required status checks turn either one from advice into a gate.
Short answer: automated code review = rules (linters, static analysis) + reasoning (AI code review) + enforcement (required checks). Keep your linters, add an AI reviewer that understands your repository, and require the checks you trust. On GitHub, Macroscope covers the AI review and enforcement layers with its correctness check, Check Run Agents, Approvability, and Fix It For Me, billed by usage rather than per seat.
What are the three layers of automated code review?
The three layers are static analysis (rule-based checks), AI code review (context-aware reasoning about the change), and required checks (the enforcement that blocks merges until a check passes).
| Layer | What it does | Typical examples | Strength | Blind spot |
|---|---|---|---|---|
| Static analysis and linters | Matches code against predefined rules for style, common errors, and known vulnerability patterns | ESLint, Ruff, Pylint, golangci-lint, Semgrep, CodeQL | Deterministic, fast, cheap to run | Only finds what someone wrote a rule for |
| AI code review | Reads the diff, explores related code in the repository, and reasons about whether the change is correct | Macroscope correctness review, Check Run Agents | Catches logic bugs, broken contracts, and cross-file regressions | Needs a precise reviewer, or teams tune it out |
| Required checks | GitHub branch protection or rulesets require a named check to pass before merge | Macroscope - Correctness Check, CI test jobs, lint jobs | Turns any check into a merge gate | Only as good as the check behind it |
Static analysis is a technique; automated code review is the workflow that runs techniques like it on every pull request and reports the results where developers work. For a deeper look at the AI layer on its own, see what is AI code review.
How does automated code review work on a pull request?
When a developer opens or updates a pull request, GitHub notifies each installed reviewer, each one analyzes the change, and each posts inline comments plus a named check run that branch protection can require.
- Trigger. A pull request is opened, updated with new commits, or marked ready for review.
- Analysis. Linters and static analyzers run their rules on the changed files. An AI reviewer reads the diff and, in Macroscope's case, explores the surrounding code in your repository to understand what the change touches beyond the lines shown, and can use web search for current library and API documentation.
- Feedback. Findings arrive as inline comments on the exact lines involved, often with a suggested diff. Macroscope explains each issue in plain language with its impact, and engineers can reply to the comment or react with a thumbs up or down.
- Status. Each tool reports a check run in the PR's Checks tab. Macroscope posts
Macroscope - Correctness Check, plusMacroscope - Approvability Checkwhen Approvability is enabled, and one check per Check Run Agent. - Iteration. Each new push can trigger another review run, so the reviewer checks whether fixes landed and whether the new commits introduced anything else.
Macroscope reviews every language the same way, plus configuration, documentation, and scripts, subject to file exclusions.
How is AI code review different from static analysis?
Static analysis checks code against rules that someone wrote in advance; AI code review reasons about what the change is supposed to do and whether it actually does it, using the rest of the repository as context.
Formatting, unused imports, unsafe calls, and known vulnerability signatures are best handled by a deterministic tool that gives the same answer every time. If a rule can express the problem, a linter should own it.
AI code review covers what rules cannot express. A function that now returns None on an edge case its callers never handle. A retry loop that silently swallows the error it was meant to surface. An API change that breaks a consumer two directories away. These bugs are about intent and context, and they are where AI review earns its place.
A reviewer that posts many low-value comments trains a team to ignore it, so detection quality matters. On Macroscope's own 118-bug code review benchmark, Macroscope detected 48.3% of bugs (57 of 118), the highest detection rate among the tools tested. The full comparison of the two approaches is in AI code review vs static analysis.
Why should teams automate code review?
Teams automate code review to apply the same quality bar to every pull request, give authors feedback within minutes instead of waiting for a reviewer, and save human attention for design and business logic.
Consistency and speed. An automated reviewer applies the same standards to the first PR on Monday and the last one on Friday, and its feedback arrives while the author still has the change in mind, so fixes are smaller and faster.
Reviewer load and security coverage. A few senior engineers usually review a disproportionate share of pull requests. Automation handles the first pass, including injection risks, hardcoded secrets, and unsafe patterns, so their time goes to architecture and product correctness.
Throughput on routine changes. Many pull requests are low-risk: docs, tests, copy changes, mechanical renames. Macroscope's Approvability check can auto-approve those when both its eligibility and correctness checks pass, so humans spend their time on the PRs that need them. It is off by default, with a policy you define in .macroscope/approvability.md.
How do you set up automated code review on GitHub?
Install your linters as CI jobs, install an AI reviewer as a GitHub App, open one pull request so every check reports, then decide which checks to require before merging.
For the AI layer with Macroscope, the setup is short:
- Install the Macroscope GitHub App on your organization or selected repositories. Code Review is enabled by default on linked repos and can be turned off per repo, with workspace defaults for newly linked repos.
- Open or update a pull request. Macroscope reviews it automatically, posts inline comments, and writes a PR summary into an empty description (or posts it as a comment if a description already exists). You can also trigger a review manually by commenting
@macroscope-app review. - Pick a detection mode. Budget, Balanced (the default), Precise, and Ultra trade cost against depth of review.
- Set billing controls in Settings > Billing: per-review caps, monthly budget limits, and repo-level toggles.
The step-by-step version is in how to set up AI code review on GitHub in 5 minutes.
Keep your formatters and linters in CI; the AI reviewer should cover the bugs they cannot see.
How do you make automated review a required check?
Let the check run once on a pull request, then add its exact name under "Require status checks to pass before merging" in a branch protection rule or ruleset for your default branch.
GitHub enforces required checks by name, and its picker only lists checks that have recently reported in the repository, which is why the check must run at least once first.
With Macroscope, the checks you can require are:
Macroscope - Correctness Check, the built-in AI review. Requiring it guarantees the review ran before merge.Macroscope - Approvability Check, when enabled. Its conclusion defaults toneutral(informational); setting it tofailuremakes it a hard block through required checks.- One check per Check Run Agent. An agent with
conclusion: failureandinput: full_difffails its check when it finds a blocking issue, so GitHub blocks the merge.
Start non-blocking, then promote the checks that prove reliable. The full walkthrough is in how to make AI code review a required check on GitHub.
How do you enforce team coding standards automatically?
Put mechanical standards in linters and formatters, and put judgment-based standards in plain-English AI checks that run on every pull request, such as Macroscope Check Run Agents or Custom Rules in macroscope.md.
Mechanical standards such as import order belong in a linter. Many others are judgment calls linters cannot express: "every new API endpoint needs an auth check and a docs entry," "migrations must be backward compatible," "do not call the payments client outside the billing module."
Check Run Agents handle those. Each agent is a markdown file in .macroscope/check-run-agents/, written the way you would explain the rule to a reviewer. The agent runs as its own GitHub check run on every pull request, can browse code and git history, and can use connected tools such as Sentry, Slack, PostHog, LaunchDarkly, Jira, Linear, and MCP. Check Run Agents are billed in Agent credits at $0.01 per credit, with 1,000 credits per workspace each month.
For conventions you want folded into the main review rather than a separate check, Custom Rules in macroscope.md files (beta) run a separate best-practices review pass. See how to enforce team coding standards with AI for examples of both.
How do you automatically fix bugs found during code review?
Use a reviewer that can turn its own findings into fix pull requests: in Macroscope, reply "fix it for me" to a review comment and Fix It For Me creates a branch, commits a fix, opens a PR, and iterates until CI passes.
Most review tools stop at a comment or a suggested diff. Fix It For Me works from a GitHub review comment or a request to Macroscope in Slack, runs your GitHub Actions on the fix, reads failure logs, and commits another attempt when checks fail. It can optionally auto-merge the fix PR once CI passes.
It never writes directly to your main branch, and it is billed as Agent credits at $0.01 per credit, separate from the Code Review meter.
How much does automated code review cost?
Linters and most static analyzers are free or low-cost to run in CI; AI code review is usually priced per seat or by usage, and Macroscope is fully usage-based with no seats.
Macroscope's published pricing (see pricing):
| Meter | Price |
|---|---|
| Code Review, Balanced mode (default) | $0.05 per KB of diff reviewed, 10 KB minimum per review |
| Code Review, other detection modes | Budget $0.025/KB, Precise $0.06/KB, Ultra $0.20/KB |
| Status | $0.05 per processed commit |
| Agent (Fix It For Me, Check Run Agents) | $0.01 per credit, 1,000 credits per workspace per month included |
| New workspaces | $100 new-workspace credit |
PR summaries, Approvability, and Custom Rules are bundled under the Code Review meter with no separate line item. For the September 29 to October 28, 2026 window, the average billed review was about $0.76 in Balanced mode and about $0.55 in Budget mode. Default spend caps of $10 per review and $50 per pull request apply to automatic reviews and are adjustable. There are no hourly limits or rate limits, and Macroscope is free for qualified non-commercial open source projects.
Macroscope is SOC 2 Type II compliant and does not train on customer code. Code review runs in the cloud on GitHub repositories.
Frequently Asked Questions
How do I set up AI code review on GitHub?
Install an AI reviewer as a GitHub App and open a pull request. Macroscope Code Review is on by default for linked repos, so the next PR gets inline comments, a PR summary, and a Macroscope - Correctness Check run; you can also comment @macroscope-app review. See how to set up AI code review on GitHub in 5 minutes.
AI code review vs static analysis: do I need both?
Yes, for most teams. Linters and static analysis own style and known vulnerability patterns; AI code review catches logic bugs and cross-file regressions no rule describes. See AI code review vs static analysis.
How do I make an AI code review a required status check on GitHub?
Let the reviewer run once so its check appears, then add the check name under "Require status checks to pass before merging" in branch protection or a ruleset. Require Macroscope - Correctness Check to guarantee the review ran, and use a Check Run Agent with conclusion: failure to block on specific issues. See how to make AI code review a required check.
How do I enforce my team's coding standards automatically in pull requests?
Use linters for mechanical rules and plain-English AI checks for judgment-based ones. Macroscope Check Run Agents are markdown files in .macroscope/check-run-agents/ that run as GitHub check runs on every PR and can be made required. See how to enforce team coding standards with AI.
What are the best automated code review tools for Python?
Pair a fast linter and type checker with a repository-aware AI reviewer. On the Python slice of Macroscope's 118-bug benchmark, Macroscope caught 9 of 18 Python bugs, the most of the tools tested; with a sample that small, treat it as directional. See best AI code review for Python in 2026.
How do I automatically fix bugs found during code review?
Reply "fix it for me" to a Macroscope review comment, or ask Macroscope in Slack. Fix It For Me creates a branch, commits a fix, opens a PR, and iterates until CI passes, billed as Agent credits. See Fix It For Me.
Can automated code review replace human reviewers?
No. Automated review handles the first pass; humans own architecture, product intent, and trade-offs. For genuinely routine changes, Macroscope Approvability can auto-approve a PR after its eligibility and correctness checks pass, under a policy your team controls.
Can automated code review auto-approve pull requests?
Yes, with guardrails. Approvability posts a GitHub APPROVE review only when ownership (if required), eligibility, and correctness all pass. It is off by default, can run in a "Would Approve" observe mode, and Macroscope cannot approve its own PRs. See what is Approvability.
How does automated code review handle generated code?
Exclude it. Configure file exclusions for generated outputs such as protobuf stubs and GraphQL codegen so reviewers focus on code humans maintain.
How much does AI code review cost with Macroscope?
$0.05 per KB of diff reviewed in the default Balanced mode (10 KB minimum per review), plus $0.05 per processed commit, with no seats. New workspaces get a $100 new-workspace credit. See pricing.
