Skip to main content
Code Review Risk Assessment adds a risk signal to Unblocked’s automated pull request reviews. You define the kinds of changes your team considers risky, and Unblocked scores each PR against those policies. Teams can use that score to approve routine changes faster while keeping human reviewers focused on work that needs closer judgment.

How it works

Risk assessment runs after Unblocked completes a pull request review without finding any issues. At that point, Unblocked reads the risk policy file from your repository’s default branch and checks the PR changes against each policy. It then adds a report with a risk score — lowest, low, medium, high, or highest — and an explanation for the score. Unblocked uses the policy from the default branch, not policy changes proposed in the PR. This keeps the risk score tied to the rules your team has already accepted. If the risk score is low or lowest, Unblocked approves the pull request. For higher-risk changes, Unblocked posts the report without approval so reviewers can see what needs attention.

Setup

Risk assessment is enabled per repository. To turn it on for a repository, add a policy file that describes which kinds of changes your team considers risky. You can write the file manually following the examples below, or ask Unblocked to create a first draft that you review and tune before committing.
1

Create a risk policy file

Create .unblocked/risk-policies.yaml in the root of your Git repository. You can also ask Unblocked to draft an initial version.
2

Review and tune the policy file

Review the policy file and tune it so it matches how your team thinks about risk.
3

Commit the policy file

Commit and push the file to the default branch.

Sample policies

Start with a small set of policies that cover the changes your team wants to treat with extra care. Write each policy so it can be evaluated on its own, without relying on another policy or an external definition. If you need to add general guidance or background information, add it to the optional context section.

Schema

The policy file is YAML. It can include optional repository context and one or more independent policies. Each policy names a kind of change and the risk Unblocked should assign when it matches.