Code Review Is Risk Management

Code review is often treated as a quality process.

It isn’t.

It is a risk-management process.

A forty-line change to an onboarding screen and a forty-line change to payment idempotency may look identical in a pull request. Both have a diff, an author, a green build, and an approval button.

One can inconvenience a user. The other can corrupt money.

The diff measures change. It does not measure consequence.


Code Is Not Equally Important#

Some code carries the company. Some code supports the company. Some code is temporary scaffolding around an experiment that may disappear next month.

Treating all three as equally permanent is not quality. It is a failure to allocate judgment.

The useful question is not:

How important is this file?

It is:

If this behavior is wrong, how far does the damage travel, how quickly will we know, and how easily can we recover?

A frontend component may be disposable presentation code. It may also control consent, pricing, authentication, or the only path by which a customer can recover an account.

A one-line configuration change can be more dangerous than a thousand-line isolated feature.

Risk belongs to behavior and position in the system, not to a file extension.


The Cost of Being Wrong#

Risk comes down to three questions:

  • Impact: How much damage can this change cause?
  • Detection: How quickly will we know that it is wrong?
  • Recovery: How easily can we disable, reverse, or repair it?

Those questions create three useful levels of review.

Low-risk code should optimize for learning. If the change is isolated, observable, and easy to replace, review should be fast. The goal is not longevity. It is containment.

Medium-risk code should optimize for confidence. The behavior should be understandable, tested at the relevant boundary, and easy enough to reverse. Known compromises are acceptable when their blast radius is bounded.

Critical code should optimize for consequence. Identity, authorization, money movement, irreversible data changes, shared contracts, and core domain rules deserve the team’s best engineering judgment. Failure behavior must be explicit. Recovery cannot be an afterthought.

Critical code does not need to be perfect. It needs to be understood.

The point is not to label every directory forever. The point is to decide how much evidence a change needs before the company accepts its risk.


A Pull Request Inherits the Highest Risk It Touches#

Classifying parts of the codebase is useful. It is not enough.

A low-risk screen that changes which authorization parameter reaches a critical service is a critical change. A small API modification that alters a shared event may affect every consumer downstream. A harmless-looking dependency update can change the security or runtime behavior of the whole product.

Review the path through the system, not only the lines in the diff.

For every pull request, trace four things:

  • Control: Which decisions can this change make or bypass?
  • Data: What information can it read, modify, expose, or destroy?
  • Dependency: Which callers, consumers, and contracts inherit its behavior?
  • Recovery: Can the team disable, revert, repair, or migrate away from it?

The pull request takes the highest risk reached by any of those paths.

Consider the payment example. The diff may change a single retry condition. A unit test may prove that the function returns the expected result. But if two requests can now charge the same customer, the important evidence is not that the function works once.

The important evidence is that the payment invariant survives retries, concurrency, and partial failure-and that the team can contain the damage if it does not.

That is what the reviewer is approving.

If one pull request mixes a disposable experiment with a critical schema migration, split it. Different risks deserve different evidence, different reviewers, and a different pace.


Review Depth Must Change#

Uniform review looks disciplined because every change passes through the same ceremony.

In practice, it creates two failures at once.

Low-risk work waits for attention it does not need. Critical work receives the same shallow green checks as everything else.

The review should adapt.

For a low-risk change, automated checks and a quick inspection may be enough. Confirm that the change is contained, observable, and easy to reverse. Then move.

For a medium-risk change, one qualified reviewer should understand the behavior, inspect the affected boundaries, and verify the most credible failure cases.

For a critical change, review begins before the code. The design, invariants, migration, and recovery path deserve attention from the people who understand the affected domain. The release should be gradual enough that the system can prove the change safe before the entire company depends on it.

More review is not automatically better.

More reviewers help only when they add missing judgment. More tests help only when they prove behavior that matters. A rollback helps only when the state change is actually reversible.

Yes, critical changes may move more slowly.

That is not a failure of the process. It is the organization deciding that waiting is cheaper than being wrong.

The failure is making everything else wait with them.


Risk Changes With the System#

A temporary component can become critical without anyone deciding that it should.

An experiment gains customers. An internal endpoint acquires external consumers. A local library becomes the default path for every service. A reversible write becomes the source of truth.

The old label remains while the consequence changes underneath it.

Risk classifications must move with the system. Incidents, dependency growth, customer adoption, persistent state, and expanding permissions are all signals that yesterday’s review level is no longer enough.

The objective is not to fill the critical tier forever. It is to protect what must be protected-and redesign the system so that fewer changes can cause irreversible harm.


The Reviewer Still Owns the Merge#

Agents make uniform review more tempting.

They can inspect every diff, trace callers, compare nearby patterns, run tests, and produce a convincing summary. That makes the process look complete.

But completeness is not judgment.

An agent can expose failure modes. It cannot decide how much customer, operational, or strategic risk the company should accept.

The author proposes the risk level. The agent can challenge it. The reviewer confirms it.

When the blast radius is unknown, uncertainty raises the level. It does not excuse the classification.

The agent can investigate the change. The reviewer still owns the merge.


Closing#

Not every change deserves the same review.

Some changes should move quickly because being wrong is cheap. Others should move slowly because recovery is not.

The discipline is not applying the same process everywhere. It is knowing where judgment matters most.

The diff tells you what changed. The reviewer decides whether the risk is acceptable.


References and Further Reading#

  1. Review as the Constraint: Code Was Never the Bottleneck explores what happens when producing code becomes cheap and review, understanding, and absorption become the scarce capacity. https://avivzaken.com/docs/code-was-never-the-bottleneck/

  2. Reversibility and Velocity: Velocity Is the Product explains why small, reviewable, testable, and reversible changes allow speed and safety to reinforce each other. https://avivzaken.com/docs/velocity-is-the-product/

  3. System Confidence: Technical Debt Is a Tool argues that the deeper cost of debt is not untidy code, but the loss of confidence required to change a system safely. https://avivzaken.com/docs/technical-debt-is-a-tool/

  4. Judgment as the Scarce Skill: How AI Is Changing Engineering Team Structure examines why producing code is getting cheaper while the ability to verify, integrate, and own it remains constrained. https://avivzaken.com/docs/the-team-shape-is-changing/

  5. Risk-Based Code Review: NIST, Secure Software Development Framework (SSDF) Version 1.1, especially PW.7 on reviewing and analyzing human-readable code according to security requirements. https://csrc.nist.gov/pubs/sp/800/218/final

  6. Review Depth and Specialist Judgment: OWASP, Secure Code Review Cheat Sheet, on risk-based scheduling, threat-based review, specialist roles, and combining automated analysis with manual review. https://cheatsheetseries.owasp.org/cheatsheets/Secure_Code_Review_Cheat_Sheet.html

  7. High-Assurance Approval: SLSA, Source: Requirements for Producing Source, version 1.2, including two-person review controls for protected source changes. https://slsa.dev/spec/v1.2/source-requirements

  8. AI-Assisted Code Review: Recent field studies document both useful suggestions and substantial low-signal feedback, reinforcing the need for human judgment over the result. See Chowdhury et al., From Industry Claims to Empirical Reality (MSR 2026), https://arxiv.org/abs/2604.03196, and Mujahid et al., Impact of LLM-based Review Comment Generation in Practice, https://www.mozillafoundation.org/en/research/library/impact-of-llm-based-review-comment-generation-in-practice-a-mixed-open-closed-source-user-study/

Previous How AI Is Changing Engineering Team Structure